/** * @param definitions * @return */ private static ColorDefinition[] addDefaulted(ColorDefinition[] definitions) { IThemeRegistry registry = WorkbenchPlugin.getDefault().getThemeRegistry(); ColorDefinition[] allDefs = registry.getColors(); SortedSet set = addDefaulted(definitions, allDefs); return (ColorDefinition[]) set.toArray(new ColorDefinition[set.size()]); }
/** * Return the definitions that should have their default preference value set but nothing else. * * @param definitions the definitions that will be fully handled * @return the remaining definitions that should be defaulted */ private static ColorDefinition[] getDefaults(ColorDefinition[] definitions) { IThemeRegistry registry = WorkbenchPlugin.getDefault().getThemeRegistry(); ColorDefinition[] allDefs = registry.getColors(); SortedSet set = new TreeSet(IThemeRegistry.ID_COMPARATOR); set.addAll(Arrays.asList(allDefs)); set.removeAll(Arrays.asList(definitions)); return (ColorDefinition[]) set.toArray(new ColorDefinition[set.size()]); }