diff --git a/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java b/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java index c688fcebda73..4fccb95af229 100644 --- a/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java +++ b/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java @@ -1959,6 +1959,17 @@ private void editColor(ColorDefinition definition, Display display) { } } + private ThemeElementCategory getCategory() { + IStructuredSelection item = (IStructuredSelection) tree.getViewer().getSelection(); + if (item != null && !item.isEmpty()) { + Object object = item.getFirstElement(); + if (object instanceof ThemeElementCategory) { + return (ThemeElementCategory) object; + } + } + return null; + } + protected void updateControls() { FontDefinition fontDefinition = getSelectedFontDefinition(); if (fontDefinition != null) { @@ -1984,6 +1995,18 @@ protected void updateControls() { setCurrentColor(colorDefinition); return; } + ThemeElementCategory category = getCategory(); + if (category != null) { + fontChangeButton.setEnabled(false); + fontSystemButton.setEnabled(false); + fontResetButton.setEnabled(false); + editDefaultButton.setEnabled(false); + goToDefaultButton.setEnabled(false); + + String desc = category.getDescription() != null ? category.getDescription() : ""; //$NON-NLS-1$ + descriptionText.setText(desc); + return; + } // not a font or a color? fontChangeButton.setEnabled(false); fontSystemButton.setEnabled(false); diff --git a/examples/org.eclipse.e4.demo.cssbridge/plugin.properties b/examples/org.eclipse.e4.demo.cssbridge/plugin.properties index 4d81185dd0c2..5d1e2357a8a2 100644 --- a/examples/org.eclipse.e4.demo.cssbridge/plugin.properties +++ b/examples/org.eclipse.e4.demo.cssbridge/plugin.properties @@ -19,6 +19,8 @@ org.eclipse.e4.demo.cssbridge.blue.theme=Blue theme org.eclipse.e4.demo.cssbridge.green.theme=Green theme org.eclipse.e4.demo.cssbridge.red.theme=Red theme +org.eclipse.e4.demo.cssbridge.ui.views.Theme.description= Colors and fonts used to demonstrate CSS based UI styling. + org.eclipse.e4.demo.cssbridge.ui.views.Theme=CSS bridge demo theme org.eclipse.e4.demo.cssbridge.ui.views.theme.shell.background=Shell background org.eclipse.e4.demo.cssbridge.ui.views.theme.shell.selection.foreground=Shell selection foreground diff --git a/examples/org.eclipse.e4.demo.cssbridge/plugin.xml b/examples/org.eclipse.e4.demo.cssbridge/plugin.xml index 2f4eefd3db91..05d006814a0a 100644 --- a/examples/org.eclipse.e4.demo.cssbridge/plugin.xml +++ b/examples/org.eclipse.e4.demo.cssbridge/plugin.xml @@ -109,10 +109,14 @@ - - + + + %org.eclipse.e4.demo.cssbridge.ui.views.Theme.description + + +