1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-16 13:35:22 +02:00

[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

This commit is contained in:
David McKnight 2008-08-20 19:24:19 +00:00
parent 4e51d5a6c1
commit eae2356377

View file

@ -298,42 +298,40 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
IRSESystemType systemType = getSystemType(); IRSESystemType systemType = getSystemType();
ISubSystemConfiguration[] configurations = sr.getSubSystemConfigurationsBySystemType(systemType, true); ISubSystemConfiguration[] configurations = sr.getSubSystemConfigurationsBySystemType(systemType, true);
// should be one configuration per configurator ArrayList configList = new ArrayList();
if (configurations.length <= subsystemConfigurationSuppliedWizardPages.length) for (int i = 0; i < configurations.length; i++){
return subsystemConfigurationSuppliedWizardPages; ISubSystemConfiguration configuration = configurations[i];
else { // missing pages for configurations ISubSystemConfigurator firstMatch = null;
ArrayList configList = new ArrayList(); for (int j = 0; j < subsystemConfigurationSuppliedWizardPages.length; j++){
for (int i = 0; i < configurations.length; i++){ ISystemNewConnectionWizardPage page = subsystemConfigurationSuppliedWizardPages[j];
ISubSystemConfiguration configuration = configurations[i]; ISubSystemConfiguration pageConfiguration = page.getSubSystemConfiguration();
boolean foundMatch = false; if (configuration == pageConfiguration){ // found a match
for (int j = 0; j < subsystemConfigurationSuppliedWizardPages.length && !foundMatch; j++){ configList.add(page); // could be more than one
ISystemNewConnectionWizardPage page = subsystemConfigurationSuppliedWizardPages[j]; if (firstMatch == null){
ISubSystemConfiguration pageConfiguration = page.getSubSystemConfiguration(); firstMatch = page;
if (configuration == pageConfiguration){ // found a match
configList.add(page);
foundMatch = true;
} }
} }
if (!foundMatch){ // no match found so need to provide alternative }
class DefaultConfigurator implements ISubSystemConfigurator { if (firstMatch == null){ // no match found so need to provide alternative
private ISubSystemConfiguration _configuration; class DefaultConfigurator implements ISubSystemConfigurator {
public DefaultConfigurator(ISubSystemConfiguration configuration){ private ISubSystemConfiguration _configuration;
_configuration = configuration; public DefaultConfigurator(ISubSystemConfiguration configuration){
} _configuration = configuration;
public boolean applyValues(ISubSystem ss) {
return true;
}
public ISubSystemConfiguration getSubSystemConfiguration() {
return _configuration;
}
} }
configList.add(new DefaultConfigurator(configuration));
} public boolean applyValues(ISubSystem ss) {
} return true;
return (ISubSystemConfigurator[])configList.toArray(new ISubSystemConfigurator[configList.size()]); }
}
public ISubSystemConfiguration getSubSystemConfiguration() {
return _configuration;
}
}
configList.add(new DefaultConfigurator(configuration));
}
}
return (ISubSystemConfigurator[])configList.toArray(new ISubSystemConfigurator[configList.size()]);
} }
/** /**