if (structureState == null
|| structureState.hasStructuralChanges(resource, ITypeStructureCache.FLAG_ANNOTATION
| ITypeStructureCache.FLAG_ANNOTATION_VALUE)) {
if (deltaKind == IResourceDelta.REMOVED) {
IBeansProject beansProject = BeansCorePlugin.getModel().getProject(resource.getProject());
if (beansProject != null) {
for (IBeansConfig beansConfig : beansProject.getConfigs()) {
configs.add(beansConfig);
}
}
}
else {
for (IBeansConfig config : hierachyState.getConfigsByContainingTypes(resource)) {
configs.add(config);
}
}
}
}
else if (BeansCoreUtils.isBeansConfig(resource, true)) {
IBeansConfig beansConfig = (IBeansConfig) BeansModelUtils.getResourceModelElement(resource);
if (beansConfig instanceof IImportedBeansConfig) {
beansConfig = BeansModelUtils.getParentOfClass(beansConfig, IBeansConfig.class);
}
configs.add(beansConfig);
// Capture imports from other projects -> add importing config
for (IBeansProject bp : BeansCorePlugin.getModel().getProjects()) {
for (IBeansConfig bc : bp.getConfigs()) {
for (IBeansImport bi : bc.getImports()) {
for (IImportedBeansConfig ibc : bi.getImportedBeansConfigs()) {
if (ibc.getElementResource().equals(resource)) {
configs.add(bc);
}
}
}
}
}
}
// If the .classpath file is updated redo for every beans config
else if (JdtUtils.isClassPathFile(resource)) {
IBeansProject beansProject = BeansCorePlugin.getModel().getProject(resource.getProject());
if (beansProject != null) {
for (IBeansConfig beansConfig : beansProject.getConfigs()) {
configs.add(beansConfig);
}
}
}