Package org.eclipse.jface.resource

Examples of org.eclipse.jface.resource.ColorRegistry


   */
  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


   * @param manager
   * @param defaultColor
   * @return Font
   */
  public static Color getThemeColor(String key, ResourceManager manager, RGB defaultColor) {
    ColorRegistry colorRegistry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
    if (colorRegistry != null)
      return getColor(manager, colorRegistry.getColorDescriptor(key));

    return getColor(manager, defaultColor);
  }
View Full Code Here

   * @param key
   * @param defaultRGB
   * @return Font
   */
  public static RGB getThemeRGB(String key, RGB defaultRGB) {
    ColorRegistry colorRegistry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
    if (colorRegistry != null)
      return colorRegistry.getRGB(key);

    return defaultRGB;
  }
View Full Code Here

     */
    public SerialMonitor() {
  mySerialConnections = new LinkedHashMap<Serial, SerialListener>(myMaxSerialPorts);
  IThemeManager themeManager = PlatformUI.getWorkbench().getThemeManager();
  ITheme currentTheme = themeManager.getCurrentTheme();
  ColorRegistry colorRegistry = currentTheme.getColorRegistry();
  mySerialColor = new Color[myMaxSerialPorts];
  for (int i = 0; i < myMaxSerialPorts; i++) {
      String colorID = "it.baeyens.serial.color." + (1 + i);
      Color color = colorRegistry.get(colorID);
      mySerialColor[i] = color;
  }
  Common.registerSerialUser(this);

  Job job = new Job("pluginSerialmonitorInitiator") {
View Full Code Here

      }
  };

  IThemeManager themeManager = PlatformUI.getWorkbench().getThemeManager();
  ITheme currentTheme = themeManager.getCurrentTheme();
  ColorRegistry colorRegistry = currentTheme.getColorRegistry();

  myScope = new Oscilloscope(6, dsp, parent, SWT.NONE, colorRegistry.get("it.baeyens.scope.color.background"),
    colorRegistry.get("it.baeyens.scope.color.foreground"), colorRegistry.get("it.baeyens.scope.color.grid"));
  GridData theGriddata = new GridData(SWT.FILL, SWT.FILL, true, true);
  theGriddata.horizontalSpan = 7;

  myScope.setLayoutData(theGriddata);
  for (int i = 0; i < myScope.getChannels(); i++) {
      String colorID = "it.baeyens.scope.color." + (1 + i);
      Color color = colorRegistry.get(colorID);
      myScope.setForeground(i, color);
  }
  myScope.getDispatcher(0).dispatch();

  Listener listener = new Listener() {
View Full Code Here

        {
            this.fontRegistry = new FontRegistry( this.getWorkbench().getDisplay() );
        }
        if ( this.colorRegistry == null )
        {
            this.colorRegistry = new ColorRegistry( this.getWorkbench().getDisplay() );
        }
        if ( this.filterTemplateContextTypeRegistry == null )
        {
            this.filterTemplateContextTypeRegistry = new ContributionContextTypeRegistry();
            this.filterTemplateContextTypeRegistry.addContextType( BrowserUIConstants.FILTER_TEMPLATE_ID );
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

      fBackgroundColorName = backgroundColorName;
    }

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

      text.setForeground(getColorRegistry().get(COLOR_TEXT_INPUT));
    }
  }

  public static Color getColor(int severity) {
    ColorRegistry colors = getColorRegistry();
    if (colors != null) {
      if (severity >= Level.SEVERE.intValue()) {
        return colors.get(COLOR_TEXT_ERROR);
      }
      else if (severity >= Level.WARNING.intValue()) {
        return colors.get(COLOR_TEXT_WARNING);
      }
      else if (severity >= Level.INFO.intValue()) {
        return colors.get(COLOR_TEXT_INFO);
      }
      return colors.get(COLOR_TEXT_INPUT);
    }
    else {
      // legacy fallback
      if (severity >= Level.SEVERE.intValue()) {
        return Display.getDefault().getSystemColor(SWT.COLOR_RED);
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.