Author: vrubezhny
Date: 2009-04-21 13:40:55 -0400 (Tue, 21 Apr 2009)
New Revision: 14836
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/plugin.xml
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ForIDHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPForIDHyperlinkPartitioner.java
Log:
JBIDE-3570 Create Open-Ons for "ForID"-like attributes in RichFaces
The hyperlinks for the "ForID"-like attributes are created.
The hyperlinks for the "converter"-like attributes are created.
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ForIDHyperlink.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ForIDHyperlink.java 2009-04-21
12:22:50 UTC (rev 14835)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ForIDHyperlink.java 2009-04-21
17:40:55 UTC (rev 14836)
@@ -18,6 +18,8 @@
import org.eclipse.jface.text.Region;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
+import org.jboss.tools.common.text.ext.hyperlink.HyperlinkRegion;
+import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
import org.jboss.tools.common.text.ext.util.StructuredSelectionHelper;
@@ -169,8 +171,56 @@
final int propLength = bEnd - bStart;
if (propStart > offset || propStart + propLength < offset) return null;
-
- return new Region(propStart,propLength);
+
+ // Find an ID (suppose that there may be a list of commas-separated IDs)
+ int bIdStart = offset;
+ int bIdEnd = offset;
+
+ //find start of bean property
+ while (bIdStart >= propStart) {
+ if (!Character.isJavaIdentifierPart(sb.charAt(bIdStart - start)) &&
+ sb.charAt(bIdStart - start) != ' ') {
+ bIdStart++;
+ break;
+ }
+
+ if (bIdStart == 0) break;
+ bIdStart--;
+ }
+ // find end of bean property
+ while (bIdEnd < propStart + propLength) {
+ if (!Character.isJavaIdentifierPart(sb.charAt(bIdEnd - start)) &&
+ sb.charAt(bIdEnd - start) != ' ')
+ break;
+ bIdEnd++;
+ }
+
+ // Skip leading spaces
+ while (bIdStart < bIdEnd) {
+ if (Character.isJavaIdentifierPart(sb.charAt(bIdStart - start))) {
+ break;
+ }
+
+ bIdStart++;
+ }
+
+ // Skip trailing spaces
+ while (bIdEnd > bIdStart) {
+ if (Character.isJavaIdentifierPart(sb.charAt(bIdEnd - 1 - start))) {
+ break;
+ }
+
+ bIdEnd--;
+ }
+
+ int idStart = bIdStart;
+ int idLength = bIdEnd - bIdStart;
+
+ if (idStart > offset || idStart + idLength < offset) return null;
+
+
+
+ return new Region(idStart,idLength);
} catch (BadLocationException x) {
JSFExtensionsPlugin.log("", x);
return null;
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPForIDHyperlinkPartitioner.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPForIDHyperlinkPartitioner.java 2009-04-21
12:22:50 UTC (rev 14835)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPForIDHyperlinkPartitioner.java 2009-04-21
17:40:55 UTC (rev 14836)
@@ -103,9 +103,60 @@
int propStart = bStart + start;
int propLength = bEnd - bStart;
+
if (propStart > offset || propStart + propLength < offset) return null;
-
- IHyperlinkRegion region = new HyperlinkRegion(propStart, propLength, null, null,
null);
+
+ // Find an ID (suppose that there may be a list of commas-separated IDs)
+ int bIdStart = offset;
+ int bIdEnd = offset;
+
+ //find start of bean property
+ while (bIdStart >= propStart) {
+ if (!Character.isJavaIdentifierPart(sb.charAt(bIdStart - start)) &&
+ sb.charAt(bIdStart - start) != ' ') {
+ bIdStart++;
+ break;
+ }
+
+ if (bIdStart == 0) break;
+ bIdStart--;
+ }
+
+ // find end of bean property
+ while (bIdEnd < propStart + propLength) {
+ if (!Character.isJavaIdentifierPart(sb.charAt(bIdEnd - start)) &&
+ sb.charAt(bIdEnd - start) != ' ')
+ break;
+ bIdEnd++;
+ }
+
+ // Skip leading spaces
+ while (bIdStart < bIdEnd) {
+ if (Character.isJavaIdentifierPart(sb.charAt(bIdStart - start))) {
+ break;
+ }
+
+ bIdStart++;
+ }
+
+ // Skip trailing spaces
+ while (bIdEnd > bIdStart) {
+ if (Character.isJavaIdentifierPart(sb.charAt(bIdEnd - 1 - start))) {
+ break;
+ }
+
+ bIdEnd--;
+ }
+
+
+ int idStart = bIdStart;
+ int idLength = bIdEnd - bIdStart;
+
+ if (idStart > offset || idStart + idLength < offset) return null;
+
+
+
+ IHyperlinkRegion region = new HyperlinkRegion(idStart, idLength, null, null, null);
return region;
} catch (BadLocationException x) {
JSFExtensionsPlugin.log("", x);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/plugin.xml 2009-04-21
12:22:50 UTC (rev 14835)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/plugin.xml 2009-04-21
17:40:55 UTC (rev 14836)
@@ -196,6 +196,124 @@
</contentType>
</hyperlinkPartitioner>
+ <hyperlinkPartitioner
+
id="org.jboss.tools.common.text.ext.jsf.hyperlink.JSPForIDHyperlinkPartitioner"
+
class="org.jboss.tools.jsf.text.ext.hyperlink.JSPForIDHyperlinkPartitioner">
+ <contentType id="org.eclipse.jst.jsp.core.jspsource">
+ <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
+ <axis
path="*/[http://richfaces.org/a4j]:*/focus/" />
+ <axis
path="*/[https://ajax4jsf.dev.java.net/ajax]:*/focus/"
/>
+ <axis
path="*/[http://richfaces.org/rich]:*/focus/" />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/focus/"
/>
+
+ <axis
path="*/[http://richfaces.org/a4j]:*/reRender/" />
+ <axis
path="*/[https://ajax4jsf.dev.java.net/ajax]:*/reRender/"
/>
+ <axis
path="*/[http://richfaces.org/rich]:*/reRender/" />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/reRender/"
/>
+
+ <axis
path="*/[http://richfaces.org/a4j]:*/status/" />
+ <axis
path="*/[https://ajax4jsf.dev.java.net/ajax]:*/status/"
/>
+ <axis
path="*/[http://richfaces.org/rich]:*/status/" />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/status/"
/>
+
+ <axis
path="*/[http://richfaces.org/a4j]:*/for/" />
+ <axis
path="*/[https://ajax4jsf.dev.java.net/ajax]:*/for/"
/>
+ <axis
path="*/[http://richfaces.org/rich]:*/for/" />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/for/"
/>
+
+ <axis
path="*/[http://richfaces.org/rich]:effect/targetId/"
/>
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:effect/targetId/" />
+
+ <axis
path="*/[http://richfaces.org/rich]:toggleControl/panelId/" />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:toggleControl/panelId/&... />
+
+ <axis
path="*/[http://richfaces.org/rich]:*/dragIndicator/"
/>
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/dragIndicator/" />
+
+ <axis
path="*/[http://richfaces.org/rich]:*/process/" />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/process/"
/>
+
+ <axis
path="*/[http://richfaces.org/rich]:*/similarityGroupingId/" />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/similarityGroupingId/... />
+
+ <axis
path="*/[http://richfaces.org/rich]:progressBar/reRenderAfterComplet... />
+
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:componentControl/attach... />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:contextMenu/attachTo/&q... />
+ </partitionType>
+ </contentType>
+ <contentType id="org.eclipse.wst.html.core.htmlsource">
+ <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
+ <axis
path="*/[http://richfaces.org/a4j]:*/focus/" />
+ <axis
path="*/[https://ajax4jsf.dev.java.net/ajax]:*/focus/"
/>
+ <axis
path="*/[http://richfaces.org/rich]:*/focus/" />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/focus/"
/>
+
+ <axis
path="*/[http://richfaces.org/a4j]:*/reRender/" />
+ <axis
path="*/[https://ajax4jsf.dev.java.net/ajax]:*/reRender/"
/>
+ <axis
path="*/[http://richfaces.org/rich]:*/reRender/" />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/reRender/"
/>
+
+ <axis
path="*/[http://richfaces.org/a4j]:*/status/" />
+ <axis
path="*/[https://ajax4jsf.dev.java.net/ajax]:*/status/"
/>
+ <axis
path="*/[http://richfaces.org/rich]:*/status/" />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/status/"
/>
+
+ <axis
path="*/[http://richfaces.org/a4j]:*/for/" />
+ <axis
path="*/[https://ajax4jsf.dev.java.net/ajax]:*/for/"
/>
+ <axis
path="*/[http://richfaces.org/rich]:*/for/" />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/for/"
/>
+
+ <axis
path="*/[http://richfaces.org/rich]:effect/targetId/"
/>
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:effect/targetId/" />
+
+ <axis
path="*/[http://richfaces.org/rich]:toggleControl/panelId/" />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:toggleControl/panelId/&... />
+
+ <axis
path="*/[http://richfaces.org/rich]:*/dragIndicator/"
/>
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/dragIndicator/" />
+
+ <axis
path="*/[http://richfaces.org/rich]:*/process/" />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/process/"
/>
+
+ <axis
path="*/[http://richfaces.org/rich]:*/similarityGroupingId/" />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/similarityGroupingId/... />
+
+ <axis
path="*/[http://richfaces.org/rich]:progressBar/reRenderAfterComplet... />
+
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:componentControl/attach... />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:contextMenu/attachTo/&q... />
+ </partitionType>
+ </contentType>
+ </hyperlinkPartitioner>
+
+ <hyperlinkPartitioner
+
id="org.jboss.tools.common.text.ext.jsf.hyperlink.JSPConverterHyperlinkPartitioner"
+
class="org.jboss.tools.jsf.text.ext.hyperlink.JSPConverterHyperlinkPartitioner">
+ <contentType id="org.eclipse.jst.jsp.core.jspsource">
+ <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
+ <axis
path="*/[http://richfaces.org/a4j]:*/converter/" />
+ <axis
path="*/[https://ajax4jsf.dev.java.net/ajax]:*/converter/"
/>
+ <axis
path="*/[http://richfaces.org/rich]:*/converter/" />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/converter/"
/>
+
+ <axis
path="*/[http://richfaces.org/rich]:*/rowKeyConverter/"
/>
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/rowKeyConverter/" />
+ </partitionType>
+ </contentType>
+ <contentType id="org.eclipse.wst.html.core.htmlsource">
+ <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
+ <axis
path="*/[http://richfaces.org/a4j]:*/converter/" />
+ <axis
path="*/[https://ajax4jsf.dev.java.net/ajax]:*/converter/"
/>
+ <axis
path="*/[http://richfaces.org/rich]:*/converter/" />
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/converter/"
/>
+
+ <axis
path="*/[http://richfaces.org/rich]:*/rowKeyConverter/"
/>
+ <axis
path="*/[http://richfaces.ajax4jsf.org/rich]:*/rowKeyConverter/" />
+ </partitionType>
+ </contentType>
+ </hyperlinkPartitioner>
+
</extension>
<extension