Package org.eclipse.ui.themes

Examples of org.eclipse.ui.themes.ITheme


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

     */
    public void updateGradient(IEditorPart editor) {
        boolean activeEditor = editor == getSite().getPage().getActiveEditor();
        boolean activePart = editor == getSite().getPage().getActivePart();

        ITheme theme = editor.getEditorSite().getWorkbenchWindow()
                .getWorkbench().getThemeManager().getCurrentTheme();
        Gradient g = new Gradient();

        ColorRegistry colorRegistry = theme.getColorRegistry();
        if (activePart) {
            g.fgColor = colorRegistry
                    .get(IWorkbenchThemeConstants.ACTIVE_TAB_TEXT_COLOR);
            g.bgColors = new Color[2];
            g.bgColors[0] = colorRegistry
                    .get(IWorkbenchThemeConstants.ACTIVE_TAB_BG_START);
            g.bgColors[1] = colorRegistry
                    .get(IWorkbenchThemeConstants.ACTIVE_TAB_BG_END);
        } else {
            if (activeEditor) {
                g.fgColor = colorRegistry
                        .get(IWorkbenchThemeConstants.ACTIVE_TAB_TEXT_COLOR);
                g.bgColors = new Color[2];
                g.bgColors[0] = colorRegistry
                        .get(IWorkbenchThemeConstants.ACTIVE_TAB_BG_START);
                g.bgColors[1] = colorRegistry
                        .get(IWorkbenchThemeConstants.ACTIVE_TAB_BG_END);
            } else {
                g.fgColor = colorRegistry
                        .get(IWorkbenchThemeConstants.INACTIVE_TAB_TEXT_COLOR);
                g.bgColors = new Color[2];
                g.bgColors[0] = colorRegistry
                        .get(IWorkbenchThemeConstants.INACTIVE_TAB_BG_START);
                g.bgColors[1] = colorRegistry
                        .get(IWorkbenchThemeConstants.INACTIVE_TAB_BG_END);
            }
        }
        g.bgPercents = new int[] { theme
                .getInt(IWorkbenchThemeConstants.ACTIVE_TAB_PERCENT) };

        drawGradient(editor, g);
    }
View Full Code Here

    @Override
    protected void dispose() {
        if (!disposed) {
            disposed = true;
            ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
            theme.removePropertyChangeListener(this);
            super.dispose();
        }
    }
View Full Code Here

                public void run() {
                    setConsoleFont();
                }
            });
        } else {
            ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
            Font font = theme.getFontRegistry().get(CONSOLE_FONT);
            console.setFont(font);
        }
    }
View Full Code Here

            console = new FindBugsConsole("FindBugs", null, true);
        }
        if (!exists) {
            manager.addConsoles(new IConsole[] { console });
        }
        ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
        theme.addPropertyChangeListener(console);
        console.setConsoleFont();
        manager.showConsoleView(console);
        return console;
    }
View Full Code Here

    text3.setEditable(false);

    int index = addPage(composite);
    setPageText(index, "Overview");
    IThemeManager themeManager = PlatformUI.getWorkbench().getThemeManager();
    ITheme currentTheme = themeManager.getCurrentTheme();

    FontRegistry fontRegistry = currentTheme.getFontRegistry();
    text3.setFont( fontRegistry.get(JFaceResources.TEXT_FONT));
    text3.addFocusListener(new FocusListener()
    {

      public void focusLost(FocusEvent e)
View Full Code Here

  /**
   * @param themeToSelect the id of the theme to be selected
   */
  private void refreshThemeCombo(String themeToSelect) {
    themeCombo.removeAll();
    ITheme currentTheme = PlatformUI.getWorkbench().getThemeManager()
        .getCurrentTheme();

    IThemeDescriptor[] descs = WorkbenchPlugin.getDefault()
        .getThemeRegistry().getThemes();
    String defaultThemeString = PlatformUI.getWorkbench().getThemeManager()
        .getTheme(IThemeManager.DEFAULT_THEME).getLabel();
    if (currentTheme.getId().equals(IThemeManager.DEFAULT_THEME)) {
      defaultThemeString = NLS.bind(
          WorkbenchMessages.ViewsPreference_currentThemeFormat,
          new Object[] { defaultThemeString });
    }
    themeCombo.add(defaultThemeString);
   
    String themeString;
    int selection = 0;
    for (int i = 0; i < descs.length; i++) {
      themeString = descs[i].getName();
      if (descs[i].getId().equals(currentTheme.getId())) {
        themeString = NLS.bind(
            WorkbenchMessages.ViewsPreference_currentThemeFormat,
            new Object[] { themeString });
      }
      if (themeToSelect.equals(descs[i].getId())) {
View Full Code Here

  /**
   * Disposes all ThemeEntries.
   */
  public void dispose() {
    for (Iterator i = themes.values().iterator(); i.hasNext();) {
      ITheme theme = (ITheme) i.next();
      theme.removePropertyChangeListener(currentThemeListener);
      theme.dispose();
    }
    themes.clear();
  }
View Full Code Here

    }
    themes.clear();
  }

  private boolean doSetCurrentTheme(String id) {
    ITheme oldTheme = currentTheme;
    ITheme newTheme = getTheme(id);
    if (oldTheme != newTheme && newTheme != null) {
      currentTheme = newTheme;
      return true;
    }
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.