mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-03 07:05:24 +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:
parent
4e51d5a6c1
commit
eae2356377
1 changed files with 31 additions and 33 deletions
|
@ -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()]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue