use of org.eclipse.ui.IWorkbenchPropertyPage in project dbeaver by serge-rider.
the class EditConnectionWizard method saveSettings.
@Override
protected void saveSettings(DataSourceDescriptor dataSource) {
if (isPageActive(pageSettings)) {
pageSettings.saveSettings(dataSource);
}
pageGeneral.saveSettings(dataSource);
pageInit.saveSettings(dataSource);
pageEvents.saveSettings(dataSource);
for (IDialogPage page : getPages()) {
if (page instanceof WizardPrefPage) {
page = ((WizardPrefPage) page).getPreferencePage();
}
if (page instanceof IWorkbenchPropertyPage) {
((IWorkbenchPropertyPage) page).setElement(dataSource);
}
}
super.savePrefPageSettings();
// Reset password if "Save password" was disabled
if (!dataSource.isSavePassword()) {
dataSource.getConnectionConfiguration().setUserPassword(null);
}
}
use of org.eclipse.ui.IWorkbenchPropertyPage in project dbeaver by serge-rider.
the class ActiveWizard method createPreferencePage.
protected WizardPrefPage createPreferencePage(IPreferencePage prefPage, String title, String description) {
WizardPrefPage wizardPage = new WizardPrefPage(prefPage, title, description);
prefPages.add(wizardPage);
if (prefPage instanceof IWorkbenchPropertyPage) {
((IWorkbenchPropertyPage) prefPage).setElement(getActiveElement());
}
return wizardPage;
}
use of org.eclipse.ui.IWorkbenchPropertyPage in project dbeaver by dbeaver.
the class ActiveWizard method createPreferencePage.
protected WizardPrefPage createPreferencePage(IPreferencePage prefPage, String title, String description) {
WizardPrefPage wizardPage = new WizardPrefPage(prefPage, title, description);
prefPages.add(wizardPage);
if (prefPage instanceof IWorkbenchPropertyPage) {
((IWorkbenchPropertyPage) prefPage).setElement(getActiveElement());
}
return wizardPage;
}
use of org.eclipse.ui.IWorkbenchPropertyPage in project dbeaver by dbeaver.
the class EditConnectionWizard method saveSettings.
@Override
protected void saveSettings(DataSourceDescriptor dataSource) {
if (isPageActive(pageSettings)) {
pageSettings.saveSettings(dataSource);
}
pageGeneral.saveSettings(dataSource);
pageInit.saveSettings(dataSource);
pageEvents.saveSettings(dataSource);
for (IDialogPage page : getPages()) {
if (page instanceof WizardPrefPage) {
page = ((WizardPrefPage) page).getPreferencePage();
}
if (page instanceof IWorkbenchPropertyPage) {
((IWorkbenchPropertyPage) page).setElement(dataSource);
}
}
super.savePrefPageSettings();
// Reset password if "Save password" was disabled
if (!dataSource.isSavePassword()) {
dataSource.getConnectionConfiguration().setUserPassword(null);
}
}
use of org.eclipse.ui.IWorkbenchPropertyPage in project dbeaver by serge-rider.
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