myFrameworkInstance.addItem(null);
List<FrameworkInstanceDefinition> instanceDefinitions = ApplicationSettings.getInstance().getActiveFrameworkInstanceDefinitions();
final String frameworkInstanceName = mySettings.getFrameworkInstanceName();
FrameworkInstanceDefinition projectFrameworkInstance = null;
for (FrameworkInstanceDefinition instanceDefinition : instanceDefinitions) {
//noinspection unchecked
myFrameworkInstance.addItem(instanceDefinition);
if (instanceDefinition.getName().equals(frameworkInstanceName)) {
projectFrameworkInstance = instanceDefinition;
}
}
// add it, but it will be marked red.
if (projectFrameworkInstance == null && frameworkInstanceName != null) {
projectFrameworkInstance = new FrameworkInstanceDefinition();
projectFrameworkInstance.setName(frameworkInstanceName);
//noinspection unchecked
myFrameworkInstance.addItem(projectFrameworkInstance);
}
myFrameworkInstance.setSelectedItem(projectFrameworkInstance);
}