Package org.eclipse.jface.resource

Examples of org.eclipse.jface.resource.ColorRegistry


    private List<String> images = new ArrayList<String>();
    private Map<String, Font> fonts = new HashMap<String, Font>();

    public GDRegistry() {
        colorRegistry = new ColorRegistry();
        fontRegistry = new FontRegistry();
        imageRegistry = new ImageRegistry();
        init();
        load();
    }
View Full Code Here


    PreferenceConstants.initializeDefaultPreferences(store);
  }

  public static void setThemeBasedPreferences(IPreferenceStore store) {
    ColorRegistry registry= null;
    if (PlatformUI.isWorkbenchRunning())
        registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();

    setDefaultColor(store, registry, PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR, new RGB(192,192,192));
  }
View Full Code Here

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

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

        if ( exceptionHandler == null )
        {
            exceptionHandler = new ExceptionHandler();
View Full Code Here

     *            having its default preference set
     */
    private static void installColor(ColorDefinition definition, ITheme theme,
            IPreferenceStore store, boolean setInRegistry) {

        ColorRegistry registry = theme.getColorRegistry();

        String id = definition.getId();
        String key = createPreferenceKey(theme, id);
        RGB prefColor = store != null ? PreferenceConverter
                .getColor(store, key) : null;
        RGB defaultColor = null;
        if (definition.getValue() != null) {
      defaultColor = definition.getValue();
    } else {
      defaultColor = registry.getRGB(definition.getDefaultsTo());
    }

        if (setInRegistry) {
            if (prefColor == null
                    || prefColor == PreferenceConverter.COLOR_DEFAULT_DEFAULT) {
                prefColor = defaultColor;
            }

            if (prefColor != null) {
                registry.put(id, prefColor);
            }
        }

        if (defaultColor != null && store != null) {
            PreferenceConverter.setDefault(store, key, defaultColor);
View Full Code Here

  /*
   * Call dispose when we close
   */
  private WorkbenchThemeManager() {
    defaultThemeColorRegistry = new ColorRegistry(PlatformUI.getWorkbench()
        .getDisplay());

    defaultThemeFontRegistry = new FontRegistry(PlatformUI.getWorkbench()
        .getDisplay());

View Full Code Here

        PrefUtil.saveAPIPrefs();
      }

      // update the jface registries
      {
        ColorRegistry jfaceColors = JFaceResources.getColorRegistry();
        ColorRegistry themeColors = currentTheme.getColorRegistry();
        for (Iterator i = themeColors.getKeySet().iterator(); i
            .hasNext();) {
          String key = (String) i.next();
          jfaceColors.put(key, themeColors.getRGB(key));
        }
      }
      {
        FontRegistry jfaceFonts = JFaceResources.getFontRegistry();
        FontRegistry themeFonts = currentTheme.getFontRegistry();
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

   * Return color registry.
   * @return the color registry.
   */
  public ColorRegistry getColorRegistry() {
    if (colorRegistry == null) {
      colorRegistry = new ColorRegistry();
      initialize();
    }
    return colorRegistry;
  }
View Full Code Here

    RGB light = display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND).getRGB();
    RGB dark = ColorUtils.getShadeRGB(light, -0.09019605f);
    RGB shadow = ColorUtils.getShadeRGB(light, -0.20f);
    RGB scrollBtn = ColorUtils.getShadeRGB(light, -0.1921568f);

    ColorRegistry registry = getColorRegistry();
    registry.put(IDetailsColors.COLOR_LIGHT_BACKGROUND, light);
    registry.put(IDetailsColors.COLOR_DARK_BACKGROUND, dark);
    registry.put(IDetailsColors.COLOR_DARK_SHADOW, shadow);
    registry.put(IDetailsColors.COLOR_TOOL_SELECTED_1, light);
    registry.put(IDetailsColors.COLOR_TOOL_SELECTED_2, dark);
    registry.put(IDetailsColors.COLOR_SCROLL_BUTTON, scrollBtn);
    registry.put(IDetailsColors.COLOR_TOOL_SELECTED_BORDER, display.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB());
    RGB canvas = display.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB();
    registry.put(IDetailsColors.COLOR_CANVAS, canvas);
    registry.put(IDetailsColors.COLOR_TEXT, display.getSystemColor(SWT.COLOR_LIST_FOREGROUND).getRGB());
   
    // tray
    registry.put(IDetailsColors.COLOR_TRAY_BACKGROUND, ColorUtils.getLightShade(light, 2, 3));
   
    // selection handler
    Color selectionColor = Display.getCurrent().getSystemColor(SWT.COLOR_LIST_SELECTION);
    colorRegistry.put(ICommonUIConstants.COLOR_SELECTION_HANDLE_CORNER, ColorUtils.getLightShade(selectionColor.getRGB(), 2, 3));
  }
View Full Code Here

    }
  }

  private void createTabFolder(Composite parent) {
    if (fTabFolder == null) {
      ColorRegistry reg = JFaceResources.getColorRegistry();
      Color c1 = reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_BG_START"), //$NON-NLS-1$
          c2 = reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_BG_END"); //$NON-NLS-1$
      fTabFolder = new CTabFolder(parent, SWT.NO_REDRAW_RESIZE | SWT.NO_TRIM | SWT.FLAT);
      GridData gd = new GridData(GridData.FILL_BOTH);
      gd.horizontalSpan = 2;
      fTabFolder.setSelectionBackground(new Color[] {c1, c2}new int[] {100}, true);
      fTabFolder.setSelectionForeground(reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_TEXT_COLOR")); //$NON-NLS-1$
      fTabFolder.setSimple(PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS));
      fTabFolder.setLayoutData(gd);
          fTabFolder.setBorderVisible(true);
      fTabFolder.setFont(parent.getFont());
      fTabFolder.addSelectionListener(new SelectionAdapter() {
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.