Author: akazakov
Date: 2008-06-30 11:08:09 -0400 (Mon, 30 Jun 2008)
New Revision: 9020
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2451 Fixed
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2008-06-30
14:58:58 UTC (rev 9019)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2008-06-30
15:08:09 UTC (rev 9020)
@@ -135,6 +135,7 @@
if(linkedResources!=null) {
resources.addAll(linkedResources);
}
+ resources.addAll(getAllResourceOfComponent(currentFile.getFullPath()));
}
}
resources.add(currentFile.getFullPath());
@@ -162,7 +163,7 @@
// Remove markers from collected source file
IFile sourceFile = root.getFile(linkedResource);
reporter.removeMessageSubset(validationManager, sourceFile,
ISeamValidator.MARKED_SEAM_RESOURCE_MESSAGE_GROUP);
- validateComponent(linkedResource, checkedComponents);
+ validateComponent(linkedResource, checkedComponents, newResources);
validateFactory(linkedResource, markedDuplicateFactoryNames);
}
@@ -313,8 +314,12 @@
}
}
- private void validateComponent(IPath sourceFilePath, Set<ISeamComponent>
checkedComponents) {
+ private void validateComponent(IPath sourceFilePath, Set<ISeamComponent>
checkedComponents, Set<IPath> unnamedResources) {
Set<ISeamComponent> components = project.getComponentsByPath(sourceFilePath);
+ if(components.size()==0) {
+ unnamedResources.add(sourceFilePath);
+ return;
+ }
for (ISeamComponent component : components) {
// Don't validate one component twice.
if(!checkedComponents.contains(component)) {
@@ -340,6 +345,21 @@
}
/*
+ * Collect all resources of all declarations of all components which is declared in the
source.
+ */
+ private Set<IPath> getAllResourceOfComponent(IPath sourceComponentFilePath) {
+ Set<IPath> result = new HashSet<IPath>();
+ Set<ISeamComponent> components =
project.getComponentsByPath(sourceComponentFilePath);
+ for (ISeamComponent component : components) {
+ Set<ISeamComponentDeclaration> declarations = component.getAllDeclarations();
+ for (ISeamComponentDeclaration seamComponentDeclaration : declarations) {
+ result.add(seamComponentDeclaration.getResource().getFullPath());
+ }
+ }
+ return result;
+ }
+
+ /*
* Validates the component
*/
private void validateComponent(ISeamComponent component) {