Author: vrubezhny
Date: 2011-10-12 12:58:31 -0400 (Wed, 12 Oct 2011)
New Revision: 35578
Added:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-5385/
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-5385/jbide5385.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-5385/main.css
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSPStylesheetRelLinkHyperlinkTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JsfTextExtAllTests.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/JSPStylesheetRelLinkHyperlinkPartitioner.java
Log:
JBIDE-5385 Incorrect openOn region for tag link when href attribute have el expression
Issue is fixed. JUnit Test is added.
Added:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-5385/jbide5385.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-5385/jbide5385.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-5385/jbide5385.xhtml 2011-10-12
16:58:31 UTC (rev 35578)
@@ -0,0 +1,276 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:a4j="http://richfaces.org/a4j">
+<f:loadBundle var="msg"
basename="dataTable.columns.messages"/>
+<f:loadBundle var="message"
basename="extendedDataTable.messages"/>
+
+<link rel="stylesheet"
href="${facesContext.externalContext.requestContextPath}/JBIDE-5385/main.css"
+type="text/css"/>
+ <a4j:form>
+ <rich:panel style="width : 1087px; height : 4012px;"
styleClass="btn">
+ <f:facet name="header">
+ <h:outputText value="Main Table"/>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="End of components" />
+ </f:facet>
+ <table>
+ <tr>
+ <td width="30%">Component</td>
+ <td align="center" style="background-color: black; font: bold;
color: white;">Problems</td>
+ </tr>
+ <tr>
+ <td>
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Tooltip" />
+ </f:facet>
+ <h:panelGrid columns="2">
+ <rich:panel id="sample1" styleClass="tooltip-text"
bodyClass="rich-laguna-panel-no-header">
+ <p>
+ Here you can see <b>default client-side</b> tool-tip
+ </p>
+ <rich:toolTip>
+ <span style="white-space:nowrap">
+ This tool-tip content was <strong>pre-rendered</strong>
to the page.<br/>
+ The look of this tool-tip is 100% defined by skin.
+ </span>
+ </rich:toolTip>
+ </rich:panel>
+ <rich:panel id="sample2" styleClass="tooltip-text"
bodyClass="rich-laguna-panel-no-header">
+ <p>
+ This tool-tip will <b>follow mouse</b>. Also this tool-tip
has a <b>delay 0.5 sec</b>,
+ so be patient!
+ </p>
+ <rich:toolTip followMouse="true"
direction="top-right" showDelay="500"
styleClass="tooltip">
+ <span style="white-space:nowrap">
+ This tool-tip content also
<strong>pre-rendered</strong> to the page.<br/>
+ However, the look of this tool-tip is customized<br/>
+ by styleClass attribute.
+ </span>
+ </rich:toolTip>
+ </rich:panel>
+ <h:form>
+ <rich:panel id="sample3" styleClass="tooltip-text"
bodyClass="rich-laguna-panel-no-header">
+ <p>
+ This tool-tip rendered on server <b>in separate
request</b>.
+ </p>
+ <rich:toolTip direction="top-right" mode="ajax"
styleClass="tooltip" layout="block">
+ <f:facet name="defaultContent">
+ <strong>Wait...</strong>
+ </f:facet>
+ <span style="white-space:nowrap">This tool-tip
content was <strong>rendered on server</strong>
+ </span>
+ <h:panelGrid columns="2">
+ <h:outputText style="white-space:nowrap"
value="tooltips requested:" />
+ <h:outputText value="#{toolTipData.tooltipCounter}"
styleClass="tooltipData" />
+ </h:panelGrid>
+ </rich:toolTip>
+ </rich:panel>
+ </h:form>
+ <h:form>
+ <rich:panel id="sample4" styleClass="tooltip-text"
bodyClass="rich-laguna-panel-no-header">
+ <p>
+ This tool-tip will be <b>activated on mouse click</b>. It
also has a <b>bottom-left</b> position.
+ </p>
+ <rich:toolTip showEvent="onclick"
direction="bottom-left" mode="ajax" styleClass="tooltip"
layout="block">
+ <f:facet name="defaultContent">
+ <strong>Wait...</strong>
+ </f:facet>
+ <span style="white-space:nowrap">This tool-tip
content was <strong>rendered on server</strong><br/></span>
+ <h:panelGrid columns="2">
+ <h:outputText style="white-space:nowrap"
value="tooltips requested:" />
+ <h:outputText value="#{toolTipData.tooltipCounter}"
styleClass="tooltipData" />
+ </h:panelGrid>
+ </rich:toolTip>
+ </rich:panel>
+ </h:form>
+ </h:panelGrid>
+ </rich:panel>
+ </td>
+ <td>
+ <ul>
+ <li>
+ There no problems
+ </li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Tool Bar & Tool Bar Group" />
+ </f:facet>
+ <rich:toolBar contentClass="btn" height="26"
itemSeparator="line" separatorClass="btn"
styleClass="btn">
+ <rich:toolBarGroup
style="font-style:italic;background-color:Cornsilk;text-decoration:overline;font-family:Arial
Narrow;font-weight:bolder;" width="500">
+ <h:graphicImage value="images/icons/create_doc.gif"
styleClass="pic"/>
+ <h:graphicImage value="images/icons/create_folder.gif"
styleClass="pic"/>
+ <h:graphicImage value="images/icons/copy.gif"
styleClass="pic"/>
+ </rich:toolBarGroup>
+ <rich:toolBarGroup location="right">
+ <h:graphicImage value="images/icons/save.gif"
styleClass="pic"/>
+ <h:graphicImage value="images/icons/save_as.gif"
styleClass="pic"/>
+ <h:graphicImage value="images/icons/save_all.gif"
styleClass="pic"/>
+ </rich:toolBarGroup>
+ <rich:toolBarGroup location="right">
+ <h:graphicImage value="images/icons/find.gif"
styleClass="pic"/>
+ <h:graphicImage value="images/icons/filter.gif"
styleClass="pic"/>
+ </rich:toolBarGroup>
+ </rich:toolBar>
+ <h:form>
+ <rich:toolBar height="34"
contentStyle="color:PaleVioletRed;font-size:medium;font-style:italic;background-color:FloralWhite;font-family:Arial
TUR;font-weight:bolder;"
+ itemSeparator="line" styleClass="evenRow"
separatorClass="btn">
+ <rich:toolBarGroup itemSeparator="grid">
+ <h:graphicImage id="edit" value="images/icons/edit.gif"
/>
+ <h:outputLabel value="Edit" for="edit" />
+ </rich:toolBarGroup>
+ <rich:toolBarGroup>
+ <h:graphicImage id="find" value="images/icons/find.gif"
/>
+ <h:outputLabel value="Find" for="find" />
+ </rich:toolBarGroup>
+ <rich:toolBarGroup>
+ <h:graphicImage id="filter" value="images/icons/filter.gif"
/>
+ <h:outputLabel value="Filter" for="filter" />
+ </rich:toolBarGroup>
+ <rich:toolBarGroup location="right">
+ <h:inputText styleClass="barsearch" />
+ <h:commandButton styleClass="barsearchbutton" onclick="return
false;" value="Search" />
+ </rich:toolBarGroup>
+ </rich:toolBar>
+ </h:form>
+ <h:form>
+ <h:panelGrid columns="3" width="100%" cellpadding="0"
cellspacing="0" style="margin-bottom : 4px">
+ <rich:panel bodyClass="rich-laguna-panel-no-header">
+ <h:panelGrid columns="8">
+ <h:outputText value="Group Separator:" />
+ <a4j:commandLink value="Line" reRender="bar">
+ <a4j:actionparam name="gs" value="line"
assignTo="#{tbBean.groupSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Grid" reRender="bar">
+ <a4j:actionparam name="gs" value="grid"
assignTo="#{tbBean.groupSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Disc" reRender="bar">
+ <a4j:actionparam name="gs" value="disc"
assignTo="#{tbBean.groupSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Square" reRender="bar">
+ <a4j:actionparam name="gs" value="square"
assignTo="#{tbBean.groupSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="None" reRender="bar">
+ <a4j:actionparam name="gs" value="none"
assignTo="#{tbBean.groupSeparator}" />
+ </a4j:commandLink>
+ </h:panelGrid>
+ </rich:panel>
+ <h:panelGroup style="padding-left : 4px">
+ <br/>
+ </h:panelGroup>
+ <rich:panel bodyClass="rich-laguna-panel-no-header">
+ <h:panelGrid columns="8">
+ <h:outputText value="Group Item Separator:" />
+ <a4j:commandLink value="Line" reRender="bar">
+ <a4j:actionparam name="gs" value="line"
assignTo="#{tbBean.groupItemSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Grid" reRender="bar">
+ <a4j:actionparam name="gs" value="grid"
assignTo="#{tbBean.groupItemSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Disc" reRender="bar">
+ <a4j:actionparam name="gs" value="disc"
assignTo="#{tbBean.groupItemSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Square" reRender="bar">
+ <a4j:actionparam name="gs" value="square"
assignTo="#{tbBean.groupItemSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="None" reRender="bar">
+ <a4j:actionparam name="gs" value="none"
assignTo="#{tbBean.groupItemSeparator}" />
+ </a4j:commandLink>
+ </h:panelGrid>
+ </rich:panel>
+ </h:panelGrid>
+ </h:form>
+
+ <rich:toolBar contentClass="btn"
contentStyle="color:PaleVioletRed;font-size:medium;font-style:italic;background-color:FloralWhite;font-family:Arial
TUR;font-weight:bolder;" id="bar" height="30"
itemSeparator="#{tbBean.groupSeparator}"
style="color:Cornsilk;font-style:italic;background-color:Orchid;text-decoration:underline;font-family:Arial
Narrow,Bodoni MT;font-weight:bold;">
+ <rich:toolBarGroup itemSeparator="#{tbBean.groupItemSeparator}">
+ <h:outputText value="Group1.1"></h:outputText>
+ <h:outputText value="Group1.2"></h:outputText>
+ <h:outputText value="Group1.3"></h:outputText>
+ </rich:toolBarGroup>
+ <rich:toolBarGroup itemSeparator="#{tbBean.groupItemSeparator}">
+ <h:outputText value="Group2.1"></h:outputText>
+ <h:outputText value="Group2.2"></h:outputText>
+ </rich:toolBarGroup>
+ <rich:toolBarGroup location="right"
itemSeparator="#{tbBean.groupItemSeparator}">
+ <h:outputText value="Group3.1"></h:outputText>
+ <h:outputText value="Group3.2"></h:outputText>
+ </rich:toolBarGroup>
+ </rich:toolBar>
+ </rich:panel>
+ </td>
+ <td>
+ <ul>
+ <li>
+ There no problems
+ </li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Tooltip" />
+ </f:facet>
+ <rich:togglePanel id="panel" initialState="panelB"
switchType="client"
+
+ stateOrder="panelA,panelB,panelC">
+
+ <f:facet name="panelA">
+
+ ...
+
+ </f:facet>
+
+ <f:facet name="panelB">
+
+ ...
+
+ </f:facet>
+
+ <f:facet name="panelC">
+
+ ...
+
+ </f:facet>
+
+ </rich:togglePanel>
+
+ <rich:toggleControl for="panel" value="Switch"
style=""/>
+ </rich:panel>
+ </td>
+ <td>
+ <ul>
+ <li>
+ There no problems
+ </li>
+ </ul>
+ </td>
+ </tr>
+ </table>
+ </rich:panel>
+ <rich:panel style="text-align:center">
+ <h:outputLink
value="${facesContext.externalContext.requestContextPath}/pages/allComponents3.jsf">
+ <f:verbatim>PREVIUOS PAGE</f:verbatim>
+ </h:outputLink>
+ </rich:panel>
+ </a4j:form>
+</ui:composition>
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-5385/jbide5385.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-5385/main.css
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-5385/main.css
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-5385/main.css 2011-10-12
16:58:31 UTC (rev 35578)
@@ -0,0 +1,40 @@
+.evenRow {
+ text-align: center;
+ background-color: green;
+ font-style: italic;
+
+}
+
+.oddRow{
+ text-align: right;
+ background-color: blue;
+ font-style: oblique;
+
+}
+
+.btn {
+ text-align: center;
+ color: DodgerBlue;
+ font-size: x-large;
+ font-style: italic;
+ background-color: Turquoise;
+ border-style: ridge;
+ border-color: DarkViolet;
+ text-decoration: overline;
+ font-weight: bolder;
+ border-width: thick;
+}
+
+
+.btn {
+
+}
+
+.vpe-text {
+ color:red;
+}
+
+#editor {
+ background-color: red;
+
+}
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-5385/main.css
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSPStylesheetRelLinkHyperlinkTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSPStylesheetRelLinkHyperlinkTest.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSPStylesheetRelLinkHyperlinkTest.java 2011-10-12
16:58:31 UTC (rev 35578)
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.text.ext.test;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.FindReplaceDocumentAdapter;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.text.ext.hyperlink.HyperlinkDetector;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.test.util.WorkbenchUtils;
+
+/**
+ * The JUnit test cases for JBIDE-5385 issue
+ *
+ * @author Victor Rubezhny
+ */
+public class JSPStylesheetRelLinkHyperlinkTest extends TestCase {
+ private static final String PROJECT_NAME = "jsfHyperlinkTests";
+ private static final String PAGE_NAME =
PROJECT_NAME+"/WebContent/JBIDE-5385/jbide5385.xhtml";
+
+ public IProject project = null;
+ public String naturesCheckProperty;
+
+ protected void setUp() {
+ naturesCheckProperty =
System.getProperty("org.jboss.tools.vpe.ENABLE_PROJECT_NATURES_CHECKER");
//$NON-NLS-1$ //$NON-NLS-2$
+ System.setProperty("org.jboss.tools.vpe.ENABLE_PROJECT_NATURES_CHECKER",
"false"); //$NON-NLS-1$ //$NON-NLS-2$
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject(
+ PROJECT_NAME);
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
+ }
+
+ protected void tearDown() {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
+ System.setProperty("org.jboss.tools.vpe.ENABLE_PROJECT_NATURES_CHECKER",
naturesCheckProperty == null ? "null" : naturesCheckProperty); //$NON-NLS-1$
+ }
+
+ public JSPStylesheetRelLinkHyperlinkTest() {
+ super("JSF OpenOn on CSS Stylesheet Rel Link test");
+ }
+
+ public void testJSF2CSSStylesheetOpenOn() throws PartInitException, BadLocationException
{
+ final String editorName = "main.css";
+ final String tagName = "link";
+ final String valueToFind = "main.css";
+ IEditorPart editor = WorkbenchUtils.openEditor(PAGE_NAME);
+ assertTrue(editor instanceof JSPMultiPageEditor);
+ JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
+ ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
+
+ IDocument document = viewer.getDocument();
+ IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
+ tagName, true, true, false, false);
+ assertNotNull("Tag:"+tagName+" not found",reg);
+
+ reg = new FindReplaceDocumentAdapter(document).find(reg.getOffset(),
+ valueToFind, true, true, false, false);
+ assertNotNull("Value to find:"+valueToFind+" not found",reg);
+
+ IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg,
true);
+
+ assertNotNull("Hyperlinks for value:"+valueToFind+" are not
found",links);
+
+ assertTrue("Hyperlinks for value:"+valueToFind+" are not
found",links.length!=0);
+
+ boolean found = false;
+ for(IHyperlink link : links){
+ assertNotNull(link.toString());
+
+ link.open();
+
+ IEditorPart resultEditor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ if(editorName.equals(resultEditor.getTitle())){
+ found = true;
+ return;
+ }
+ }
+ assertTrue("OpenOn have not opened "+editorName+" editor",found);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSPStylesheetRelLinkHyperlinkTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JsfTextExtAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JsfTextExtAllTests.java 2011-10-12
16:30:00 UTC (rev 35577)
+++
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JsfTextExtAllTests.java 2011-10-12
16:58:31 UTC (rev 35578)
@@ -19,20 +19,28 @@
public static Test suite() {
TestSuite suite = new TestSuite(JsfTextExtAllTests.class.getName());
+
suite.addTest(new ProjectImportTestSetup(new TestSuite(OpenOnsTest.class),
"org.jboss.tools.jsf.text.ext.test",
new String[]{"projects/HiperlinksTestProject"},
new String[]{"HiperlinksTestProject"}));
suite.addTest(new ProjectImportTestSetup(new TestSuite(
- JSF2CompositeOpenOnTest.class,
- JSF2CompositeLibOpenOnTest.class,
- JSF2MessagesOpenOnTest.class,
- JSF2CSSStylesheetOpenOnTest.class,
- JSF2CCAttrsOpenOnTest.class,
- JSF2XMLOpenOnTest.class),
- "org.jboss.tools.jsf.text.ext.test",
- new String[]{"projects/JSF2CompositeOpenOn"},
- new String[]{"JSF2CompositeOpenOn"}));
+ JSF2CompositeOpenOnTest.class,
+ JSF2CompositeLibOpenOnTest.class,
+ JSF2MessagesOpenOnTest.class,
+ JSF2CSSStylesheetOpenOnTest.class,
+ JSF2CCAttrsOpenOnTest.class,
+ JSF2XMLOpenOnTest.class),
+ "org.jboss.tools.jsf.text.ext.test",
+ new String[]{"projects/JSF2CompositeOpenOn"},
+ new String[]{"JSF2CompositeOpenOn"}));
+
+ suite.addTest(new ProjectImportTestSetup(new TestSuite(
+ JSPStylesheetRelLinkHyperlinkTest.class),
+ "org.jboss.tools.jsf.text.ext.test",
+ new String[]{"projects/jsfHyperlinkTests"},
+ new String[]{"jsfHyperlinkTests"}));
+
return suite;
}
}
\ 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/JSPLinkHyperlinkPartitioner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPLinkHyperlinkPartitioner.java 2011-10-12
16:30:00 UTC (rev 35577)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPLinkHyperlinkPartitioner.java 2011-10-12
16:58:31 UTC (rev 35578)
@@ -1,26 +1,26 @@
/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2007-2011 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.IExclusiblePartitionerRecognition;
import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
import org.jboss.tools.common.text.ext.hyperlink.xml.XMLLinkHyperlinkPartitioner;
/**
* @author Jeremy
*/
-public class JSPLinkHyperlinkPartitioner extends XMLLinkHyperlinkPartitioner {
+public class JSPLinkHyperlinkPartitioner extends XMLLinkHyperlinkPartitioner implements
IExclusiblePartitionerRecognition {
public static final String JSP_LINK_PARTITION =
"org.jboss.tools.common.text.ext.jsp.JSP_LINK"; //$NON-NLS-1$
-
+
/* (non-Javadoc)
* @see
org.jboss.tools.common.text.ext.hyperlink.XMLLinkHyperlinkPartitioner#getPartitionType()
*/
@@ -41,4 +41,13 @@
}
return superRegion.getAxis();
}
+
+ public String getExclusionPartitionType() {
+ return JSPStylesheetRelLinkHyperlinkPartitioner.JSP_STYLESHEET_REL_LINK_PARTITION;
+ }
+
+ public boolean excludes(String partitionType, IDocument document,
+ IHyperlinkRegion superRegion) {
+ return false;
+ }
}
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 2011-10-12
16:30:00 UTC (rev 35577)
+++
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPStylesheetRelLinkHyperlinkPartitioner.java 2011-10-12
16:58:31 UTC (rev 35578)
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2007-2011 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;
@@ -14,23 +14,23 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlinkPartitioner;
import org.jboss.tools.common.text.ext.hyperlink.HyperlinkRegion;
+import org.jboss.tools.common.text.ext.hyperlink.IExclusiblePartitionerRecognition;
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.util.StructuredModelWrapper;
import org.jboss.tools.common.text.ext.util.Utils;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
/**
* @author Jeremy
*/
-public class JSPStylesheetRelLinkHyperlinkPartitioner extends
AbstractHyperlinkPartitioner implements IHyperlinkPartitionRecognizer {
+public class JSPStylesheetRelLinkHyperlinkPartitioner extends
AbstractHyperlinkPartitioner implements IHyperlinkPartitionRecognizer,
IExclusiblePartitionerRecognition {
public static final String JSP_STYLESHEET_REL_LINK_PARTITION =
"org.jboss.tools.common.text.ext.jsp.JSP_STYLESHEET_REL_LINK"; //$NON-NLS-1$
private static final String LINK_TAGNAME = "link"; //$NON-NLS-1$
@@ -234,4 +234,13 @@
}
}
+ public String getExclusionPartitionType() {
+ return null;
+ }
+
+ public boolean excludes(String partitionType, IDocument document,
+ IHyperlinkRegion superRegion) {
+ return (JSP_STYLESHEET_REL_LINK_PARTITION.equals(partitionType) &&
recognize(document, superRegion));
+ }
+
}