Author: vrubezhny
Date: 2012-01-31 12:27:20 -0500 (Tue, 31 Jan 2012)
New Revision: 38335
Modified:
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/CSSClassHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPBeanGetPropertyHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPBeanSetPropertyHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPClassHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPElementAttributeValueHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPElementHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPElementNameHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPForBeanIdHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPLinkHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPRelativeLinkHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPStylesheetRelLinkHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPTagAttributeHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPTagAttributeValueHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPTaglibHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPTextHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPXmlNsHyperlinkPartitioner.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/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/CSSClassHyperlinkPartitioner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/CSSClassHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/CSSClassHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
@@ -53,7 +53,7 @@
if (n == null || !(n instanceof Attr))
return null;
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = getPartitionType(axis);
Modified:
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPBeanGetPropertyHyperlinkPartitioner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPBeanGetPropertyHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPBeanGetPropertyHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
@@ -43,7 +43,7 @@
int end = Utils.getValueEnd(n);
if(start < 0) return null;
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = JSP_BEAN_GET_PROPERTY_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$
}
/**
Modified:
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPBeanSetPropertyHyperlinkPartitioner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPBeanSetPropertyHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPBeanSetPropertyHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
@@ -42,7 +42,7 @@
int start = Utils.getValueStart(n);
int end = Utils.getValueEnd(n);
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = JSP_BEAN_SET_PROPERTY_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$
}
/**
Modified:
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPClassHyperlinkPartitioner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPClassHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPClassHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
@@ -1,28 +1,23 @@
/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2007-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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ * Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.jboss.tools.jst.text.ext.hyperlink.jsp;
import org.eclipse.jface.text.IDocument;
-
-import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
import org.jboss.tools.common.text.ext.hyperlink.xml.XMLClassHyperlinkPartitioner;
/**
* @author Jeremy
*/
public class JSPClassHyperlinkPartitioner extends XMLClassHyperlinkPartitioner {
- 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/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPElementAttributeValueHyperlinkPartitioner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPElementAttributeValueHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPElementAttributeValueHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
@@ -1,28 +1,23 @@
/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2007-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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ * Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.jboss.tools.jst.text.ext.hyperlink.jsp;
import org.eclipse.jface.text.IDocument;
-
-import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
import
org.jboss.tools.common.text.ext.hyperlink.xml.XMLElementAttributeValueHyperlinkPartitioner;
/**
* @author Jeremy
*/
public class JSPElementAttributeValueHyperlinkPartitioner extends
XMLElementAttributeValueHyperlinkPartitioner {
- 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/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPElementHyperlinkPartitioner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPElementHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPElementHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
@@ -1,29 +1,23 @@
/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2007-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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ * Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.jboss.tools.jst.text.ext.hyperlink.jsp;
import org.eclipse.jface.text.IDocument;
-
-import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
import org.jboss.tools.common.text.ext.hyperlink.xml.XMLElementHyperlinkPartitioner;
/**
* @author Jeremy
*/
public class JSPElementHyperlinkPartitioner extends XMLElementHyperlinkPartitioner {
- 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/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPElementNameHyperlinkPartitioner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPElementNameHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPElementNameHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
@@ -25,11 +25,8 @@
* @author Jeremy
*/
public class JSPElementNameHyperlinkPartitioner extends
XMLElementNameHyperlinkPartitioner {
- 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/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPForBeanIdHyperlinkPartitioner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPForBeanIdHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPForBeanIdHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
@@ -40,7 +40,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_BEAN_ID_PARTITION;
@@ -50,11 +50,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/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPLinkHyperlinkPartitioner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPLinkHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPLinkHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
@@ -35,11 +35,8 @@
return true;
}
- 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 String getExclusionPartitionType() {
Modified:
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPRelativeLinkHyperlinkPartitioner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPRelativeLinkHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPRelativeLinkHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
@@ -34,10 +34,7 @@
return true;
}
- 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$
}
}
\ No newline at end of file
Modified:
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPStylesheetRelLinkHyperlinkPartitioner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPStylesheetRelLinkHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPStylesheetRelLinkHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
@@ -57,7 +57,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_STYLESHEET_REL_LINK_PARTITION;
@@ -144,11 +144,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$
}
protected IRegion getRegion (IDocument document, int offset) {
Modified:
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPTagAttributeHyperlinkPartitioner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPTagAttributeHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPTagAttributeHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
@@ -47,7 +47,7 @@
int end = Utils.getValueEnd(n);
if(start < 0) return null;
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = JSP_TAG_ATTRIBUTE_PARTITION;
@@ -78,11 +78,4 @@
smw.dispose();
}
}
-
- 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();
- }
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPTagAttributeValueHyperlinkPartitioner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPTagAttributeValueHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPTagAttributeValueHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
@@ -1,30 +1,24 @@
/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2007-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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ * Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.jboss.tools.jst.text.ext.hyperlink.jsp;
import org.eclipse.jface.text.IDocument;
-
import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkPartitionRecognizer;
-import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
import
org.jboss.tools.common.text.ext.hyperlink.xml.XMLTagAttributeValueHyperlinkPartitioner;
/**
* @author Jeremy
*/
public abstract class JSPTagAttributeValueHyperlinkPartitioner extends
XMLTagAttributeValueHyperlinkPartitioner implements IHyperlinkPartitionRecognizer {
- 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/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPTaglibHyperlinkPartitioner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPTaglibHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPTaglibHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
@@ -47,7 +47,7 @@
int end = Utils.getValueEnd(n);
if(start < 0) return null;
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = JSP_TAGLIB_PARTITION;
@@ -76,11 +76,4 @@
smw.dispose();
}
}
-
- 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();
- }
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPTextHyperlinkPartitioner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPTextHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPTextHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
@@ -1,29 +1,23 @@
/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2007-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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ * Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.jboss.tools.jst.text.ext.hyperlink.jsp;
import org.eclipse.jface.text.IDocument;
-
-import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
import org.jboss.tools.common.text.ext.hyperlink.xml.XMLTextHyperlinkPartitioner;
/**
* @author Jeremy
*/
public class JSPTextHyperlinkPartitioner extends XMLTextHyperlinkPartitioner {
- 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/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPXmlNsHyperlinkPartitioner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPXmlNsHyperlinkPartitioner.java 2012-01-31
17:26:29 UTC (rev 38334)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPXmlNsHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
@@ -47,7 +47,7 @@
Element rootElem = xmlnsAttr.getOwnerElement();
if (!(rootElem.getNodeName().equals("jsp:root") ||
rootElem.getNodeName().equalsIgnoreCase("html"))) return null; //$NON-NLS-1$
//$NON-NLS-2$
String xmlns = xmlnsAttr.getValueRegionText();
- String axis = getAxis(document, superRegion);
+ String axis = getAxis(document, offset);
String contentType = superRegion.getContentType();
String type = JSP_XMLNS_PARTITION;
int start = Utils.getValueStart(xmlnsAttr);
@@ -105,10 +105,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$
}
}