Author: scabanovich
Date: 2007-07-10 07:00:39 -0400 (Tue, 10 Jul 2007)
New Revision: 2365
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaComponentDeclaration.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/SeamObject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
Log:
EXIN-217 getScope implemented for seam component
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaComponentDeclaration.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaComponentDeclaration.java 2007-07-10
10:52:37 UTC (rev 2364)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaComponentDeclaration.java 2007-07-10
11:00:39 UTC (rev 2365)
@@ -21,6 +21,12 @@
public static final int DEFAULT_PRECEDENCE = SeamComponentPrecedenceType.APPLICATION;
/**
+ *
+ * @return scope
+ */
+ public ScopeType getScope();
+
+ /**
* @return qualified class name
*/
public String getClassName();
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-10
10:52:37 UTC (rev 2364)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2007-07-10
11:00:39 UTC (rev 2365)
@@ -134,8 +134,21 @@
* @see org.jboss.tools.seam.core.ISeamContextVariable#getScope()
*/
public ScopeType getScope() {
- //TODO
- return null;
+ ScopeType scopeType = null;
+ for (ISeamXmlComponentDeclaration d: xmlDeclarations) {
+ String s = d.getScopeAsString();
+ if(s != null && s.length() > 0) {
+ scopeType = d.getScope();
+ }
+ if(scopeType != null && scopeType != ScopeType.UNSPECIFIED) break;
+ }
+ if(scopeType == null || scopeType == ScopeType.UNSPECIFIED) {
+ ISeamJavaComponentDeclaration java = getJavaDeclaration();
+ if(java != null) scopeType = java.getScope();
+ }
+ if(scopeType == null) scopeType = ScopeType.UNSPECIFIED;
+
+ return scopeType;
}
/**
@@ -201,7 +214,7 @@
if(allDeclarations.contains(declaration)) return;
allDeclarations.add(declaration);
if(name.equals(declaration.getName())) {
- ((SeamObject)declaration).setParent(this);
+ adopt(declaration);
}
if(declaration instanceof ISeamJavaComponentDeclaration) {
javaDeclarations.add((ISeamJavaComponentDeclaration)declaration);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamObject.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamObject.java 2007-07-10
10:52:37 UTC (rev 2364)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamObject.java 2007-07-10
11:00:39 UTC (rev 2365)
@@ -78,6 +78,9 @@
if(source != null) {
resource = ResourcesPlugin.getWorkspace().getRoot().getFile(source);
}
+ if(resource == null && parent != null) {
+ return parent.getResource();
+ }
return resource;
}
@@ -107,6 +110,7 @@
public List<Change> merge(SeamObject s) {
source = s.source;
id = s.id;
+ resource = s.resource;
return null;
}
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 2007-07-10
10:52:37 UTC (rev 2364)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-07-10
11:00:39 UTC (rev 2365)
@@ -118,7 +118,7 @@
b.visit(f);
}
long end = System.currentTimeMillis();
- System.out.println("loaded in " + (end - begin));
+// System.out.println("loaded in " + (end - begin));
}
/**
Show replies by date