- Preferences.setPreferences(new Preferences()
- {
- @Override
- public ColorDefinition getColorDefinition(String name)
- {
- RGB rgb = getColorRegistry().getRGB(name);
- if (rgb == null)
- {
- StatusManager.getManager().handle(new Status(IStatus.ERROR, "net.mograsim.plugin.core", "No color for name " + name));
- return null;
- }
- return new ColorDefinition(rgb.red, rgb.green, rgb.blue);
- }
-
- @Override
- public Color getColor(String name)
- {
- return getColorRegistry().get(name);
- }
-
- private ColorRegistry getColorRegistry()
- {
- return PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
- }
- });