I cannot change the font size of package explorer in Eclipse

I try to change the font size of package explorer in Eclipse from menu WindowPreferencesGeneralAppearance, and I fail to change the font size. How can I do that? I use Eclipse v4.2 (Juno) on Windows 7.


Solution 1:

On Juno and up you can adjust that font by CSS.

Lookup the files in eclipse\plugins\org.eclipse.platform_4.2.x.y\css for your current style sheet (probably e4_default_win7.css), and then just add the following rule:

#org-eclipse-jdt-ui-PackageExplorer Tree,
#org-eclipse-ui-navigator-ProjectExplorer Tree {
  font-size: 10px; /* <-- Desired font size */
}

Update: stylesheets are in eclipse/plugins/org.eclipse.ui.themes_x.x.x.vxxxxx/css folder since Eclipse 4.4 (Luna).

Solution 2:

FYI:

From Eclipse v4.4 (Luna):

It looks like the CSS files are no longer in the old folder:

`eclipse/plugins/org.eclipse.platform_4.x.x.vy/css`,

They are moved to the new folder:

eclipse/plugins/org.eclipse.ui.themes_x.x.x.vxxxxx/css

And you must select a theme to apply it, in the menu WindowsPreferenceGeneralAppearance.

Solution 3:

This worked for me:

.MPart Tree{
  font-size: 8;
}

Solution 4:

These are my settings and a screenshot of the IDE.

    #org-eclipse-jdt-ui-PackageExplorer Tree,
    #org-eclipse-ui-navigator-ProjectExplorer Tree,
    #org-eclipse-ui-views-ContentOutline Tree,
    #PerspectiveSwitcher ToolBar {
      font-size: 8px;
    }

    .MPartStack {
      font-size: 8;
      swt-simple: false;
      swt-mru-visible: false;
    }

Eclipse screenshot