Author: vrubezhny
Date: 2012-01-31 12:27:46 -0500 (Tue, 31 Jan 2012)
New Revision: 38336
Modified:
trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/hyperlink/StrutsActionHyperlinkPartitioner.java
trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/hyperlink/StrutsActionMappingHyperlinkPartitioner.java
trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/hyperlink/StrutsJSPTagAttributeHyperlinkPartitioner.java
trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/hyperlink/StrutsJSPTagNameHyperlinkPartitioner.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/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/hyperlink/StrutsActionHyperlinkPartitioner.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/hyperlink/StrutsActionHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
+++
trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/hyperlink/StrutsActionHyperlinkPartitioner.java 2012-01-31
17:27:46 UTC (rev 38336)
@@ -1,12 +1,12 @@
/*******************************************************************************
- * 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.struts.text.ext.hyperlink;
@@ -16,8 +16,6 @@
/**
* @author Jeremy
*
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
*/
public class StrutsActionHyperlinkPartitioner extends
JSPTagAttributeValueHyperlinkPartitioner {
public static final String STRUTS_JSP_ACTION_PARTITION =
"org.jboss.tools.common.text.ext.jsp.STRUTS_JSP_ACTION";
Modified:
trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/hyperlink/StrutsActionMappingHyperlinkPartitioner.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/hyperlink/StrutsActionMappingHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
+++
trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/hyperlink/StrutsActionMappingHyperlinkPartitioner.java 2012-01-31
17:27:46 UTC (rev 38336)
@@ -1,12 +1,12 @@
/*******************************************************************************
- * 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.struts.text.ext.hyperlink;
@@ -16,8 +16,6 @@
/**
* @author Jeremy
*
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
*/
public class StrutsActionMappingHyperlinkPartitioner extends
JSPTagAttributeValueHyperlinkPartitioner {
public static final String STRUTS_JSP_ACTION_MAPPING_PARTITION =
"org.jboss.tools.common.text.ext.jsp.STRUTS_JSP_ACTION_MAPPING";
Modified:
trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/hyperlink/StrutsJSPTagAttributeHyperlinkPartitioner.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/hyperlink/StrutsJSPTagAttributeHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
+++
trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/hyperlink/StrutsJSPTagAttributeHyperlinkPartitioner.java 2012-01-31
17:27:46 UTC (rev 38336)
@@ -21,9 +21,9 @@
import org.jboss.tools.common.text.ext.hyperlink.HyperlinkRegion;
import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkPartitionRecognizer;
import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
-import org.jboss.tools.jst.text.ext.hyperlink.jsp.JSPRootHyperlinkPartitioner;
import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
import org.jboss.tools.common.text.ext.util.Utils;
+import org.jboss.tools.jst.text.ext.hyperlink.jsp.JSPRootHyperlinkPartitioner;
import org.jboss.tools.struts.StrutsProject;
import org.jboss.tools.struts.text.ext.StrutsExtensionsPlugin;
import org.w3c.dom.Attr;
@@ -53,7 +53,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 = STRUTS_JSP_TAG_ATTRIBUTE_PARTITION;
@@ -162,10 +162,7 @@
}
}
- protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
- if (superRegion.getAxis() == null || superRegion.getAxis().length() == 0) {
- return JSPRootHyperlinkPartitioner.computeAxis(document, superRegion.getOffset()) +
"/";
- }
- return superRegion.getAxis();
+ protected String getAxis(IDocument document, int offset) {
+ return JSPRootHyperlinkPartitioner.computeAxis(document, offset) + "/";
}
}
Modified:
trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/hyperlink/StrutsJSPTagNameHyperlinkPartitioner.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/hyperlink/StrutsJSPTagNameHyperlinkPartitioner.java 2012-01-31
17:27:20 UTC (rev 38335)
+++
trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/hyperlink/StrutsJSPTagNameHyperlinkPartitioner.java 2012-01-31
17:27:46 UTC (rev 38336)
@@ -51,7 +51,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 = STRUTS_JSP_TAG_NAME_PARTITION;
@@ -112,10 +112,7 @@
}
- protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
- if (superRegion.getAxis() == null || superRegion.getAxis().length() == 0) {
- return JSPRootHyperlinkPartitioner.computeAxis(document, superRegion.getOffset()) +
"/";
- }
- return superRegion.getAxis();
+ protected String getAxis(IDocument document, int offset) {
+ return JSPRootHyperlinkPartitioner.computeAxis(document, offset) + "/";
}
}