Set<IBeansConfig> configs = BeansCorePlugin.getModel().getConfigs((IFile) resource, true);
if (configs != null && configs.size() > 0) {
for (IBeansConfig beansConfig : configs) {
// Resolve imported config files to their root importing one
if (beansConfig instanceof IImportedBeansConfig) {
IBeansConfig importingConfig = BeansModelUtils.getParentOfClass(beansConfig, IBeansConfig.class);
if (importingConfig != null) {
resources.add(importingConfig.getElementResource());
addBeans(importingConfig);
}
}
else {
resources.add(resource);
addBeans(beansConfig);
}
}
// Add resources that are in a config set with the changed resources
propagateChangedResourceToConfigSets(resources);
}
else if (BeansResourceChangeListener.requiresRefresh((IFile) resource)) {
propagateChangedResourceToProject(resource, resources);
}
else if (kind != IncrementalProjectBuilder.FULL_BUILD) {
// Now check for bean classes and java structure
TypeStructureState structureState = getProjectContributorState().get(TypeStructureState.class);
BeansTypeHierachyState hierachyState = getProjectContributorState().get(BeansTypeHierachyState.class);
if (structureState == null
|| structureState.hasStructuralChanges(resource, ITypeStructureCache.FLAG_ANNOTATION
| ITypeStructureCache.FLAG_ANNOTATION_VALUE | ITypeStructureCache.FLAG_TAB_BITS)) {
// Capture removal of java source files
if (deltaKind == IResourceDelta.REMOVED
&& resource.getName().endsWith(JdtUtils.JAVA_FILE_EXTENSION)) {
propagateChangedResourceToProject(resource, resources);
}
else {
for (IBean bean : hierachyState.getBeansByContainingTypes(resource)) {
IBeansConfig beansConfig = BeansModelUtils.getConfig(bean);
// Resolve imported config files to their root importing one
if (beansConfig instanceof IImportedBeansConfig) {
IBeansConfig importingConfig = BeansModelUtils.getParentOfClass(beansConfig,
IBeansConfig.class);
if (importingConfig != null) {
resources.add(importingConfig.getElementResource());
affectedBeans.add(bean.getElementID());
}
}
else {
resources.add(beansConfig.getElementResource());