Examples of ITheme


Examples of org.eclipse.ui.themes.ITheme

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

Examples of org.eclipse.ui.themes.ITheme

                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

Examples of org.eclipse.ui.themes.ITheme

            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

Examples of org.eclipse.ui.themes.ITheme

    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

Examples of org.eclipse.ui.themes.ITheme

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

Examples of org.eclipse.ui.themes.ITheme

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

Examples of org.eclipse.ui.themes.ITheme

    }
    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

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

Examples of org.eclipse.ui.themes.ITheme

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

Examples of org.eclipse.ui.themes.ITheme

                    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
TOP
Copyright © 2018 www.massapi.com. 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.