From eae2356377441abd05307a793ea5d85a6d18ba77 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Wed, 20 Aug 2008 19:24:19 +0000 Subject: [PATCH] [243332] Removing wizard page caused subsystem to be removed -updated so that we can handle the case where there's more than one page for one config --- .../RSEDefaultNewConnectionWizard.java | 64 +++++++++---------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSEDefaultNewConnectionWizard.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSEDefaultNewConnectionWizard.java index 94bc8dc1a01..be0479b867b 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSEDefaultNewConnectionWizard.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSEDefaultNewConnectionWizard.java @@ -298,42 +298,40 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar IRSESystemType systemType = getSystemType(); ISubSystemConfiguration[] configurations = sr.getSubSystemConfigurationsBySystemType(systemType, true); - // should be one configuration per configurator - if (configurations.length <= subsystemConfigurationSuppliedWizardPages.length) - return subsystemConfigurationSuppliedWizardPages; - else { // missing pages for configurations - ArrayList configList = new ArrayList(); - for (int i = 0; i < configurations.length; i++){ - ISubSystemConfiguration configuration = configurations[i]; - boolean foundMatch = false; - for (int j = 0; j < subsystemConfigurationSuppliedWizardPages.length && !foundMatch; j++){ - ISystemNewConnectionWizardPage page = subsystemConfigurationSuppliedWizardPages[j]; - ISubSystemConfiguration pageConfiguration = page.getSubSystemConfiguration(); - if (configuration == pageConfiguration){ // found a match - configList.add(page); - foundMatch = true; + ArrayList configList = new ArrayList(); + for (int i = 0; i < configurations.length; i++){ + ISubSystemConfiguration configuration = configurations[i]; + ISubSystemConfigurator firstMatch = null; + for (int j = 0; j < subsystemConfigurationSuppliedWizardPages.length; j++){ + ISystemNewConnectionWizardPage page = subsystemConfigurationSuppliedWizardPages[j]; + ISubSystemConfiguration pageConfiguration = page.getSubSystemConfiguration(); + if (configuration == pageConfiguration){ // found a match + configList.add(page); // could be more than one + if (firstMatch == null){ + firstMatch = page; } } - if (!foundMatch){ // no match found so need to provide alternative - class DefaultConfigurator implements ISubSystemConfigurator { - private ISubSystemConfiguration _configuration; - public DefaultConfigurator(ISubSystemConfiguration configuration){ - _configuration = configuration; - } - - public boolean applyValues(ISubSystem ss) { - return true; - } - - public ISubSystemConfiguration getSubSystemConfiguration() { - return _configuration; - } + } + if (firstMatch == null){ // no match found so need to provide alternative + class DefaultConfigurator implements ISubSystemConfigurator { + private ISubSystemConfiguration _configuration; + public DefaultConfigurator(ISubSystemConfiguration configuration){ + _configuration = configuration; } - configList.add(new DefaultConfigurator(configuration)); - } - } - return (ISubSystemConfigurator[])configList.toArray(new ISubSystemConfigurator[configList.size()]); - } + + public boolean applyValues(ISubSystem ss) { + return true; + } + + public ISubSystemConfiguration getSubSystemConfiguration() { + return _configuration; + } + } + configList.add(new DefaultConfigurator(configuration)); + } + } + return (ISubSystemConfigurator[])configList.toArray(new ISubSystemConfigurator[configList.size()]); + } /**