Author: akazakov
Date: 2008-11-18 10:02:41 -0500 (Tue, 18 Nov 2008)
New Revision: 11867
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/frameworkComponents.xhtml
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/WEB-INF/components.xml
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3213 Fixed
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2008-11-18
14:42:23 UTC (rev 11866)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2008-11-18
15:02:41 UTC (rev 11867)
@@ -17,6 +17,7 @@
import java.util.Set;
import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
@@ -25,6 +26,8 @@
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.Type;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.TypeInfo;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.TypeMemberInfo;
+import org.jboss.tools.common.model.util.EclipseJavaUtil;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
import org.jboss.tools.seam.core.ISeamComponent;
@@ -265,7 +268,7 @@
}
if (variable instanceof ISeamComponent) {
ISeamComponent component = (ISeamComponent)variable;
-
+
// Use UNWRAP method type instead of ISeamComponent type if it exists
IMember unwrapSourceMember = null;
for (ISeamComponentMethod method : component.getMethods()) {
@@ -280,6 +283,20 @@
ISeamJavaComponentDeclaration decl = component.getJavaDeclaration();
if (decl != null) {
member = TypeInfoCollector.createMemberInfo(decl.getSourceMember());
+ } else {
+ // Maybe it is framework component? Then let's try to find the class of it.
+ String className = component.getClassName();
+ if(className!=null) {
+ IJavaProject project =
EclipseResourceUtil.getJavaProject(component.getSeamProject().getProject());
+ try {
+ IType type = project.findType(className);
+ if(type!=null) {
+ member = TypeInfoCollector.createMemberInfo(type);
+ }
+ } catch (JavaModelException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ }
+ }
}
}
}
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/WEB-INF/components.xml
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/WEB-INF/components.xml 2008-11-18
14:42:23 UTC (rev 11866)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/WEB-INF/components.xml 2008-11-18
15:02:41 UTC (rev 11867)
@@ -5,11 +5,13 @@
xmlns:security="http://jboss.com/products/seam/security"
xmlns:mail="http://jboss.com/products/seam/mail"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns:framework="http://jboss.com/products/seam/framework"
xsi:schemaLocation=
"http://jboss.com/products/seam/core
http://jboss.com/products/seam/core-1.1.xsd
http://jboss.com/products/seam/drools
http://jboss.com/products/seam/drools-1.1.xsd
http://jboss.com/products/seam/security
http://jboss.com/products/seam/security-1.1.xsd
http://jboss.com/products/seam/mail
http://jboss.com/products/seam/mail-1.2.xsd
+
http://jboss.com/products/seam/framework
http://jboss.com/products/seam/framework-1.2.xsd
http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-1.1.xsd">
<core:init debug="true" jndi-pattern="@jndiPattern@"/>
@@ -44,7 +46,9 @@
</event>
<mail:mail-session host="localhost" port="2525"
username="test" password="test" />
-
+
+ <framework:entity-query name="fullPostList" ejbql="select post from
Post post" order="date desc" max-results="20"/>
+
<!-- For use with jBPM pageflow or process management -->
<!--
<core:jbpm>
@@ -52,5 +56,5 @@
<core:pageflow-definitions></core:pageflow-definitions>
</core:jbpm>
-->
-
-</components>
+
+</components>
\ No newline at end of file
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/frameworkComponents.xhtml
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/frameworkComponents.xhtml
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/frameworkComponents.xhtml 2008-11-18
15:02:41 UTC (rev 11867)
@@ -0,0 +1,19 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
+ template="layout/template.xhtml">
+
+<ui:define name="body">
+
+ <h:messages globalOnly="true" styleClass="message"/>
+
+ <h:dataTable var="post" value="#{fullPostList.resultList}">
+ </h:dataTable>
+
+</ui:define>
+</ui:composition>
\ No newline at end of file
Property changes on:
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/frameworkComponents.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2008-11-18
14:42:23 UTC (rev 11866)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2008-11-18
15:02:41 UTC (rev 11867)
@@ -54,6 +54,14 @@
}
/**
+ * Test for
https://jira.jboss.org/jira/browse/JBIDE-3213
+ */
+ public void testFrameworkComponents() {
+ assertTrue("Test project \"" + PROJECT_NAME + "\" is not
loaded", (project != null));
+ checkProposals("/WebContent/frameworkComponents.xhtml", 684, new
String[]{"fullPostList.resultList", "fullPostList.next"}, false);
+ }
+
+ /**
* Test for
http://jira.jboss.com/jira/browse/JBIDE-1258
*/
public void testMessages() {