Author: scabanovich
Date: 2007-07-12 13:19:04 -0400 (Thu, 12 Jul 2007)
New Revision: 2412
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java
Log:
EXIN-218 Properties of component added.
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponent.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponent.java 2007-07-12
17:17:08 UTC (rev 2411)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponent.java 2007-07-12
17:19:04 UTC (rev 2412)
@@ -50,6 +50,11 @@
* @return qualified Class name of component
*/
public String getClassName();
+
+ /**
+ *
+ */
+ public int getPrecedence();
/**
* @return bijected attributes of component
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2007-07-12
17:17:08 UTC (rev 2411)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2007-07-12
17:19:04 UTC (rev 2412)
@@ -83,6 +83,25 @@
}
/**
+ *
+ */
+ public int getPrecedence() {
+ Set<ISeamXmlComponentDeclaration> xml = getXmlDeclarations();
+ for(ISeamXmlComponentDeclaration d: xml) {
+ String s = d.getPrecedence();
+ if(s == null || s.length() == 0) continue;
+ try {
+ return Integer.valueOf(s);
+ } catch (Exception e) {
+ //ignore here
+ }
+ }
+ ISeamJavaComponentDeclaration javaDeclaration = getJavaDeclaration();
+ if(javaDeclaration != null) return javaDeclaration.getPrecedence();
+ return 20;
+ }
+
+ /**
* @see org.jboss.tools.seam.core.ISeamComponent#getMethods()
*/
public Set<ISeamComponentMethod> getMethods() {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2007-07-12
17:17:08 UTC (rev 2411)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2007-07-12
17:19:04 UTC (rev 2412)
@@ -156,10 +156,10 @@
name.value = m.getName().getIdentifier();
}
- att.setName(name.getValue());
+ att.setName(name);
ValueInfo scope = ValueInfo.getValueInfo(main, "scope");
- if(scope != null) att.setScopeAsString(scope.getValue());
+ if(scope != null) att.setScope(scope);
att.setSourceMember(findMethod(m));
}
@@ -191,10 +191,10 @@
name.value = getFieldName(m);
}
- att.setName(name.getValue());
+ att.setName(name);
ValueInfo scope = ValueInfo.getValueInfo(main, "scope");
- if(scope != null) att.setScopeAsString(scope.getValue());
+ if(scope != null) att.setScope(scope);
att.setSourceMember(findField(m));
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java 2007-07-12
17:17:08 UTC (rev 2411)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java 2007-07-12
17:19:04 UTC (rev 2412)
@@ -128,8 +128,13 @@
}
a = map.get(INSTALL_ANNOTATION_TYPE);
if(a != null) {
- Object precedence = getValue(a, "precedence");
- if(precedence instanceof Integer) component.setPrecedence((Integer)precedence);
+ String precedence = getValue(a, "precedence");
+ try {
+ int i = Integer.parseInt(precedence);
+ component.setPrecedence(i);
+ } catch (Exception e) {
+ //ignore
+ }
}
a = map.get(STATEFUL_ANNOTATION_TYPE);
if(a != null) {
Show replies by date