[jbosstools-commits] JBoss Tools SVN: r43715 - in trunk: common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver and 7 other directories.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Fri Sep 14 15:39:40 EDT 2012
Author: akazakov
Date: 2012-09-14 15:39:40 -0400 (Fri, 14 Sep 2012)
New Revision: 43715
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.validation.prefs
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/JavaSource/demo/TestBeanForVarAttributes.java
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/varAttributes.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/VarAttributesTest.java
Removed:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/classes/resources.properties
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/lib/jsf-api-2.jar
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-12614 Code completion on item with h:dataTable fails if value point on datamodel object
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2012-09-14 19:32:32 UTC (rev 43714)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2012-09-14 19:39:40 UTC (rev 43715)
@@ -265,7 +265,7 @@
try {
if(TypeInfoCollector.isInstanceofType(type, "java.util.Map")) { //$NON-NLS-1$
suffix = collectionAdditionForMapDataModel;
- } else if(TypeInfoCollector.isInstanceofType(type, "java.util.Collection")) { //$NON-NLS-1$
+ } else if(TypeInfoCollector.isInstanceofType(type, "java.lang.Iterable")) { //$NON-NLS-1$
suffix = collectionAdditionForCollectionDataModel;
}
} catch (JavaModelException e) {
@@ -668,7 +668,7 @@
}
}
segment = lastSegment;
- } else if(TypeInfoCollector.isInstanceofType(type, "java.util.Collection")) { //$NON-NLS-1$
+ } else if(TypeInfoCollector.isInstanceofType(type, "java.lang.Iterable")) { //$NON-NLS-1$
skipSegment = true;
String s = "#{" + left.getLeft().toString() + collectionAdditionForCollectionDataModel + "}"; //$NON-NLS-1$ //$NON-NLS-2$
if(getParserFactory()!=null) {
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java 2012-09-14 19:32:32 UTC (rev 43714)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java 2012-09-14 19:39:40 UTC (rev 43715)
@@ -875,7 +875,7 @@
}
IType type = mbr.getMemberType();
if(type!=null) {
- return isInstanceofType(type, "java.util.Map") || isInstanceofType(type, "java.util.Collection"); //$NON-NLS-1$ //$NON-NLS-2$
+ return isInstanceofType(type, "java.util.Map") || isInstanceofType(type, "java.lang.Iterable"); //$NON-NLS-1$ //$NON-NLS-2$
}
return false;
} catch (JavaModelException e) {
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.validation.prefs
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.validation.prefs (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.validation.prefs 2012-09-14 19:39:40 UTC (rev 43715)
@@ -0,0 +1,9 @@
+DELEGATES_PREFERENCE=delegateValidatorList
+USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.jboss.tools.common.validation.ValidatorManager;
+USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.jboss.tools.common.validation.ValidatorManager;
+USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.400.v201204260100
+eclipse.preferences.version=1
+override=true
+suspend=false
+vals/org.eclipse.jst.jsf.facelet.ui.FaceletHTMLValidator/global=FF01
+vf.version=3
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.validation.prefs
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/JavaSource/demo/TestBeanForVarAttributes.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/JavaSource/demo/TestBeanForVarAttributes.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/JavaSource/demo/TestBeanForVarAttributes.java 2012-09-14 19:39:40 UTC (rev 43715)
@@ -0,0 +1,52 @@
+package demo;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.model.DataModel;
+
+ at ManagedBean
+public class TestBeanForVarAttributes {
+
+ public Test getTest() {
+ return null;
+ }
+
+ public List<Value> getList() {
+ return null;
+ }
+
+ public Set<Value> getSet() {
+ return null;
+ }
+
+ public Map<String, Value> getMap() {
+ return null;
+ }
+
+ public Iterable<Value> getIterable() {
+ return null;
+ }
+
+ public Value[] getArray() {
+ return null;
+ }
+
+ public DataModel<Value> getListDM() {
+ return null;
+ }
+
+ public static class Value {
+ public String getName() {
+ return null;
+ }
+ }
+
+ public static class Test {
+ public List<Value> getItems() {
+ return null;
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/JavaSource/demo/TestBeanForVarAttributes.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/classes/resources.properties
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/classes/resources.properties 2012-09-14 19:32:32 UTC (rev 43714)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/classes/resources.properties 2012-09-14 19:39:40 UTC (rev 43715)
@@ -1,2 +0,0 @@
-prompt=Your Name\:
-greeting=Hello
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/lib/jsf-api-2.jar
===================================================================
(Binary files differ)
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/varAttributes.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/varAttributes.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/varAttributes.xhtml 2012-09-14 19:39:40 UTC (rev 43715)
@@ -0,0 +1,47 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html">
+
+
+ <h:dataTable value="#{testBeanForVarAttributes.test}" var="testItem">
+ <h:dataTable value="#{testItem.items}" var="test">
+ <h:outputText value="#{test.name}"/>
+ <h:outputText value="#{test.broken}"/>
+ </h:dataTable>
+ <h:outputText value="#{testItem.broken}"/>
+ </h:dataTable>
+
+ <h:dataTable value="#{testBeanForVarAttributes.map}" var="mapItem">
+ <h:outputText value="#{mapItem.value.name}"/>
+ <h:outputText value="#{mapItem.key.bytes}"/>
+ <h:outputText value="#{mapItem.broken}"/>
+ <h:outputText value="#{mapItem.value.broken}"/>
+ <h:outputText value="#{mapItem.key.broken}"/>
+ </h:dataTable>
+
+ <h:dataTable value="#{testBeanForVarAttributes.array}" var="arrayItem">
+ <h:outputText value="#{arrayItem.name}"/>
+ <h:outputText value="#{arrayItem.broken}"/>
+ </h:dataTable>
+
+ <h:dataTable value="#{testBeanForVarAttributes.iterable}" var="iterableItem">
+ <h:outputText value="#{iterableItem.name}"/>
+ <h:outputText value="#{iterableItem.broken}"/>
+ </h:dataTable>
+
+ <h:dataTable value="#{testBeanForVarAttributes.list}" var="listItem">
+ <h:outputText value="#{listItem.name}"/>
+ <h:outputText value="#{listItem.broken}"/>
+ </h:dataTable>
+
+ <h:dataTable value="#{testBeanForVarAttributes.listDM}" var="dmItem">
+ <h:outputText value="#{dmItem.name}"/>
+ <h:outputText value="#{dmItem.broken}"/>
+ </h:dataTable>
+
+ <h:dataTable value="#{testBeanForVarAttributes.set}" var="setItem">
+ <h:outputText value="#{setItem.name}"/>
+ <h:outputText value="#{setItem.broken}"/>
+ </h:dataTable>
+
+</html>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2012-09-14 19:32:32 UTC (rev 43714)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2012-09-14 19:39:40 UTC (rev 43715)
@@ -29,6 +29,7 @@
import org.jboss.tools.jsf.test.validation.FacesConfigValidatorTest;
import org.jboss.tools.jsf.test.validation.JSF2ComponentsInClassFolderTest;
import org.jboss.tools.jsf.test.validation.JSF2ComponentsValidatorTest;
+import org.jboss.tools.jsf.test.validation.VarAttributesTest;
import org.jboss.tools.jsf.test.validation.WebContentTest;
import org.jboss.tools.jsf.test.validation.XHTMLDetectorAndValidatorTest;
import org.jboss.tools.jsf.test.validation.XHTMLValidatorTest;
@@ -107,6 +108,7 @@
// new String[] { "i18nTestProject" })); //$NON-NLS-1$
suite.addTest(new ValidationProjectTestSetup(new TestSuite(ELValidatorTest.class),"org.jboss.tools.jsf.test","projects/JSFKickStartOldFormat","JSFKickStartOldFormat"));
suite.addTest(new ValidationProjectTestSetup(new TestSuite(BuilderValidationTest.class),"org.jboss.tools.jsf.test","projects/jsf2pr","jsf2pr"));
+ suite.addTest(new ValidationProjectTestSetup(new TestSuite(VarAttributesTest.class),"org.jboss.tools.jsf.test","projects/jsf2pr","jsf2pr"));
suite.addTestSuite(ValidationExceptionTest.class); // This test should be added last!
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/VarAttributesTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/VarAttributesTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/VarAttributesTest.java 2012-09-14 19:39:40 UTC (rev 43715)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.test.validation;
+
+import java.text.MessageFormat;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.jboss.tools.jst.web.kb.internal.validation.ELValidationMessages;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class VarAttributesTest extends TestCase {
+
+ IProject project;
+ IFile xhtml;
+ String messageBroken = MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, new Object[]{"broken"});
+ String messageOk = MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, new Object[]{"name"});
+
+ @Override
+ protected void setUp() throws Exception {
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject("jsf2pr");
+ xhtml = project.getFile("WebContent/varAttributes.xhtml");
+ }
+
+ public void testBroken() throws Exception {
+ AbstractResourceMarkerTest.assertMarkerIsCreated(xhtml, messageBroken, 9, 11, 17, 18, 19, 24, 29, 34, 39, 44);
+ }
+
+ public void testInnerClass() throws Exception {
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(xhtml, messageOk, 8);
+ }
+
+ public void testMap() throws Exception {
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(xhtml, messageOk, 15);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(xhtml, messageOk, 16);
+ }
+
+ public void testArray() throws Exception {
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(xhtml, messageOk, 23);
+ }
+
+ public void testIterable() throws Exception {
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(xhtml, messageOk, 28);
+ }
+
+ public void testList() throws Exception {
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(xhtml, messageOk, 33);
+ }
+
+ public void testDataModel() throws Exception {
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(xhtml, messageOk, 38);
+ }
+
+ public void testSet() throws Exception {
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(xhtml, messageOk, 43);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/VarAttributesTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
More information about the jbosstools-commits
mailing list