Search in sources :

Example 6 with IWorkbenchPropertyPage

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;
}
Also used : IWorkbenchPropertyPage(org.eclipse.ui.IWorkbenchPropertyPage) ResourceBundle(java.util.ResourceBundle) Bundle(org.osgi.framework.Bundle) ResourceBundle(java.util.ResourceBundle)

Aggregations

IWorkbenchPropertyPage (org.eclipse.ui.IWorkbenchPropertyPage)6 ResourceBundle (java.util.ResourceBundle)2 IDialogPage (org.eclipse.jface.dialogs.IDialogPage)2 WizardPrefPage (org.jkiss.dbeaver.ui.preferences.WizardPrefPage)2 Bundle (org.osgi.framework.Bundle)2