在eclipse產品啟動時,我只想獲取Theme的eclipse UI偏好值。
我嘗試使用以下代碼段,但它回傳一個空字串值
Platform.getPreferencesService().getString("org.eclipse.ui.preferencePages.Views", "Theme", "",
null);

如果我得到這個答案,那就太好了。提前致謝
uj5u.com熱心網友回復:
你可以從IThemeEngine:
IThemeEngine engine = PlatformUI.getWorkbench().getService(IThemeEngine.class);
if (engine != null) {
ITheme activeTheme = engine.getActiveTheme();
if (activeTheme != null) {
// The theme id
String themeId = activeTheme.getId();
// The display label
String label = activeTheme.getLabel();
...
}
}
IThemeEngine也可以注入 e4 部分或從IEclipseContext
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/515852.html
標籤:爪哇蚀日食插件喜好
