Author: vrubezhny
Date: 2012-01-31 12:26:29 -0500 (Tue, 31 Jan 2012)
New Revision: 38334
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPConverterHyperlinkPartitioner.java
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/JSPForwardHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPLoadBundleHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPNavigationCaseHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPValidatorHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagAttributeHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagNameHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/XMLBundleBasenameHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/XMLConverterHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/XMLPropertyHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/XMLRenderKitHyperlinkPartitioner.java
Log:
JBIDE-10621
Redesign HyperlinkDetector so that partitioning and hyperlinks not do twice the same job.
Hyperlinks and Hyperlink Partitioners are redesigned due to exclude duplication work on
regions calculation.
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPConverterHyperlinkPartitioner.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPConverterHyperlinkPartitioner.java 2012-01-31
17:25:19 UTC (rev 38333)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPConverterHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
@@ -45,7 +45,7 @@
IHyperlinkRegion r = getRegion(document, offset);
if (r == null) return null;
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = JSP_CONVERTER_PARTITION;
@@ -55,11 +55,8 @@
}
}
- protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
- if (superRegion.getAxis() == null || superRegion.getAxis().length() == 0) {
- return JSPRootHyperlinkPartitioner.computeAxis(document, superRegion.getOffset()) +
"/"; //$NON-NLS-1$
- }
- return superRegion.getAxis();
+ protected String getAxis(IDocument document, int offset) {
+ return JSPRootHyperlinkPartitioner.computeAxis(document, offset) + "/";
//$NON-NLS-1$
}
public static IHyperlinkRegion getRegion(IDocument document, final int offset) {
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 2012-01-31
17:25:19 UTC (rev 38333)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPForIDHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
@@ -43,7 +43,7 @@
IHyperlinkRegion r = getRegion(document, offset);
if (r == null) return null;
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = JSP_FOR_ID_PARTITION;
@@ -53,11 +53,8 @@
}
}
- protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
- if (superRegion.getAxis() == null || superRegion.getAxis().length() == 0) {
- return JSPRootHyperlinkPartitioner.computeAxis(document, superRegion.getOffset()) +
"/"; //$NON-NLS-1$
- }
- return superRegion.getAxis();
+ protected String getAxis(IDocument document, int offset) {
+ return JSPRootHyperlinkPartitioner.computeAxis(document, offset) + "/";
//$NON-NLS-1$
}
public static IHyperlinkRegion getRegion(IDocument document, final int offset) {
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPForwardHyperlinkPartitioner.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPForwardHyperlinkPartitioner.java 2012-01-31
17:25:19 UTC (rev 38333)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPForwardHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
@@ -44,7 +44,7 @@
IHyperlinkRegion r = getRegion(document, offset);
if (r == null) return null;
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = JSP_FORWARD_PARTITION;
@@ -54,11 +54,8 @@
}
}
- protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
- if (superRegion.getAxis() == null || superRegion.getAxis().length() == 0) {
- return JSPRootHyperlinkPartitioner.computeAxis(document, superRegion.getOffset()) +
"/"; //$NON-NLS-1$
- }
- return superRegion.getAxis();
+ protected String getAxis(IDocument document, int offset) {
+ return JSPRootHyperlinkPartitioner.computeAxis(document, offset) + "/";
//$NON-NLS-1$
}
public static IHyperlinkRegion getRegion(IDocument document, final int offset) {
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPLoadBundleHyperlinkPartitioner.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPLoadBundleHyperlinkPartitioner.java 2012-01-31
17:25:19 UTC (rev 38333)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPLoadBundleHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
@@ -50,7 +50,7 @@
IHyperlinkRegion r = getRegion(document, offset);
if (r == null) return null;
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = getPartitionType();
@@ -60,11 +60,8 @@
}
}
- protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
- if (superRegion.getAxis() == null || superRegion.getAxis().length() == 0) {
- return JSPRootHyperlinkPartitioner.computeAxis(document, superRegion.getOffset()) +
"/"; //$NON-NLS-1$
- }
- return superRegion.getAxis();
+ protected String getAxis(IDocument document, int offset) {
+ return JSPRootHyperlinkPartitioner.computeAxis(document, offset) + "/";
//$NON-NLS-1$
}
public static IHyperlinkRegion getRegion(IDocument document, final int offset) {
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPNavigationCaseHyperlinkPartitioner.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPNavigationCaseHyperlinkPartitioner.java 2012-01-31
17:25:19 UTC (rev 38333)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPNavigationCaseHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
@@ -42,7 +42,7 @@
IHyperlinkRegion r = getRegion(document, offset);
if (r == null) return null;
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = JSP_NAVIGATION_CASE_PARTITION;
@@ -52,11 +52,8 @@
}
}
- protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
- if (superRegion.getAxis() == null || superRegion.getAxis().length() == 0) {
- return JSPRootHyperlinkPartitioner.computeAxis(document, superRegion.getOffset()) +
"/"; //$NON-NLS-1$
- }
- return superRegion.getAxis();
+ protected String getAxis(IDocument document, int offset) {
+ return JSPRootHyperlinkPartitioner.computeAxis(document, offset) + "/";
//$NON-NLS-1$
}
public static IHyperlinkRegion getRegion(IDocument document, final int offset) {
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPValidatorHyperlinkPartitioner.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPValidatorHyperlinkPartitioner.java 2012-01-31
17:25:19 UTC (rev 38333)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPValidatorHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
@@ -44,7 +44,7 @@
IRegion r = getRegion(document, offset);
if (r == null) return null;
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = JSP_VALIDATOR_PARTITION;
@@ -54,11 +54,8 @@
}
}
- protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
- if (superRegion.getAxis() == null || superRegion.getAxis().length() == 0) {
- return JSPRootHyperlinkPartitioner.computeAxis(document, superRegion.getOffset()) +
"/"; //$NON-NLS-1$
- }
- return superRegion.getAxis();
+ protected String getAxis(IDocument document, int offset) {
+ return JSPRootHyperlinkPartitioner.computeAxis(document, offset) + "/";
//$NON-NLS-1$
}
public static IRegion getRegion(IDocument document, final int offset) {
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagAttributeHyperlinkPartitioner.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagAttributeHyperlinkPartitioner.java 2012-01-31
17:25:19 UTC (rev 38333)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagAttributeHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
@@ -56,7 +56,7 @@
IRegion r = getRegion(document, offset);
if (r == null) return null;
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = JSF_JSP_TAG_ATTRIBUTE_PARTITION;
@@ -144,10 +144,7 @@
}
}
- protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
- if (superRegion.getAxis() == null || superRegion.getAxis().length() == 0) {
- return JSPRootHyperlinkPartitioner.computeAxis(document, superRegion.getOffset()) +
"/"; //$NON-NLS-1$
- }
- return superRegion.getAxis();
+ protected String getAxis(IDocument document, int offset) {
+ return JSPRootHyperlinkPartitioner.computeAxis(document, offset) + "/";
//$NON-NLS-1$
}
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagNameHyperlinkPartitioner.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagNameHyperlinkPartitioner.java 2012-01-31
17:25:19 UTC (rev 38333)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagNameHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
@@ -54,7 +54,7 @@
IRegion r = getRegion(document, offset);
if (r == null) return null;
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = JSF_JSP_TAG_NAME_PARTITION;
@@ -120,10 +120,7 @@
}
}
- protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
- if (superRegion.getAxis() == null || superRegion.getAxis().length() == 0) {
- return JSPRootHyperlinkPartitioner.computeAxis(document, superRegion.getOffset()) +
"/"; //$NON-NLS-1$
- }
- return superRegion.getAxis();
+ protected String getAxis(IDocument document, int offset) {
+ return JSPRootHyperlinkPartitioner.computeAxis(document, offset) + "/";
//$NON-NLS-1$
}
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/XMLBundleBasenameHyperlinkPartitioner.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/XMLBundleBasenameHyperlinkPartitioner.java 2012-01-31
17:25:19 UTC (rev 38333)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/XMLBundleBasenameHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
@@ -41,7 +41,7 @@
IHyperlinkRegion r = getRegion(document, offset);
if (r == null) return null;
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = XML_BUNDLE_BASENAME_PARTITION;
@@ -51,14 +51,14 @@
}
}
- protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
+ protected String getAxis(IDocument document, int offset) {
StructuredModelWrapper smw = new StructuredModelWrapper();
smw.init(document);
try {
Document xmlDocument = smw.getDocument();
if (xmlDocument == null) return null;
- Node n = Utils.findNodeForOffset(xmlDocument, superRegion.getOffset());
+ Node n = Utils.findNodeForOffset(xmlDocument, offset);
return Utils.getParentAxisForNode(xmlDocument, n);
} finally {
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/XMLConverterHyperlinkPartitioner.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/XMLConverterHyperlinkPartitioner.java 2012-01-31
17:25:19 UTC (rev 38333)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/XMLConverterHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
@@ -41,7 +41,7 @@
IHyperlinkRegion r = getRegion(document, offset);
if (r == null) return null;
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = XML_CONVERTER_PARTITION;
@@ -51,14 +51,14 @@
}
}
- protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
+ protected String getAxis(IDocument document, int offset) {
StructuredModelWrapper smw = new StructuredModelWrapper();
smw.init(document);
try {
Document xmlDocument = smw.getDocument();
if (xmlDocument == null) return null;
- Node n = Utils.findNodeForOffset(xmlDocument, superRegion.getOffset());
+ Node n = Utils.findNodeForOffset(xmlDocument, offset);
return Utils.getParentAxisForNode(xmlDocument, n);
} finally {
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/XMLPropertyHyperlinkPartitioner.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/XMLPropertyHyperlinkPartitioner.java 2012-01-31
17:25:19 UTC (rev 38333)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/XMLPropertyHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
@@ -42,7 +42,7 @@
IHyperlinkRegion r = getRegion(document, offset);
if (r == null) return null;
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = XML_PROPERTY_PARTITION;
@@ -52,14 +52,14 @@
}
}
- protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
+ protected String getAxis(IDocument document, int offset) {
StructuredModelWrapper smw = new StructuredModelWrapper();
smw.init(document);
try {
Document xmlDocument = smw.getDocument();
if(xmlDocument == null) return null;
- Node n = Utils.findNodeForOffset(xmlDocument, superRegion.getOffset());
+ Node n = Utils.findNodeForOffset(xmlDocument, offset);
return Utils.getParentAxisForNode(xmlDocument, n);
} finally {
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/XMLRenderKitHyperlinkPartitioner.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/XMLRenderKitHyperlinkPartitioner.java 2012-01-31
17:25:19 UTC (rev 38333)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/XMLRenderKitHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
@@ -42,7 +42,7 @@
IHyperlinkRegion r = getRegion(document, offset);
if (r == null) return null;
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = XML_RENDER_KIT_PARTITION;
@@ -52,12 +52,12 @@
}
}
- protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
+ protected String getAxis(IDocument document, int offset) {
StructuredModelWrapper smw = new StructuredModelWrapper();
smw.init(document);
try {
Document xmlDocument = smw.getDocument();
- Node n = Utils.findNodeForOffset(xmlDocument, superRegion.getOffset());
+ Node n = Utils.findNodeForOffset(xmlDocument, offset);
return Utils.getParentAxisForNode(xmlDocument, n);
} finally {
smw.dispose();