Package org.eclipse.ui.themes

Examples of org.eclipse.ui.themes.ITheme


  public FontRegistry getDefaultThemeFontRegistry() {
    return defaultThemeFontRegistry;
  }

  private ITheme getTheme(IThemeDescriptor td) {
    ITheme theme = (ITheme) themes.get(td);
    if (theme == null) {
      theme = new Theme(td);
      themes.put(td, theme);
    }
    return theme;
View Full Code Here


   * (non-Javadoc)
   *
   * @see org.eclipse.ui.themes.IThemeManager#setCurrentTheme(java.lang.String)
   */
  public void setCurrentTheme(String id) {
    ITheme oldTheme = currentTheme;
    if (WorkbenchThemeManager.getInstance().doSetCurrentTheme(id)) {
      firePropertyChange(CHANGE_CURRENT_THEME, oldTheme,
          getCurrentTheme());
      if (oldTheme != null) {
        oldTheme.removePropertyChangeListener(currentThemeListener);
      }
      currentTheme.addPropertyChangeListener(currentThemeListener);

      // update the preference if required.
      if (!PrefUtil.getAPIPreferenceStore().getString(
View Full Code Here

                    IThemePreview preview = getThemePreview(category);
                    if (preview != null) {
                        previewControl = new Composite(previewComposite,
                                SWT.NONE);
                        previewControl.setLayout(new FillLayout());
                        ITheme theme = getCascadingTheme();
                        preview.createControl(previewControl, theme);
                        previewSet.add(preview);
                    }
                } catch (CoreException e) {
                    previewControl = new Composite(previewComposite, SWT.NONE);
View Full Code Here

        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();
View Full Code Here

        themeRegistry = ((ThemeRegistry) WorkbenchPlugin.getDefault()
                .getThemeRegistry());
        this.descriptor = descriptor;
        IWorkbench workbench = PlatformUI.getWorkbench();
        if (descriptor != null) {
          ITheme defaultTheme = workbench.getThemeManager().getTheme(
                    IThemeManager.DEFAULT_THEME);
         
            ColorDefinition[] colorDefinitions = this.descriptor.getColors();
            themeColorRegistry = new CascadingColorRegistry(defaultTheme
                    .getColorRegistry());
            if (colorDefinitions.length > 0) {
                ThemeElementHelper.populateRegistry(this, colorDefinitions,
                    PrefUtil.getInternalPreferenceStore());
            }

            FontDefinition[] fontDefinitions = this.descriptor.getFonts();
            themeFontRegistry = new CascadingFontRegistry(defaultTheme
                    .getFontRegistry());
            if (fontDefinitions.length > 0) {
                ThemeElementHelper.populateRegistry(this, fontDefinitions,
                    PrefUtil.getInternalPreferenceStore());
            }
View Full Code Here

   */
  private void ensureFontAndColorsCreated(final String[] actFonts, final String[] actColors) {
    final Display display = Display.getDefault();
    display.syncExec(new Runnable() {
      public void run() {
        ITheme theme  = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
        for (int i = 0; i < actColors.length; i++) {
          theme.getColorRegistry().get(actColors[i]);

        }
        for (int i = 0; i < actFonts.length; i++) {
          theme.getFontRegistry().get(actFonts[i]);
        }
        defaultBackgroundRgb = display.getSystemColor(
            SWT.COLOR_LIST_BACKGROUND).getRGB();
      }
    });
View Full Code Here

      decorateIcons(decoration, resource);
    }

    private void decorateFontAndColour(IDecoration decoration,
        IDecoratableResource resource) {
      ITheme current = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
      if (resource.isIgnored()) {
        Color bc = current.getColorRegistry().get(
            UIPreferences.THEME_IgnoredResourceBackgroundColor);
        Color fc = current.getColorRegistry().get(
            UIPreferences.THEME_IgnoredResourceForegroundColor);
        Font f = current.getFontRegistry().get(
            UIPreferences.THEME_IgnoredResourceFont);

        setBackgroundColor(decoration, bc);
        decoration.setForegroundColor(fc);
        decoration.setFont(f);
      } else if (!resource.isTracked()
          || resource.isDirty()
          || resource.staged() != Staged.NOT_STAGED) {
        Color bc = current.getColorRegistry().get(UIPreferences.THEME_UncommittedChangeBackgroundColor);
        Color fc = current.getColorRegistry().get(UIPreferences.THEME_UncommittedChangeForegroundColor);
        Font f = current.getFontRegistry().get(UIPreferences.THEME_UncommittedChangeFont);

        setBackgroundColor(decoration, bc);
        decoration.setForegroundColor(fc);
        decoration.setFont(f);
      }
View Full Code Here

    /* Check Cached version first */
    if (fgCachedOSTheme != null)
      return fgCachedOSTheme;

    ITheme currentTheme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
    if (HIGH_CONTRAST_THEME.equals(currentTheme.getId())) {
      fgCachedOSTheme = OSTheme.HIGH_CONTRAST;
      return fgCachedOSTheme;
    }

    RGB widgetBackground = display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND).getRGB();
View Full Code Here

   */
  @SuppressWarnings("restriction")
  public static void zoomNewsText(boolean zoomIn, boolean reset) {

    /* Retrieve Font */
    ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
    FontRegistry registry = theme.getFontRegistry();
    FontData[] oldFontDatas = registry.getFontData(NEWS_TEXT_FONT_ID);
    FontData[] newFontDatas = new FontData[oldFontDatas.length];

    /* Set Height */
    for (int i = 0; i < oldFontDatas.length; i++) {
View Full Code Here

     * The constructor.
     */
    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;
View Full Code Here

TOP

Related Classes of org.eclipse.ui.themes.ITheme

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.