Bug 456291 - [Preferences] Two empty "colors and fonts" preference
authorRobert Roth <robert.roth.off@gmail.com>
Wed, 29 Apr 2015 10:30:30 +0000 (13:30 +0300)
committerDani Megert <Daniel_Megert@ch.ibm.com>
Wed, 29 Apr 2015 14:48:32 +0000 (10:48 -0400)
groups

In case a theme category doesn't have any children, hide it.

Change-Id: I80c1ca0381a891b803b624bc61edf937b6a001b1
Signed-off-by: Robert Roth <robert.roth.off@gmail.com>
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java

index 95418cf..96e09b2 100644 (file)
@@ -9,7 +9,7 @@
  *     IBM Corporation - initial API and implementation
  *     Cornel Izbasa <cizbasa@info.uvt.ro> - Bug https://bugs.eclipse.org/436247
  *     Lars Vogel <Lars.Vogel@vogella.com> - Bug 440136
- *     Robert Roth <robert.roth.off@gmail.com> - Bug 274005
+ *     Robert Roth <robert.roth.off@gmail.com> - Bugs 274005, 456291
  *******************************************************************************/
 package org.eclipse.ui.internal.themes;
 
@@ -327,7 +327,10 @@ public final class ColorsAndFontsPreferencePage extends PreferencePage
                     Set bindings = themeRegistry
                             .getPresentationsBindingsFor(categories[i]);
                                        if (bindings == null) {
-                                               list.add(categories[i]);
+                                               Object[] children = getChildren(categories[i]);
+                                               if (children != null && children.length > 0) {
+                                                       list.add(categories[i]);
+                                               }
                                        }
                 }
             }