return null;
}
for (IBeansProject project : this.beansModel.getProjects()) {
boolean updated = false;
BeansProject beansProject = (BeansProject) project;
// Firstly rename references to config sets
for (IBeansConfigSet configSet : beansProject.getConfigSets()) {
Set<IBeansConfig> configs = configSet.getConfigs();
for (IBeansConfig config : configs) {
if (config instanceof BeansJavaConfig) {
IType configClass = ((BeansJavaConfig) config).getConfigClass();
if (type.equals(configClass)) {
((BeansConfigSet) configSet).removeConfig(config.getElementName());
((BeansConfigSet) configSet).addConfig(BeansConfigFactory.JAVA_CONFIG_TYPE + newName);
}
else if (configClass != null && type.equals(configClass.getDeclaringType())) {
beansProject.removeConfig(config.getElementName());
String newConfigClassName = newName + "$" + configClass.getElementName();
beansProject.addConfig(BeansConfigFactory.JAVA_CONFIG_TYPE + newConfigClassName, IBeansConfig.Type.MANUAL);
}
}
}
}
// Secondly rename configs
for (IBeansConfig config : beansProject.getConfigs()) {
if (config instanceof BeansJavaConfig) {
IType configClass = ((BeansJavaConfig) config).getConfigClass();
if (configClass != null && getNewConfigName(newName, type, configClass) != null) {
beansProject.removeConfig(config.getElementName());
beansProject.addConfig(BeansConfigFactory.JAVA_CONFIG_TYPE + getNewConfigName(newName, type, configClass), IBeansConfig.Type.MANUAL);
// removeMarkers(config);
updated = true;
}
}
}