Author: scabanovich
Date: 2009-04-29 08:04:13 -0400 (Wed, 29 Apr 2009)
New Revision: 14958
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1077
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2009-04-29
11:02:26 UTC (rev 14957)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2009-04-29
12:04:13 UTC (rev 14958)
@@ -210,6 +210,15 @@
public Set<IBijectedAttribute> getBijectedAttributesByType(BijectedAttributeType
type);
/**
+ * Utility method collecting all bijections of given name and type in java
declarations.
+ * Parameters name and/or type can be set to null, then bijections with any
+ * name and/or type is returned.
+ * @param name
+ * @param type
+ * @return
+ */
+ public Set<IBijectedAttribute> getBijectedAttributesByName(String name,
BijectedAttributeType type);
+ /**
* @return all factories methods of project
*/
public ISeamFactory[] getFactories();
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-04-29
11:02:26 UTC (rev 14957)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-04-29
12:04:13 UTC (rev 14958)
@@ -1332,6 +1332,20 @@
return result;
}
+ public Set<IBijectedAttribute> getBijectedAttributesByName(String name,
BijectedAttributeType type) {
+ Set<IBijectedAttribute> result = new HashSet<IBijectedAttribute>();
+ ISeamJavaComponentDeclaration[] ds = components.getJavaDeclarationsArray();
+ for (ISeamJavaComponentDeclaration d: ds) {
+ Set<IBijectedAttribute> as = d.getBijectedAttributes();
+ for (IBijectedAttribute a: as) {
+ if(name != null && !name.equals(a.getName())) continue;
+ if(type != null && !a.isOfType(type)) continue;
+ result.add(a);
+ }
+ }
+ return result;
+ }
+
/**
*
* @param v