当前位置: 首页>>代码示例>>Java>>正文


Java ITheme类代码示例

本文整理汇总了Java中org.eclipse.ui.themes.ITheme的典型用法代码示例。如果您正苦于以下问题:Java ITheme类的具体用法?Java ITheme怎么用?Java ITheme使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ITheme类属于org.eclipse.ui.themes包,在下文中一共展示了ITheme类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showConsole

import org.eclipse.ui.themes.ITheme; //导入依赖的package包/类
public static PluginDependenciesConsole showConsole() {
    IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
    boolean exists = false;
    if (console != null) {
        IConsole[] existing = manager.getConsoles();
        for (int i = 0; i < existing.length; i++) {
            if (console == existing[i]) {
                exists = true;
            }
        }
    } else {
        console = new PluginDependenciesConsole("Plug-in Dependencies", 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;
}
 
开发者ID:iloveeclipse,项目名称:plugindependencies,代码行数:23,代码来源:PluginDependenciesConsole.java

示例2: performDefaults

import org.eclipse.ui.themes.ITheme; //导入依赖的package包/类
protected void performDefaults() {
    super.performDefaults();
    IPreferenceStore store = getPreferenceStore();
    ITheme currentTheme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();

    PreferenceInitializer.performDefaults(store, currentTheme);
    useFastTabSwitch.setSelection(store
            .getDefaultBoolean(ThemeConstants.USE_FAST_TAB_SWITCH));
    closeTabOnMiddleClick.setSelection(store
            .getDefaultBoolean(ThemeConstants.CLOSE_TAB_ON_MIDDLE_CLICK));
    minimizeToCoolbar.setSelection(store
            .getDefaultBoolean(ThemeConstants.ENABLE_NEW_MIN_MAX));
    copyFullTabTitle.setSelection(store
            .getDefaultBoolean(ThemeConstants.COPY_FULL_TAB_TITLE));
    alwaysSortEditorTabs.setSelection(store
            .getDefaultBoolean(ThemeConstants.ALWAYS_SORT_EDITOR_TABS));
    alwaysSortViewTabs.setSelection(store
            .getDefaultBoolean(ThemeConstants.ALWAYS_SORT_VIEW_TABS));
    escClosesDetachedViews.setSelection(store
            .getDefaultBoolean(ThemeConstants.ESC_CLOSES_DETACHED_VIEWS));
    setValuesFromTheme(currentTheme);
    lastUsedTheme = currentTheme;
}
 
开发者ID:iloveeclipse,项目名称:skin4eclipse,代码行数:24,代码来源:SkinsPreferencePage.java

示例3: setValuesFromTheme

import org.eclipse.ui.themes.ITheme; //导入依赖的package包/类
private void setValuesFromTheme(ITheme theme) {
    tabWidthText.setText("" + theme.getInt(ThemeConstants.MAX_TAB_WIDTH));
    moveTabAmount.setText("" + theme.getInt(ThemeConstants.MOVE_TAB_AMOUNT));
    borderSize.setText("" + theme.getInt(ThemeConstants.BORDER_SIZE));
    tabPaddingX.setText("" + theme.getInt(ThemeConstants.TAB_PADDING_X));
    tabPaddingY.setText("" + theme.getInt(ThemeConstants.TAB_PADDING_Y));
    if(UIUtils.isGtk) {
        gtkToolbarFix.setText("" + theme.getInt(ThemeConstants.GTK_TOOLBAR_FIX));
    }
    useMaxTabWidth.setSelection(theme.getBoolean(ThemeConstants.USE_MAX_TAB_WIDTH));
    showFileExt.setSelection(theme.getBoolean(ThemeConstants.SHOW_FILE_EXTENSIONS));
    cropInTheMiddle.setSelection(theme.getBoolean(ThemeConstants.CROP_IN_THE_MIDDLE));
    showViewIcon.setSelection(theme.getBoolean(ThemeConstants.SHOW_VIEW_ICON));
    hideViewTitle.setSelection(theme.getBoolean(ThemeConstants.HIDE_VIEW_TITLE));
    showEditorIcon.setSelection(theme.getBoolean(ThemeConstants.SHOW_EDITOR_ICON));
}
 
开发者ID:iloveeclipse,项目名称:skin4eclipse,代码行数:17,代码来源:SkinsPreferencePage.java

示例4: setFont

import org.eclipse.ui.themes.ITheme; //导入依赖的package包/类
private void setFont(String fontId, FontData[] data)
{
	String fdString = PreferenceConverter.getStoredRepresentation(data);
	// Only set new values if they're different from existing!
	Font existing = JFaceResources.getFont(fontId);
	String existingString = ""; //$NON-NLS-1$
	if (!existing.isDisposed())
	{
		existingString = PreferenceConverter.getStoredRepresentation(existing.getFontData());
	}
	if (!existingString.equals(fdString))
	{
		// put in registry...
		JFaceResources.getFontRegistry().put(fontId, data);
		// Save to prefs...
		ITheme currentTheme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
		String key = ThemeElementHelper.createPreferenceKey(currentTheme, fontId);
		IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore();
		store.setValue(key, fdString);
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:22,代码来源:ThemePreferencePage.java

示例5: setFont

import org.eclipse.ui.themes.ITheme; //导入依赖的package包/类
private void setFont(String fontId, FontData[] data) {
	String fdString = PreferenceConverter.getStoredRepresentation(data);

	Font existing = JFaceResources.getFont(fontId);
	String existingString = "";
	if (!(existing.isDisposed())) {
		existingString = PreferenceConverter
				.getStoredRepresentation(existing.getFontData());
	}
	if (existingString.equals(fdString)) {
		return;
	}
	JFaceResources.getFontRegistry().put(fontId, data);

	ITheme currentTheme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
	String key = ThemeElementHelper.createPreferenceKey(currentTheme,fontId);
	IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore();
	store.setValue(key, fdString);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:20,代码来源:ThemeUIComposite.java

示例6: showConsole

import org.eclipse.ui.themes.ITheme; //导入依赖的package包/类
public static FindBugsConsole showConsole() {
    IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
    boolean exists = false;
    if (console != null) {
        IConsole[] existing = manager.getConsoles();
        for (int i = 0; i < existing.length; i++) {
            if (console == existing[i]) {
                exists = true;
            }
        }
    } else {
        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;
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:23,代码来源:FindBugsConsole.java

示例7: getBackground

import org.eclipse.ui.themes.ITheme; //导入依赖的package包/类
public Color getBackground(Object element) {
	ITheme current = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
	if (((PreviewFile)element).ignored) {
		return current.getColorRegistry().get(SVNDecoratorConfiguration.IGNORED_BACKGROUND_COLOR);
	} else if (((PreviewFile)element).dirty) {
		return current.getColorRegistry().get(SVNDecoratorConfiguration.OUTGOING_CHANGE_BACKGROUND_COLOR);
	}
	return null;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:10,代码来源:SVNDecoratorPreferencesPage.java

示例8: getForeground

import org.eclipse.ui.themes.ITheme; //导入依赖的package包/类
public Color getForeground(Object element) {
	ITheme current = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
	if (((PreviewFile)element).ignored) {
		return current.getColorRegistry().get(SVNDecoratorConfiguration.IGNORED_FOREGROUND_COLOR);
	} else if (((PreviewFile)element).dirty) {
		return current.getColorRegistry().get(SVNDecoratorConfiguration.OUTGOING_CHANGE_FOREGROUND_COLOR);
	}
	return null;			
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:10,代码来源:SVNDecoratorPreferencesPage.java

示例9: getFont

import org.eclipse.ui.themes.ITheme; //导入依赖的package包/类
public Font getFont(Object element) {
	ITheme current = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
	if (((PreviewFile)element).ignored) {
		return current.getFontRegistry().get(SVNDecoratorConfiguration.IGNORED_FONT);
	} else if (((PreviewFile)element).dirty) {
		return current.getFontRegistry().get(SVNDecoratorConfiguration.OUTGOING_CHANGE_FONT);
	}
	return null;			
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:10,代码来源:SVNDecoratorPreferencesPage.java

示例10: ensureFontAndColorsCreated

import org.eclipse.ui.themes.ITheme; //导入依赖的package包/类
/**
 * This method will ensure that the fonts and colors used by the decorator
 * are cached in the registries. This avoids having to syncExec when
 * decorating since we ensure that the fonts and colors are pre-created.
 * 
 * @param fonts fonts ids to cache
 * @param colors color ids to cache
 */
private void ensureFontAndColorsCreated(final String[] fonts, final String[] colors) {
	SVNUIPlugin.getStandardDisplay().syncExec(new Runnable() {
		public void run() {
			ITheme theme  = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
			for (int i = 0; i < colors.length; i++) {
				theme.getColorRegistry().get(colors[i]);
			}
			for (int i = 0; i < fonts.length; i++) {
				theme.getFontRegistry().get(fonts[i]);
			}
		}
	});
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:22,代码来源:SVNLightweightDecorator.java

示例11: computeColorsAndFonts

import org.eclipse.ui.themes.ITheme; //导入依赖的package包/类
private void computeColorsAndFonts(boolean isIgnored, boolean isDirty, IDecoration decoration) {
	if (!SVNUIPlugin.getPlugin().getPreferenceStore().getBoolean(ISVNUIConstants.PREF_USE_FONT_DECORATORS)) return;
	ITheme current = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
	if(isIgnored) {
		decoration.setBackgroundColor(current.getColorRegistry().get(SVNDecoratorConfiguration.IGNORED_BACKGROUND_COLOR));
		decoration.setForegroundColor(current.getColorRegistry().get(SVNDecoratorConfiguration.IGNORED_FOREGROUND_COLOR));
		decoration.setFont(current.getFontRegistry().get(SVNDecoratorConfiguration.IGNORED_FONT));
	} else if(isDirty) {
		decoration.setBackgroundColor(current.getColorRegistry().get(SVNDecoratorConfiguration.OUTGOING_CHANGE_BACKGROUND_COLOR));
		decoration.setForegroundColor(current.getColorRegistry().get(SVNDecoratorConfiguration.OUTGOING_CHANGE_FOREGROUND_COLOR));
		decoration.setFont(current.getFontRegistry().get(SVNDecoratorConfiguration.OUTGOING_CHANGE_FONT));
	}
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:14,代码来源:SVNLightweightDecorator.java

示例12: ThemeWrapper

import org.eclipse.ui.themes.ITheme; //导入依赖的package包/类
/**
 * @param currentTheme
 */
public ThemeWrapper(ITheme currentTheme) {
    super(currentTheme,
            new CascadingColorRegistry(currentTheme.getColorRegistry()),
            new CascadingFontRegistry(currentTheme.getFontRegistry()));
    intMap = new HashMap();
    booleanMap = new HashMap();
}
 
开发者ID:iloveeclipse,项目名称:skin4eclipse,代码行数:11,代码来源:ThemeWrapper.java

示例13: getMergedIntPreference

import org.eclipse.ui.themes.ITheme; //导入依赖的package包/类
/**
 * The default value is the value from current theme,
 * if no custom changes are stored in the preferences
 * @param key
 * @return if the value is set in preferences, then this value,
 * otherwise the value from preferences of current presentation theme
 */
private int getMergedIntPreference(String key, ITheme currentTheme){
    boolean hasPrefs = getPreferenceStore().contains(key);
    int value = 0;
    if(hasPrefs){
        value = getPreferenceStore().getInt(key);
    } else {
        value = currentTheme.getInt(key);
    }
    return value;
}
 
开发者ID:iloveeclipse,项目名称:skin4eclipse,代码行数:18,代码来源:SkinsPreferencePage.java

示例14: getMergedBooleanPreference

import org.eclipse.ui.themes.ITheme; //导入依赖的package包/类
/**
 * The default value is the value from current theme,
 * if no custom changes are stored in the preferences
 * @param key
 * @return if the value is set in preferences, then this value,
 * otherwise the value from preferences of current presentation theme
 */
private boolean getMergedBooleanPreference(String key, ITheme currentTheme){
    boolean hasPrefs = getPreferenceStore().contains(key);
    boolean value = false;
    if(hasPrefs){
        value = getPreferenceStore().getBoolean(key);
    } else {
        value = currentTheme.getBoolean(key);
    }
    return value;
}
 
开发者ID:iloveeclipse,项目名称:skin4eclipse,代码行数:18,代码来源:SkinsPreferencePage.java

示例15: setVisible

import org.eclipse.ui.themes.ITheme; //导入依赖的package包/类
public void setVisible(boolean visible) {
    super.setVisible(visible);
    if(!visible){
        return;
    }
    ITheme currentTheme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
    if(lastUsedTheme != currentTheme){
        setValuesFromTheme(currentTheme);
        lastUsedTheme = currentTheme;
    }
}
 
开发者ID:iloveeclipse,项目名称:skin4eclipse,代码行数:12,代码来源:SkinsPreferencePage.java


注:本文中的org.eclipse.ui.themes.ITheme类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。