use of org.eclipse.ui.IWorkbenchPropertyPage in project dbeaver by dbeaver.
the class WizardPrefPage method addSubPage.
public WizardPrefPage addSubPage(String pageId, Class<?> ownerBundleClass, IPreferencePage page) {
String pageName = pageId, pageDescription = pageId;
try {
Bundle pageBundle = FrameworkUtil.getBundle(ownerBundleClass);
ResourceBundle resourceBundle = Activator.getDefault().getLocalization(pageBundle, Locale.getDefault().getLanguage());
try {
pageName = resourceBundle.getString("page." + pageId + ".name");
} catch (Exception e) {
pageName = pageId;
}
try {
pageDescription = resourceBundle.getString("page." + pageId + ".description");
} catch (Exception e) {
pageDescription = pageName;
}
} catch (Exception e) {
// Ignore
}
WizardPrefPage wizardPrefPage = new WizardPrefPage(page, pageName, pageDescription);
subPages.add(wizardPrefPage);
// Sety the same element to sub page
if (preferencePage instanceof IWorkbenchPropertyPage && page instanceof IWorkbenchPropertyPage) {
((IWorkbenchPropertyPage) page).setElement(((IWorkbenchPropertyPage) preferencePage).getElement());
}
return wizardPrefPage;
}
Aggregations