Author: mareshkau
Date: 2009-07-24 04:32:19 -0400 (Fri, 24 Jul 2009)
New Revision: 16759
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/JavaSource/test/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/JavaSource/test/CoreLibrary.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/JavaSource/test/IfHandler.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/WEB-INF/test.taglib.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/JavaSource/demo/FaceletFunctions.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/JavaSource/demo/IfHandler.java
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/plugin.xml
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/TaglibDefinitionFilesHyperlinkPartitioner.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLTextHyperlinkPartitioner.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/WEB-INF/web.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/tags/facelets.taglib.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4509Test.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4638
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/plugin.xml 2009-07-24 01:55:20
UTC (rev 16758)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/plugin.xml 2009-07-24 08:32:19
UTC (rev 16759)
@@ -643,7 +643,13 @@
<contentType id="org.jboss.tools.common.model.ui.xml">
<partitionType
id="org.jboss.tools.common.text.ext.xml.XML_TEXT">
<axis path="/facelet-taglib/tag/source">
- </axis>
+ </axis>
+ <axis path="/facelet-taglib/function/function-class">
+ </axis>
+ <axis
path="/facelet-taglib/tag/component/handler-class">
+ </axis>
+ <axis path="/facelet-taglib/library-class">
+ </axis>
</partitionType>
</contentType>
</hyperlinkPartitioner>
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/TaglibDefinitionFilesHyperlinkPartitioner.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/TaglibDefinitionFilesHyperlinkPartitioner.java 2009-07-24
01:55:20 UTC (rev 16758)
+++
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/TaglibDefinitionFilesHyperlinkPartitioner.java 2009-07-24
08:32:19 UTC (rev 16759)
@@ -11,6 +11,7 @@
package org.jboss.tools.common.text.ext.hyperlink;
import org.eclipse.jface.text.IDocument;
+import org.jboss.tools.common.text.ext.hyperlink.xml.XMLClassHyperlinkPartitioner;
import org.jboss.tools.common.text.ext.hyperlink.xml.XMLTextHyperlinkPartitioner;
import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
import org.jboss.tools.common.text.ext.util.Utils;
@@ -47,7 +48,10 @@
}
@Override
- protected String getPartitionType() {
+ protected String getPartitionType(String axis) {
+ if(axis!=null && axis.contains("class")) { //$NON-NLS-1$
+ return XMLClassHyperlinkPartitioner.XML_CLASS_PARTITION;
+ }
return TAGLIB_XML_PARTITION;
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLTextHyperlinkPartitioner.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLTextHyperlinkPartitioner.java 2009-07-24
01:55:20 UTC (rev 16758)
+++
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLTextHyperlinkPartitioner.java 2009-07-24
08:32:19 UTC (rev 16759)
@@ -45,7 +45,7 @@
String axis = getAxis(document, superRegion);
String contentType = superRegion.getContentType();
- String type = getPartitionType();
+ String type = getPartitionType(axis);
int start = Utils.getValueStart(n);
int end = Utils.getValueEnd(n);
if(start < 0 || end < start) return null;
@@ -76,7 +76,7 @@
}
}
- protected String getPartitionType() {
+ protected String getPartitionType(String axis) {
return XML_TEXT_PARTITION;
}
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/JavaSource/test/CoreLibrary.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/JavaSource/test/CoreLibrary.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/JavaSource/test/CoreLibrary.java 2009-07-24
08:32:19 UTC (rev 16759)
@@ -0,0 +1,26 @@
+package test;
+import com.sun.facelets.tag.AbstractTagLibrary;
+
+
+/**
+ *
+ */
+
+/**
+ * @author mareshkau
+ *
+ */
+public class CoreLibrary extends AbstractTagLibrary {
+
+ public final static String Namespace =
"http://jboss.org/jbosstools/test";
+
+ public final static CoreLibrary Instance = new CoreLibrary();
+
+ public CoreLibrary() {
+ super(Namespace);
+
+ this.addTagHandler("if", IfHandler.class);
+
+ }
+
+ }
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/JavaSource/test/IfHandler.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/JavaSource/test/IfHandler.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/JavaSource/test/IfHandler.java 2009-07-24
08:32:19 UTC (rev 16759)
@@ -0,0 +1,48 @@
+/**
+ *
+ */
+package test;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+
+import org.apache.taglibs.standard.lang.jstl.ELException;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.FaceletException;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagHandler;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class IfHandler extends TagHandler {
+ private final TagAttribute test;
+
+ private final TagAttribute var;
+
+ /**
+ * @param config
+ */
+ public IfHandler(TagConfig config) {
+ super(config);
+ this.test = this.getRequiredAttribute("test");
+ this.var = this.getAttribute("var");
+ }
+
+ @Override
+ public void apply(FaceletContext ctx, UIComponent parent)
+ throws IOException, FacesException, ELException {
+ boolean b = this.test.getBoolean(ctx);
+ if (this.var != null) {
+ ctx.setAttribute(var.getValue(ctx), new Boolean(b));
+ }
+ if (b) {
+ this.nextHandler.apply(ctx, parent);
+ }
+ }
+
+}
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/WEB-INF/test.taglib.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/WEB-INF/test.taglib.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/WEB-INF/test.taglib.xml 2009-07-24
08:32:19 UTC (rev 16759)
@@ -0,0 +1,7 @@
+<!DOCTYPE facelet-taglib PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
+ "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
+
+<facelet-taglib>
+ <library-class>test.CoreLibrary</library-class>
+</facelet-taglib>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/WEB-INF/web.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/WEB-INF/web.xml 2009-07-24
01:55:20 UTC (rev 16758)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/WEB-INF/web.xml 2009-07-24
08:32:19 UTC (rev 16759)
@@ -18,6 +18,10 @@
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
+ <context-param>
+ <param-name>facelets.LIBRARIES</param-name>
+ <param-value>/WEB-INF/test.taglib.xml</param-value>
+ </context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/JavaSource/demo/FaceletFunctions.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/JavaSource/demo/FaceletFunctions.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/JavaSource/demo/FaceletFunctions.java 2009-07-24
08:32:19 UTC (rev 16759)
@@ -0,0 +1,27 @@
+package demo;
+
+/**
+ * @author mareshkau
+ */
+public class FaceletFunctions {
+
+ /**
+ * The private constructor.
+ */
+ private FaceletFunctions() {
+ super();
+
+ }
+
+ /**
+
+ */
+ public static String getStringForDisplay(String test) {
+ String rst = test;
+
+ return rst;
+ }
+
+
+
+}
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/JavaSource/demo/IfHandler.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/JavaSource/demo/IfHandler.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/JavaSource/demo/IfHandler.java 2009-07-24
08:32:19 UTC (rev 16759)
@@ -0,0 +1,48 @@
+/**
+ *
+ */
+package demo;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+
+import org.apache.taglibs.standard.lang.jstl.ELException;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.FaceletException;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagHandler;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class IfHandler extends TagHandler {
+ private final TagAttribute test;
+
+ private final TagAttribute var;
+
+ /**
+ * @param config
+ */
+ public IfHandler(TagConfig config) {
+ super(config);
+ this.test = this.getRequiredAttribute("test");
+ this.var = this.getAttribute("var");
+ }
+
+ @Override
+ public void apply(FaceletContext ctx, UIComponent parent)
+ throws IOException, FacesException, ELException {
+ boolean b = this.test.getBoolean(ctx);
+ if (this.var != null) {
+ ctx.setAttribute(var.getValue(ctx), new Boolean(b));
+ }
+ if (b) {
+ this.nextHandler.apply(ctx, parent);
+ }
+ }
+
+}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/tags/facelets.taglib.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/tags/facelets.taglib.xml 2009-07-24
01:55:20 UTC (rev 16758)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/tags/facelets.taglib.xml 2009-07-24
08:32:19 UTC (rev 16759)
@@ -11,7 +11,24 @@
<tag-name>paginator</tag-name>
<source>components/paginator.xhtml</source>
</tag>
+ <tag>
+ <tag-name>dropSupport</tag-name>
+ <component>
+ <component-type>org.richfaces.DropSupport</component-type>
+ <renderer-type>
+ org.richfaces.DropSupportRenderer
+ </renderer-type>
+ <handler-class>
+ demo.IfHandler
+ </handler-class>
+ </component>
+</tag>
<!-- <tag>-->
<!-- <tag-name>test1</tag-name>-->
<!-- </tag>-->
+ <function>
+ <function-name>getStringForDisplay</function-name>
+ <function-class>demo.FaceletFunctions</function-class>
+ <function-signature>java.lang.String
getStringForDisplay(java.lang.String)</function-signature>
+ </function>
</facelet-taglib>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-07-24
01:55:20 UTC (rev 16758)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-07-24
08:32:19 UTC (rev 16759)
@@ -92,7 +92,7 @@
public static Test suite() {
- TestSuite suite = new TestSuite("Tests for Vpe Jsf components");
//$NON-NLS-1$ //$NON-NLS-1$
+ TestSuite suite = new TestSuite("Tests for Vpe Jsf components");
//$NON-NLS-1$
// $JUnit-BEGIN$
suite.addTestSuite(JsfComponentTest.class);
suite.addTestSuite(Jsf20ComponentContentTest.class);
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4509Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4509Test.java 2009-07-24
01:55:20 UTC (rev 16758)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4509Test.java 2009-07-24
08:32:19 UTC (rev 16759)
@@ -78,6 +78,32 @@
"components/paginator.xhtml"); //$NON-NLS-1$
}
+ //test for <function-class>
+ public void testJBIDE4638OpenOnForFunctionClass() throws Throwable{
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
+ JsfAllTests.IMPORT_CUSTOM_FACELETS_PROJECT);
+ IFile file = (IFile)
project.findMember("WebContent/tags/facelets.taglib.xml"); //$NON-NLS-1$
+ IEditorInput editorInput = new FileEditorInput(file);
+ JBIDE4509Test.checkOpenOnInEditor(editorInput, getEditorId(file.getName()), 31, 37,
"FaceletFunctions.java"); //$NON-NLS-1$
+ }
+
+ //test for <function-class>
+ public void testJBIDE4638OpenOnForLibraryClass() throws Throwable{
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
+ JsfAllTests.IMPORT_JBIDE3247_PROJECT_NAME);
+ IFile file = (IFile)
project.findMember("WebContent/WEB-INF/test.taglib.xml"); //$NON-NLS-1$
+ IEditorInput editorInput = new FileEditorInput(file);
+ JBIDE4509Test.checkOpenOnInEditor(editorInput, getEditorId(file.getName()), 6, 25,
"CoreLibrary.java"); //$NON-NLS-1$
+ }
+ //test for <function-class>
+ public void testJBIDE4638OpenOnForHandlerClass() throws Throwable{
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
+ JsfAllTests.IMPORT_CUSTOM_FACELETS_PROJECT);
+ IFile file = (IFile)
project.findMember("WebContent/tags/facelets.taglib.xml"); //$NON-NLS-1$
+ IEditorInput editorInput = new FileEditorInput(file);
+ JBIDE4509Test.checkOpenOnInEditor(editorInput, getEditorId(file.getName()), 22, 23,
"IfHandler.java"); //$NON-NLS-1$
+ }
+
private static final void checkOpenOnInEditor(IEditorInput editorInput,String
editorId,int lineNumber, int lineOffset, String openedOnFileName) throws Throwable {
MultiPageEditorPart editorPart = (MultiPageEditorPart) PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getActivePage()