本文整理汇总了Java中org.eclipse.e4.ui.css.swt.theme.ITheme类的典型用法代码示例。如果您正苦于以下问题:Java ITheme类的具体用法?Java ITheme怎么用?Java ITheme使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ITheme类属于org.eclipse.e4.ui.css.swt.theme包,在下文中一共展示了ITheme类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onExecute
import org.eclipse.e4.ui.css.swt.theme.ITheme; //导入依赖的package包/类
@Execute
public void onExecute() {
eventBroker.subscribe(IThemeEngine.Events.THEME_CHANGED,
new EventHandler() {
public void handleEvent(Event event) {
ITheme currentTheme = (ITheme) event
.getProperty(IThemeEngine.Events.THEME);
// if (!prefDarker.getBoolean(
// THEME_DARKER_PREF_THEMEENABLED, false))
if (currentTheme.getId().equals(THEME_DARKER_ID)) {
setupPreferences();
isLastThemeDarker = true;
DarkerWeavingHook.enableWeaving();
hookDarkerCore();
} else if (isLastThemeDarker) {
DarkerWeavingHook.disableWeaving();
setToDefaultPreferences();
}
}
});
}
示例2: ThemeHelper
import org.eclipse.e4.ui.css.swt.theme.ITheme; //导入依赖的package包/类
ThemeHelper(final IThemeEngine inThemeEngine) {
themes = inThemeEngine.getThemes();
final String lActiveId = getActiveId(inThemeEngine.getActiveTheme(),
themes);
themeItems = new String[themes.size()];
int i = 0;
for (final ITheme lTheme : themes) {
if (lActiveId.equals(lTheme.getId())) {
activeIndex = i;
}
themeItems[i++] = lTheme.getLabel();
}
}
示例3: getActiveId
import org.eclipse.e4.ui.css.swt.theme.ITheme; //导入依赖的package包/类
private String getActiveId(ITheme active, List<ITheme> themes) {
if (active != null) {
return active.getId();
}
for (final ITheme theme : themes) {
if (DFT_THEME.equals(theme.getLabel())) {
return theme.getId();
}
}
return themes.get(0).getId();
}
示例4: getTheme
import org.eclipse.e4.ui.css.swt.theme.ITheme; //导入依赖的package包/类
protected ITheme getTheme(final int inIndex) {
return themes.get(inIndex);
}
示例5: getActiveThemeForCurrentDisplay
import org.eclipse.e4.ui.css.swt.theme.ITheme; //导入依赖的package包/类
public ITheme getActiveThemeForCurrentDisplay() {
IThemeEngine engine = themeManager.getEngineForDisplay(Display.getCurrent());
return engine.getActiveTheme();
}
示例6: getIdOfActiveThemeForCurrentDisplay
import org.eclipse.e4.ui.css.swt.theme.ITheme; //导入依赖的package包/类
public String getIdOfActiveThemeForCurrentDisplay() {
ITheme activeTheme = getActiveThemeForCurrentDisplay();
return activeTheme == null ? "" : activeTheme.getId();
}