Package org.eclipse.jface.resource

Examples of org.eclipse.jface.resource.ColorRegistry


            fBackgroundColorName = backgroundColorName;
        }

        @Override
        public void applyStyles(TextStyle textStyle) {
            ColorRegistry colorRegistry = JFaceResources.getColorRegistry();
            Font font = JFaceResources.getFontRegistry().getItalic(fontName);
            if (fForegroundColorName != null) {
                textStyle.foreground = colorRegistry.get(fForegroundColorName);
            }
            if (fBackgroundColorName != null) {
                textStyle.background = colorRegistry.get(fBackgroundColorName);
            }
            textStyle.font = font;
        }
View Full Code Here


            fBackgroundColorName = backgroundColorName;
        }

        @Override
        public void applyStyles(TextStyle textStyle) {
            ColorRegistry colorRegistry = JFaceResources.getColorRegistry();
            Font font = JFaceResources.getFontRegistry().getBold(fontName);
            if (fForegroundColorName != null) {
                textStyle.foreground = colorRegistry.get(fForegroundColorName);
            }
            if (fBackgroundColorName != null) {
                textStyle.background = colorRegistry.get(fBackgroundColorName);
            }
            textStyle.font = font;
        }
View Full Code Here

            fontRegistry = new FontRegistry( getWorkbench().getDisplay() );
        }

        if ( colorRegistry == null )
        {
            colorRegistry = new ColorRegistry( getWorkbench().getDisplay() );
        }

        valueEditorPreferences = new ValueEditorsPreferences();

        if ( filterTemplateContextTypeRegistry == null )
View Full Code Here

    * Initializes the given preference store with the default values.
   *
    * @param store the preference store to be initialized
    */
  public static void initializeDefaultValues(IPreferenceStore store) {
    ColorRegistry registry= null;
    if (PlatformUI.isWorkbenchRunning())
      registry= PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();

    store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.USE_ANNOTATIONS_PREFERENCE_PAGE, false);
    store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.USE_QUICK_DIFF_PREFERENCE_PAGE, false);
View Full Code Here

     */
    void setBackgroundColor(String colorName) {
        if (colorName == null) {
            colorName = DEFAULT_BG_COLOR;
        }
        final ColorRegistry colorRegistry = getColorRegistry();
        Color bgColor = null;
        synchronized (colorRegistry) {
            bgColor = colorRegistry.get(colorName);
            if (bgColor == null) {
                RGB backgroundRGB = obtainRGBFromString(colorName);
                if (backgroundRGB == null) {
                    bgColor = colorRegistry.get(DEFAULT_BG_COLOR);
                    if (bgColor == null) {
                        backgroundRGB = obtainRGBFromString(DEFAULT_BG_COLOR);
                        if (backgroundRGB == null) {
                            throw new IllegalStateException(
                                    "Could not obtain an"
                                            + " RGB value for default background color: \""
                                            + DEFAULT_BG_COLOR + "\"");
                        }
                        colorRegistry.put(colorName, backgroundRGB);
                        bgColor = colorRegistry.get(colorName);
                    }
                } else {
                    colorRegistry.put(colorName, backgroundRGB);
                    bgColor = colorRegistry.get(colorName);
                }
            }
        }

        // Also ensure that the background colour of child format composites
View Full Code Here

     */
    void setBorderColor(String colorName) {
        if (colorName == null) {
            colorName = DEFAULT_BORDER_COLOR;
        }
        final ColorRegistry colorRegistry = EclipseCommonPlugin.getColorRegistry();
        Color borderColor = null;
        synchronized (colorRegistry) {
            borderColor = colorRegistry.get(colorName);
            if (borderColor == null) {
                RGB borderRGB = obtainRGBFromString(colorName);
                if (borderRGB == null) {
                    borderColor = colorRegistry.get(DEFAULT_BORDER_COLOR);
                    if (borderColor == null) {
                        borderRGB = obtainRGBFromString(DEFAULT_BORDER_COLOR);
                        if (borderRGB == null) {
                            throw new IllegalStateException(
                                    "Could not obtain an"
                                            + " RGB value for default border color: \""
                                            + DEFAULT_BORDER_COLOR + "\"");
                        }
                        colorRegistry.put(colorName, borderRGB);
                        borderColor = colorRegistry.get(colorName);
                    }
                } else {
                    colorRegistry.put(colorName, borderRGB);
                    borderColor = colorRegistry.get(colorName);
                }
            }
        }
        setBorderColor(borderColor);
    }
View Full Code Here

     * Colours derived from the system e.g. selection colours may change
     * during the lifetime of the application. This method will keep such
     * colour up-to-date.
     */
    private void updateSystemColors() {
        final ColorRegistry colorRegistry = getColorRegistry();
       
        synchronized (colorRegistry) {           
            updateSystemColor(SystemColor.activeCaption,
                    ACTIVE_SELECTION_COLOR, colorRegistry);
           
View Full Code Here

    public static synchronized ColorRegistry getColorRegistry() {
        if (COLOR_REGISTRY == null) {
            // This design ignores the possibility of multiple Display objects
            // within a plug-in.  The singleton is created with the current
            // Display object.
            COLOR_REGISTRY = new ColorRegistry();
        }
        return COLOR_REGISTRY;
    }
View Full Code Here

    /**
     * Create a new StylegGroupTest
     */
    public StyledGroupTest(String title) {
        super(title);
        colorRegistry = new ColorRegistry(Display.getCurrent());
    }
View Full Code Here

                return "Pane (" + getElement().getAttributeValue("name") + ")";
            }

            public ColorRegistry getColorRegistry() {
                if(colorRegistry==null) {
                    colorRegistry = new ColorRegistry();
                }
                return colorRegistry;
            }
        };
        GridData data = new GridData(GridData.FILL_BOTH);
View Full Code Here

TOP

Related Classes of org.eclipse.jface.resource.ColorRegistry

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.