public LocalHistoryLabelProvider() { PlatformUI.getWorkbench().getThemeManager().addPropertyChangeListener(themeListener); }
/** * Get the theme used by this plugin. * * @return our theme. */ public static ITheme getTheme() { return plugin.getWorkbench().getThemeManager().getCurrentTheme(); }
public void start(BundleContext context) throws Exception { super.start(context); if (PlatformUI.isWorkbenchRunning()) { fThemeListener= new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if (IThemeManager.CHANGE_CURRENT_THEME.equals(event.getProperty())) AbstractDecoratedTextEditorPreferenceConstants.initializeDefaultValues(getPreferenceStore()); } }; PlatformUI.getWorkbench().getThemeManager().addPropertyChangeListener(fThemeListener); } }
@Override public void start(BundleContext context) throws Exception { super.start(context); if (PlatformUI.isWorkbenchRunning()) { fThemeListener= new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent event) { if (IThemeManager.CHANGE_CURRENT_THEME.equals(event.getProperty())) EditorsPluginPreferenceInitializer.setThemeBasedPreferences(getPreferenceStore(), true); } }; PlatformUI.getWorkbench().getThemeManager().addPropertyChangeListener(fThemeListener); } }
private void setColorsAndFontsTheme(ColorsAndFontsTheme theme) { org.eclipse.ui.themes.ITheme currentTheme = PlatformUI.getWorkbench().getThemeManager() .getCurrentTheme(); if (theme != null && !currentTheme.getId().equals(theme.getId())) { PlatformUI.getWorkbench().getThemeManager().setCurrentTheme(theme.getId()); } }
public void dispose() { PlatformUI.getWorkbench().getThemeManager() .removePropertyChangeListener(themeListener); super.dispose(); }
/** * @param id * see {@link FontRegistry#getItalic(String)} * @return the font */ public static Font getItalicFont(final String id) { return PlatformUI.getWorkbench().getThemeManager().getCurrentTheme() .getFontRegistry().getItalic(id); }
@Override protected CommonViewer createCommonViewer(Composite aParent) { CommonViewer viewer = super.createCommonViewer(aParent); IThemeManager themeManager = getSite().getWorkbenchWindow().getWorkbench().getThemeManager(); new GradientDrawer(themeManager, viewer) { @Override protected boolean shouldApplyGradient(org.eclipse.swt.widgets.Event event) { return event.item.getData() instanceof RepositoryCategory; } }; return viewer; }
private void refreshDiffFonts() { FontRegistry reg = PlatformUI.getWorkbench().getThemeManager() .getCurrentTheme().getFontRegistry(); this.headlineFont = reg.get(THEME_DiffHeadlineFont); }
/** * @param id * see {@link FontRegistry#get(String)} * @return the font */ public static Font getFont(final String id) { return PlatformUI.getWorkbench().getThemeManager().getCurrentTheme() .getFontRegistry().get(id); }
/** * @param id * see {@link FontRegistry#getBold(String)} * @return the font */ public static Font getBoldFont(final String id) { return PlatformUI.getWorkbench().getThemeManager().getCurrentTheme() .getFontRegistry().getBold(id); }
public void widgetDisposed(DisposeEvent e) { EditorsUI.getPreferenceStore().removePropertyChangeListener( editorPrefListener); PlatformUI.getWorkbench().getThemeManager() .removePropertyChangeListener(themeListener); colors.dispose(); } });
private ColorsAndFontsTheme getCurrentColorsAndFontsTheme() { org.eclipse.ui.themes.ITheme theme = PlatformUI.getWorkbench().getThemeManager() .getCurrentTheme(); return new ColorsAndFontsTheme(theme.getId(), theme.getLabel()); }
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]); } } });
@Override public Color getForeground(Object element) { if (element instanceof AbstractHistoryCategory){ // TODO: We should have a Team theme for this ITheme current = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme(); return current.getColorRegistry().get("org.eclipse.team.cvs.ui.fontsandcolors.cvshistorypagecategories"); //$NON-NLS-1$ } if (isDeletedEdition(element)) { return Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW); } return null; }
public Color getForeground(Object element) { if (element instanceof AbstractHistoryCategory){ // TODO: We should have a Team theme for this ITheme current = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme(); return current.getColorRegistry().get("org.eclipse.team.cvs.ui.fontsandcolors.cvshistorypagecategories"); //$NON-NLS-1$ } if (isDeletedEdition(element)) { return Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW); } return null; }
private Font getFont(boolean hidden, boolean active) { ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme(); if (active) { return theme.getFontRegistry().getItalic(IWorkbenchThemeConstants.TAB_TEXT_FONT); } if (hidden) { return theme.getFontRegistry().getBold(IWorkbenchThemeConstants.TAB_TEXT_FONT); } return theme.getFontRegistry().get(IWorkbenchThemeConstants.TAB_TEXT_FONT); }
@Override public void dispose() { super.dispose(); PlatformUI.getWorkbench().getThemeManager().getCurrentTheme() .removePropertyChangeListener(this); TeamUI.removePropertyChangeListener(this); Activator.removePropertyChangeListener(this); org.eclipse.egit.core.Activator.getDefault().getIndexDiffCache().removeIndexDiffChangedListener(this); }
/** * Constructs a new Git resource decorator */ public GitLightweightDecorator() { TeamUI.addPropertyChangeListener(this); Activator.addPropertyChangeListener(this); PlatformUI.getWorkbench().getThemeManager().getCurrentTheme() .addPropertyChangeListener(this); org.eclipse.egit.core.Activator.getDefault().getIndexDiffCache().addIndexDiffChangedListener(this); // This is an optimization to ensure that while decorating our fonts and colors are // pre-created and decoration can occur without having to syncExec. ensureFontAndColorsCreated(fonts, colors); }
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); }