From 9c7ad4084fa8e421bb7ef89f4f3fd6029c218d20 Mon Sep 17 00:00:00 2001 From: Kushal Munir < kmunir@ca.ibm.com> Date: Thu, 29 Jun 2006 18:02:02 +0000 Subject: [PATCH] Updates to New Connection wizard --- ...AbstractSystemNewConnectionWizardPage.java | 4 +- .../ui/wizards/IRSENewConnectionWizard.java | 4 +- .../IRSENewConnectionWizardDelegate.java | 2 + ...RSEDefaultNewConnectionWizardDelegate.java | 59 +++++++++++++------ .../ui/wizards/RSENewConnectionWizard.java | 19 +++++- ...nnectionWizardDefaultDelegateMainPage.java | 32 +++++++--- .../RSENewConnectionWizardDelegate.java | 15 +++++ .../RSENewConnectionWizardMainPage.java | 51 ++++++++++++---- .../wizards/SubSystemServiceWizardPage.java | 2 +- 9 files changed, 145 insertions(+), 43 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemNewConnectionWizardPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemNewConnectionWizardPage.java index 764373266d1..9a5cbf0a32b 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemNewConnectionWizardPage.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemNewConnectionWizardPage.java @@ -115,7 +115,7 @@ public abstract class AbstractSystemNewConnectionWizardPage extends AbstractSyst if (ourWizard != null) { String[] systemTypes = parentFactory.getSystemTypes(); IRSESystemType systemType = RSECorePlugin.getDefault().getRegistry().getSystemType(systemTypes[0]); - IWizardPage wizardPage = ourWizard.getDelegate(systemType).getMainPage(); + IWizardPage wizardPage = ourWizard.getDelegate().getMainPage(); if (wizardPage instanceof ISystemNewConnectionWizardMainPage) { return (ISystemNewConnectionWizardMainPage)wizardPage; @@ -139,7 +139,7 @@ public abstract class AbstractSystemNewConnectionWizardPage extends AbstractSyst if (ourWizard != null) { String[] systemTypes = parentFactory.getSystemTypes(); IRSESystemType systemType = RSECorePlugin.getDefault().getRegistry().getSystemType(systemTypes[0]); - IWizardPage wizardPage = ourWizard.getDelegate(systemType).getMainPage(); + IWizardPage wizardPage = ourWizard.getDelegate().getMainPage(); if (wizardPage instanceof RSENewConnectionWizardDefaultDelegateMainPage) { return ((RSENewConnectionWizardDefaultDelegateMainPage)wizardPage).getForm(); diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/IRSENewConnectionWizard.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/IRSENewConnectionWizard.java index fc383f570f3..7436cef7093 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/IRSENewConnectionWizard.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/IRSENewConnectionWizard.java @@ -23,7 +23,7 @@ public interface IRSENewConnectionWizard extends INewWizard { public static final String NEW_CONNECTION_WIZARD_DELEGATE_EXTENSION_POINT_ID = "org.eclipse.rse.ui.newConnectionWizardDelegate"; - public IRSENewConnectionWizardDelegate getDelegate(IRSESystemType systemType); + public IRSENewConnectionWizardDelegate getDelegate(); - public void setSystemType(IRSESystemType systemType); + public void setSystemType(IRSESystemType systemType, boolean initWithSystemType); } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/IRSENewConnectionWizardDelegate.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/IRSENewConnectionWizardDelegate.java index 60835888924..606d06ba143 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/IRSENewConnectionWizardDelegate.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/IRSENewConnectionWizardDelegate.java @@ -27,6 +27,8 @@ public interface IRSENewConnectionWizardDelegate { public void init(RSENewConnectionWizard wizard, IRSESystemType systemType); + public void systemTypeChanged(IRSESystemType systemType); + public RSENewConnectionWizard getWizard(); public IRSESystemType getSystemType(); diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSEDefaultNewConnectionWizardDelegate.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSEDefaultNewConnectionWizardDelegate.java index 3b6ad7f1554..eb3c89b6cc2 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSEDefaultNewConnectionWizardDelegate.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSEDefaultNewConnectionWizardDelegate.java @@ -75,6 +75,7 @@ public class RSEDefaultNewConnectionWizardDelegate extends RSENewConnectionWizar super.init(wizard, systemType); restrictSystemType(systemType.getName()); activeProfileNames = SystemStartHere.getSystemProfileManager().getActiveSystemProfileNames(); + systemTypeSelected(systemType.getName(), true); } /** @@ -206,26 +207,36 @@ public class RSEDefaultNewConnectionWizardDelegate extends RSENewConnectionWizar */ protected RSENewConnectionWizardDefaultDelegateMainPage createMainPage(String[] restrictSystemTypesTo) { - String pageTitle = null; - if ((restrictSystemTypesTo==null) || (restrictSystemTypesTo.length != 1)) - pageTitle = SystemResources.RESID_NEWCONN_PAGE1_TITLE; - else - { - String onlySystemType = restrictSystemTypesTo[0]; - if (onlySystemType.equals(IRSESystemType.SYSTEMTYPE_LOCAL)) - pageTitle =SystemResources.RESID_NEWCONN_PAGE1_LOCAL_TITLE; - else - { - pageTitle =SystemResources.RESID_NEWCONN_PAGE1_REMOTE_TITLE; - pageTitle = SystemMessage.sub(pageTitle, "&1", onlySystemType); - } - } + String pageTitle = getPageTitle(); mainPage = new RSENewConnectionWizardDefaultDelegateMainPage(getWizard(), pageTitle, SystemResources.RESID_NEWCONN_PAGE1_DESCRIPTION); getWizard().setOutputObject(null); return mainPage; - } + } + + public String getPageTitle() { + + String pageTitle = null; + + if ((restrictSystemTypesTo == null) || (restrictSystemTypesTo.length != 1)) { + pageTitle = SystemResources.RESID_NEWCONN_PAGE1_TITLE; + } + else { + String onlySystemType = restrictSystemTypesTo[0]; + + if (onlySystemType.equals(IRSESystemType.SYSTEMTYPE_LOCAL)) { + pageTitle = SystemResources.RESID_NEWCONN_PAGE1_LOCAL_TITLE; + } + else { + pageTitle = SystemResources.RESID_NEWCONN_PAGE1_REMOTE_TITLE; + pageTitle = SystemMessage.sub(pageTitle, "&1", onlySystemType); + } + } + + return pageTitle; + } + /** * Set the currently selected connection. Used to better default entry fields. */ @@ -391,7 +402,10 @@ public class RSEDefaultNewConnectionWizardDelegate extends RSENewConnectionWizar */ public IWizardPage getMainPage() { - addPages(); + if (mainPage == null) { + addPages(); + } + return mainPage; } @@ -521,7 +535,8 @@ public class RSEDefaultNewConnectionWizardDelegate extends RSENewConnectionWizar */ public boolean canFinish() { - boolean ok = true; + boolean ok = mainPage.isPageComplete(); + if (ok && hasAdditionalPages()) { for (int idx=0; ok && (idx