Author: vrubezhny
Date: 2009-05-07 09:37:00 -0400 (Thu, 07 May 2009)
New Revision: 15107
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPRootHyperlinkPartitioner.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLRootHyperlinkPartitioner.java
Log:
JBIDE-1739 OpenOn for JSF components' atributes used with the help of 'jsfc'
The 'jsfc' tag attribute is taken into account while calculating open-ons.
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPRootHyperlinkPartitioner.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPRootHyperlinkPartitioner.java 2009-05-07
12:32:40 UTC (rev 15106)
+++
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPRootHyperlinkPartitioner.java 2009-05-07
13:37:00 UTC (rev 15107)
@@ -75,13 +75,36 @@
if (n != null) {
if ((n instanceof Element || n instanceof Attr) &&
n.getNodeName() != null && n.getNodeName().length() > 0) {
- String nodeName = extractName(n.getNodeName(), trackersMap, tm);
+
+ String name = n.getNodeName();
+
+ // The node name extraction must be done by taking into account 'jsfc'
attribute value
+ if (n instanceof Element) {
+ Element e = (Element)n;
+ String jsfcAttrValue = e.getAttribute("jsfc");
+ if (jsfcAttrValue != null && jsfcAttrValue.trim().length() > 0) {
+ name = jsfcAttrValue;
+ }
+ }
+
+ String nodeName = extractName(name, trackersMap, tm);
axis = "/" + nodeName;
}
Node parent = (n instanceof Attr)? ((Attr)n).getOwnerElement() : n.getParentNode();
while (parent instanceof Element) {
// Get the axis part depending on the type and name of node
- String nodeName = extractName(parent.getNodeName(), trackersMap, tm);
+ String name = parent.getNodeName();
+
+ // The node name extraction must be done by taking into account 'jsfc'
attribute value
+ if (parent instanceof Element) {
+ Element e = (Element)parent;
+ String jsfcAttrValue = e.getAttribute("jsfc");
+ if (jsfcAttrValue != null && jsfcAttrValue.trim().length() > 0) {
+ name = jsfcAttrValue;
+ }
+ }
+
+ String nodeName = extractName(name, trackersMap, tm);
if (nodeName != null && nodeName.length() > 0)
axis = "/" + nodeName + axis;
parent = parent.getParentNode();
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLRootHyperlinkPartitioner.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLRootHyperlinkPartitioner.java 2009-05-07
12:32:40 UTC (rev 15106)
+++
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLRootHyperlinkPartitioner.java 2009-05-07
13:37:00 UTC (rev 15107)
@@ -62,13 +62,35 @@
if (n != null) {
if ((n instanceof Element || n instanceof Attr) &&
n.getNodeName() != null && n.getNodeName().length() > 0) {
- String nodeName = extractName(n.getNodeName(), trackersMap);
+ String name = n.getNodeName();
+
+ // The node name extraction must be done by taking into account 'jsfc'
attribute value
+ if (n instanceof Element) {
+ Element e = (Element)n;
+ String jsfcAttrValue = e.getAttribute("jsfc");
+ if (jsfcAttrValue != null && jsfcAttrValue.trim().length() > 0) {
+ name = jsfcAttrValue;
+ }
+ }
+
+ String nodeName = extractName(name, trackersMap);
axis = "/" + nodeName;
}
Node parent = (n instanceof Attr)? ((Attr)n).getOwnerElement():n.getParentNode();
while (parent instanceof Element) {
// Get the axis part depending on the type and name of node
- String nodeName = extractName(parent.getNodeName(), trackersMap);
+ String name = parent.getNodeName();
+
+ // The node name extraction must be done by taking into account 'jsfc'
attribute value
+ if (parent instanceof Element) {
+ Element e = (Element)parent;
+ String jsfcAttrValue = e.getAttribute("jsfc");
+ if (jsfcAttrValue != null && jsfcAttrValue.trim().length() > 0) {
+ name = jsfcAttrValue;
+ }
+ }
+
+ String nodeName = extractName(name, trackersMap);
if (nodeName != null && nodeName.length() > 0)
axis = "/" + nodeName + axis;
parent = parent.getParentNode();