提交 137e8c72 编写于 作者: S Serge Rider

#13466 Connection pref pages settings save fix

上级 e8782016
......@@ -299,13 +299,12 @@ public class EditConnectionWizard extends ConnectionWizard
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);
}
setPageDataSourceElement(dataSource, page);
}
for (WizardPrefPage wpp : getPrefPages()) {
setPageDataSourceElement(dataSource, wpp);
}
super.savePrefPageSettings();
// Reset password if "Save password" was disabled
......@@ -314,6 +313,29 @@ public class EditConnectionWizard extends ConnectionWizard
}
}
private void setPageDataSourceElement(DataSourceDescriptor dataSource, IDialogPage page) {
if (page instanceof WizardPrefPage) {
WizardPrefPage[] subPages = ((WizardPrefPage)page).getDialogPages(false, true);
if (subPages != null) {
for (IDialogPage dp : subPages) {
setPageDataSourceElement(dataSource, dp);
}
}
page = ((WizardPrefPage) page).getPreferencePage();
} else if (page instanceof IDialogPageProvider) {
IDialogPage[] subPages = ((IDialogPageProvider)page).getDialogPages(false, true);
if (subPages != null) {
for (IDialogPage dp : subPages) {
setPageDataSourceElement(dataSource, dp);
}
}
}
if (page instanceof IWorkbenchPropertyPage) {
((IWorkbenchPropertyPage) page).setElement(dataSource);
}
}
private void savePageSettings(WizardPrefPage prefPage) {
if (isPageActive(prefPage)) {
prefPage.performFinish();
......
......@@ -36,6 +36,10 @@ public abstract class ActiveWizard extends BaseWizard
{
private List<WizardPrefPage> prefPages = new ArrayList<>();
protected List<WizardPrefPage> getPrefPages() {
return prefPages;
}
protected WizardPrefPage addPreferencePage(IPreferencePage prefPage, String title, String description)
{
WizardPrefPage wizardPage = createPreferencePage(prefPage, title, description);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册