Package org.eclipse.ui.internal.themes

Examples of org.eclipse.ui.internal.themes.ThemeRegistry


     *
     * @return the theme registry
     */
    public IThemeRegistry getThemeRegistry() {
        if (themeRegistry == null) {
            themeRegistry = new ThemeRegistry();
            ThemeRegistryReader reader = new ThemeRegistryReader();
            reader.readThemes(Platform.getExtensionRegistry(),
                    themeRegistry);
        }
        return themeRegistry;
View Full Code Here


    }

    //TODO: confirm
    private void loadThemes(IExtension ext) {
        ThemeRegistryReader reader = new ThemeRegistryReader();
        ThemeRegistry registry = (ThemeRegistry) WorkbenchPlugin.getDefault()
                .getThemeRegistry();
        reader.setRegistry(registry);
        IConfigurationElement[] elements = ext.getConfigurationElements();
        for (int i = 0; i < elements.length; i++) {
      reader.readElement(elements[i]);
    }

        Collection colors = reader.getColorDefinitions();
        ColorDefinition[] colorDefs = (ColorDefinition[]) colors
                .toArray(new ColorDefinition[colors.size()]);

        ITheme theme = workbench.getThemeManager().getTheme(
                IThemeManager.DEFAULT_THEME);
        ThemeElementHelper.populateRegistry(theme, colorDefs, PrefUtil
        .getInternalPreferenceStore());

        Collection fonts = reader.getFontDefinitions();
        FontDefinition[] fontDefs = (FontDefinition[]) fonts
                .toArray(new FontDefinition[fonts.size()]);
        ThemeElementHelper.populateRegistry(theme, fontDefs, PrefUtil
        .getInternalPreferenceStore());

        Map data = reader.getData();
        registry.addData(data);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.internal.themes.ThemeRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.