Package org.eclipse.jface.resource

Examples of org.eclipse.jface.resource.ColorRegistry


        styledText.setEditable(true);
        setFont(console.getFont());
        styledText.addMouseTrackListener(this);
        styledText.addListener(SWT.MouseUp, mouseUpListener);

        ColorRegistry colorRegistry = JFaceResources.getColorRegistry();
        propertyChangeListener = new HyperlinkColorChangeListener();
        colorRegistry.addListener(propertyChangeListener);

        revealJob.setSystem(true);
        document.addDocumentListener(documentListener);
        document.addPositionUpdater(positionUpdater);
    }
View Full Code Here


        }
        textCursor = null;
        hyperlink = null;
        console = null;

        ColorRegistry colorRegistry = JFaceResources.getColorRegistry();
        colorRegistry.removeListener(propertyChangeListener);
       
        super.handleDispose();
    }
View Full Code Here

    {
        super.start( context );

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

        if ( ldifTemplateContextTypeRegistry == null )
        {
            ldifTemplateContextTypeRegistry = new ContributionContextTypeRegistry();
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 synchronizedNatureAdapter;
    }
   
    private synchronized void createColorCache() {
      if (colorCache == null) {
        colorCache = new ColorRegistry(getWorkbench().getDisplay());
        colorCache.put("ccw.repl.expressionBackground", new RGB(0xf0, 0xf0, 0xf0));
      }
    }
View Full Code Here

   * @param rgb
   * @return The <code>Color</code> instance cached for this rgb value, creating
   *         it along the way if required.
   */
  public static Color getColor(RGB rgb) {
    ColorRegistry r = getDefault().getColorCache();
    String rgbString = StringConverter.asString(rgb);
    if (!r.hasValueFor(rgbString)) {
      r.put(rgbString, rgb);
    }
    return r.get(rgbString);
  }
View Full Code Here

  public static Color getPreferenceColor(IPreferenceStore store, String preferenceKey, RGB defaultColor) {
    return getColor(getPreferenceRGB(store, preferenceKey, defaultColor));
  }
 
    public static void registerEditorColors(IPreferenceStore store, RGB foregroundColor) {
        final ColorRegistry colorCache = getDefault().getColorCache();
       
        for (Keyword token: PreferenceConstants.colorizableTokens) {
          PreferenceConstants.ColorizableToken tokenStyle = PreferenceConstants.getColorizableToken(store, token, foregroundColor);
          colorCache.put(tokenStyle.rgb.toString(), tokenStyle.rgb);
        }
       
    }
View Full Code Here

        .getCurrentTheme().getFontRegistry();
    this.headlineFont = reg.get(THEME_DiffHeadlineFont);
  }

  private void refreshDiffColors() {
    ColorRegistry reg = PlatformUI.getWorkbench().getThemeManager()
        .getCurrentTheme().getColorRegistry();
    this.addBackgroundColor = reg.get(THEME_DiffAddBackgroundColor);
    this.addForegroundColor = reg.get(THEME_DiffAddForegroundColor);
    this.removeBackgroundColor = reg.get(THEME_DiffRemoveBackgroundColor);
    this.removeForegroundColor = reg.get(THEME_DiffRemoveForegroundColor);
    this.hunkBackgroundColor = reg.get(THEME_DiffHunkBackgroundColor);
    this.hunkForegroundColor = reg.get(THEME_DiffHunkForegroundColor);
    this.headlineBackgroundColor = reg.get(THEME_DiffHeadlineBackgroundColor);
    this.headlineForegroundColor = reg.get(THEME_DiffHeadlineForegroundColor);
  }
View Full Code Here

    if (fLeft != null)
      fLeft.setBackgroundColor(color);
    if (fRight != null)
      fRight.setBackgroundColor(color);

    ColorRegistry registry = JFaceResources.getColorRegistry();

    RGB bg = getBackground(display);
    SELECTED_INCOMING = registry.getRGB(INCOMING_COLOR);
    if (SELECTED_INCOMING == null)
      SELECTED_INCOMING = new RGB(0, 0, 255); // BLUE
    INCOMING = interpolate(SELECTED_INCOMING, bg, 0.6);
    INCOMING_FILL = interpolate(SELECTED_INCOMING, bg, 0.97);
    INCOMING_TEXT_FILL = interpolate(SELECTED_INCOMING, bg, 0.85);

    SELECTED_OUTGOING = registry.getRGB(OUTGOING_COLOR);
    if (SELECTED_OUTGOING == null)
      SELECTED_OUTGOING = new RGB(0, 0, 0); // BLACK
    OUTGOING = interpolate(SELECTED_OUTGOING, bg, 0.6);
    OUTGOING_FILL = interpolate(SELECTED_OUTGOING, bg, 0.97);
    OUTGOING_TEXT_FILL = interpolate(SELECTED_OUTGOING, bg, 0.85);

    SELECTED_CONFLICT = registry.getRGB(CONFLICTING_COLOR);
    if (SELECTED_CONFLICT == null)
      SELECTED_CONFLICT = new RGB(255, 0, 0); // RED
    CONFLICT = interpolate(SELECTED_CONFLICT, bg, 0.6);
    CONFLICT_FILL = interpolate(SELECTED_CONFLICT, bg, 0.97);
    CONFLICT_TEXT_FILL = interpolate(SELECTED_CONFLICT, bg, 0.85);

    RESOLVED = registry.getRGB(RESOLVED_COLOR);
    if (RESOLVED == null)
      RESOLVED = new RGB(0, 255, 0); // GREEN

    updatePresentation(display);
  }
View Full Code Here

   */
  private static RGB findRGB(String key, RGB defaultRGB) {
    if (!PlatformUI.isWorkbenchRunning())
      return defaultRGB;

    ColorRegistry registry = PlatformUI.getWorkbench().getThemeManager()
        .getCurrentTheme().getColorRegistry();
    RGB rgb = registry.getRGB(key);
    if (rgb != null)
      return rgb;
    return defaultRGB;
  }
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.