本文整理汇总了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;
}
示例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;
}
示例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));
}
示例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);
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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]);
}
}
});
}
示例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));
}
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
}