Author: scabanovich
Date: 2009-09-25 11:57:36 -0400 (Fri, 25 Sep 2009)
New Revision: 17754
Removed:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlinkPartitioner.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/FilterNameHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/JSPStylesheetRelLinkHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/RoleNameHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/ServletNameHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/TLDAttributeNameHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/TaglibDefinitionFilesHyperlinkPartitioner.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.text.ext/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4950
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/META-INF/MANIFEST.MF 2009-09-25
15:33:04 UTC (rev 17753)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/META-INF/MANIFEST.MF 2009-09-25
15:57:36 UTC (rev 17754)
@@ -3,7 +3,6 @@
Bundle-Activator: org.jboss.tools.common.text.ext.ExtensionsPlugin
Export-Package: org.jboss.tools.common.text.ext,
org.jboss.tools.common.text.ext.hyperlink,
- org.jboss.tools.common.text.ext.hyperlink.jsp,
org.jboss.tools.common.text.ext.hyperlink.xml,
org.jboss.tools.common.text.ext.hyperlink.xpl,
org.jboss.tools.common.text.ext.util,
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/plugin.xml 2009-09-25 15:33:04
UTC (rev 17753)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/plugin.xml 2009-09-25 15:57:36
UTC (rev 17754)
@@ -10,19 +10,6 @@
id="org.jboss.tools.common.text.ext.hyperlinkPartitioner"
name="org.jboss.tools.common.text.ext.hyperlinkPartitioner">
- <hyperlinkPartitioner
-
id="org.jboss.tools.common.text.ext.hyperlink.CSSClassHyperlinkPartitioner"
-
class="org.jboss.tools.common.text.ext.hyperlink.CSSClassHyperlinkPartitioner">
- <contentType id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
- </partitionType>
- </contentType>
- <contentType id="org.eclipse.wst.html.core.htmlsource">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
- </partitionType>
- </contentType>
- </hyperlinkPartitioner>
-
<!-- Root XML, HTML and JSP hyperlink partitioners -->
<hyperlinkPartitioner
class="org.jboss.tools.common.text.ext.hyperlink.xml.XMLRootHyperlinkPartitioner"
@@ -50,17 +37,6 @@
</contentType>
</hyperlinkPartitioner>
- <hyperlinkPartitioner
- class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPRootHyperlinkPartitioner"
- id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPRootHyperlinkPartitioner">
- <contentType id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType id="org.eclipse.jst.jsp.JSP_DIRECTIVE" />
- <partitionType id="org.eclipse.wst.html.HTML_DEFAULT" />
- </contentType>
- <contentType id="org.eclipse.wst.html.core.htmlsource">
- <partitionType id="org.eclipse.wst.html.HTML_DEFAULT" />
- </contentType>
- </hyperlinkPartitioner>
<!-- End of Root XML, HTML and JSP hyperlink partitioners -->
<!-- Common XML hyperlink partitioners -->
@@ -252,176 +228,6 @@
<!-- End of Common XML hyperlink partitioners -->
- <!-- Common HTML and/or JSP hyperlink partitioners -->
- <hyperlinkPartitioner
- class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPTaglibHyperlinkPartitioner"
- id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPTaglibHyperlinkPartitioner">
- <contentType id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
id="org.jboss.tools.common.text.ext.jsp.JSP_ROOT"/>
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
- <axis path="*/jsp:directive.taglib/uri" />
- <axis path="*/jsp:directive.taglib/prefix" />
- </partitionType>
- </contentType>
- </hyperlinkPartitioner>
-
- <hyperlinkPartitioner
- class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPTagAttributeHyperlinkPartitioner"
-
id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPTagAttributeHyperlinkPartitioner">
- <contentType id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
- <axis path="*/jsp:attribute/name/"/>
- </partitionType>
- </contentType>
- </hyperlinkPartitioner>
-
- <hyperlinkPartitioner
- class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPTextHyperlinkPartitioner"
- id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPTextHyperlinkPartitioner">
- <contentType id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
id="org.jboss.tools.common.text.ext.jsp.JSP_ROOT">
- <axis path="*/title/" ignoreCase="true"/>
- <axis path="*/h1/" ignoreCase="true"/>
- </partitionType>
- </contentType>
- </hyperlinkPartitioner>
-
- <hyperlinkPartitioner
- class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPElementHyperlinkPartitioner"
- id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPElementHyperlinkPartitioner">
- <contentType id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType id="org.jboss.tools.common.text.ext.jsp.JSP_ROOT"
/>
- </contentType>
- <contentType id="org.eclipse.wst.html.core.htmlsource">
- <partitionType id="org.jboss.tools.common.text.ext.jsp.JSP_ROOT"
/>
- </contentType>
- </hyperlinkPartitioner>
-
- <hyperlinkPartitioner
- class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPElementNameHyperlinkPartitioner"
- id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPElementNameHyperlinkPartitioner">
- <contentType id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ELEMENT"/>
- </contentType>
- <contentType id="org.eclipse.wst.html.core.htmlsource">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ELEMENT"/>
- </contentType>
- </hyperlinkPartitioner>
-
- <hyperlinkPartitioner
- class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPElementAttributeValueHyperlinkPartitioner"
- id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPElementAttributeValueHyperlinkPartitioner">
- <contentType id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ELEMENT" />
- </contentType>
- <contentType id="org.eclipse.wst.html.core.htmlsource">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ELEMENT" />
- </contentType>
- </hyperlinkPartitioner>
-
- <hyperlinkPartitioner
- class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPXmlNsHyperlinkPartitioner"
- id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPXmlNsHyperlinkPartitioner">
- <contentType id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE"/>
- </contentType>
- <contentType id="org.eclipse.wst.html.core.htmlsource">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE"/>
- </contentType>
- </hyperlinkPartitioner>
-
- <hyperlinkPartitioner
- class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPBeanGetPropertyHyperlinkPartitioner"
-
id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPBeanGetPropertyHyperlinkPartitioner">
- <contentType id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
- <axis path="*/jsp:getProperty/property/" />
- </partitionType>
- </contentType>
- </hyperlinkPartitioner>
-
- <hyperlinkPartitioner
- class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPBeanSetPropertyHyperlinkPartitioner"
-
id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPBeanSetPropertyHyperlinkPartitioner">
- <contentType id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
- <axis path="*/jsp:setProperty/property/" />
- </partitionType>
- </contentType>
- </hyperlinkPartitioner>
-
- <hyperlinkPartitioner
-
id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPForBeanIdHyperlinkPartitioner"
-
class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPForBeanIdHyperlinkPartitioner">
- <contentType id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
- <axis path="*/jsp:setProperty/name/" />
- <axis path="*/jsp:getProperty/name/" />
- </partitionType>
- </contentType>
- </hyperlinkPartitioner>
-
- <hyperlinkPartitioner
-
id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPClassHyperlinkPartitioner"
-
class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPClassHyperlinkPartitioner">
- <contentType id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
- <axis path="*/jsp:directive.page/import/" />
- <axis path="*/jsp:useBean/class/" />
- <axis path="*/jsp:useBean/type/" />
- </partitionType>
- </contentType>
- </hyperlinkPartitioner>
-
- <hyperlinkPartitioner
-
id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPStylesheetRelLinkHyperlinkPartitioner"
-
class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPStylesheetRelLinkHyperlinkPartitioner">
- <contentType id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
- <axis path="*/link/*" ignoreCase="true"/>
- </partitionType>
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ELEMENT">
- <axis path="*/link/*" ignoreCase="true"/>
- </partitionType>
- <partitionType id="com.ibm.sse.STYLE">
- <!--axis path="*/style/" /-->
- </partitionType>
- </contentType>
- <contentType id="org.eclipse.wst.html.core.htmlsource">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
- <axis path="*/link/*" ignoreCase="true"/>
- </partitionType>
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ELEMENT">
- <axis path="*/link/*" ignoreCase="true"/>
- </partitionType>
- <partitionType id="com.ibm.sse.STYLE">
- <!--axis path="*/style/" /-->
- </partitionType>
- </contentType>
- </hyperlinkPartitioner>
-
- <hyperlinkPartitioner
-
id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPLinkHyperlinkPartitioner"
-
class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPLinkHyperlinkPartitioner">
- <contentType id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
- <axis path="*/a/href/" ignoreCase="true"/>
- <axis path="*/jsp:directive.include/file/" />
- <axis path="*/jsp:directive.page/errorPage/" />
- <axis path="*/jsp:include/page/" />
- <axis path="*/jsp:forward/page/" />
- <axis path="*/jsp:plugin/iepluginurl/" />
- <axis path="*/jsp:plugin/nspluginurl/" />
- </partitionType>
- </contentType>
- <contentType id="org.eclipse.wst.html.core.htmlsource">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
- <axis path="*/a/href/" ignoreCase="true"/>
- </partitionType>
- </contentType>
- </hyperlinkPartitioner>
- <!-- End of Common HTML and/or JSP hyperlink partitioners -->
-
<!-- Web.xml and/or TLD files hyperlink partitioners -->
<hyperlinkPartitioner
id="org.jboss.tools.common.text.ext.hyperlink.xml.XMLClassHyperlinkPartitioner"
@@ -671,25 +477,6 @@
</contentType>
</hyperlinkPartitioner>
<!-- End of TLD files hyperlink partitioners -->
- <!--Maksim Areshkau, partitioner for *.taglib.xml files -->
- <hyperlinkPartitioner
-
class="org.jboss.tools.common.text.ext.hyperlink.TaglibDefinitionFilesHyperlinkPartitioner"
-
id="org.jboss.tools.common.text.ext.hyperlink.TaglibDefinitionFilesHyperlinkPartitioner">
- <contentType id="org.jboss.tools.common.model.ui.xml">
- <partitionType
id="org.jboss.tools.common.text.ext.xml.XML_TEXT">
- <axis path="/facelet-taglib/tag/source">
- </axis>
- <axis path="/facelet-taglib/function/function-class">
- </axis>
- <axis
path="/facelet-taglib/tag/component/handler-class">
- </axis>
- <axis path="/facelet-taglib/library-class">
- </axis>
- </partitionType>
- </contentType>
- </hyperlinkPartitioner>
- <!--End of partiotioner for *.taglib.xml files -->
-
<hyperlinkPartitioner
id="org.jboss.tools.common.text.ext.hyperlink.xml.PortletHyperlinkPartitioner"
class="org.jboss.tools.common.text.ext.hyperlink.xml.PortletHyperlinkPartitioner">
@@ -748,62 +535,7 @@
</hyperlink>
-<!-- JSP -->
-<!-- add an open on action for jsp bean partitions -->
<hyperlink
- class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPElementNameHyperlink"
- id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPElementNameHyperlink">
- <contenttypeidentifier id="org.eclipse.jst.jsp.core.jspsource">
- <partitiontype id="org.jboss.tools.common.text.ext.xml.XML_ELEMENT_NAME"
/>
- </contenttypeidentifier>
- </hyperlink>
-
- <hyperlink
- class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPTaglibHyperlink"
- id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPTaglibHyperlink">
- <contenttypeidentifier id="org.eclipse.jst.jsp.core.jspsource">
- <partitiontype id="org.jboss.tools.common.text.ext.jsp.JSP_TAGLIB"
/>
- </contenttypeidentifier>
- </hyperlink>
-
- <hyperlink
- class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPXmlNsHyperlink"
-
id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPXmlNsHyperlink">
- <contenttypeidentifier id="org.eclipse.jst.jsp.core.jspsource">
- <partitiontype id="org.jboss.tools.common.text.ext.jsp.JSP_XMLNS" />
- </contenttypeidentifier>
- <contenttypeidentifier id="org.eclipse.wst.html.core.htmlsource">
- <partitiontype id="org.jboss.tools.common.text.ext.jsp.JSP_XMLNS" />
- </contenttypeidentifier>
- </hyperlink>
-
- <hyperlink
- class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPForBeanIdHyperlink"
- id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPForBeanIdHyperlink">
- <contenttypeidentifier id="org.eclipse.jst.jsp.core.jspsource">
- <partitiontype id="org.jboss.tools.common.text.ext.jsp.JSP_FOR_BEAN_ID"
/>
- </contenttypeidentifier>
- </hyperlink>
-
- <hyperlink
- class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPBeanGetPropertyHyperlink"
-
id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPBeanGetPropertyHyperlink">
- <contenttypeidentifier id="org.eclipse.jst.jsp.core.jspsource">
- <partitiontype
id="org.jboss.tools.common.text.ext.jsp.JSP_BEAN_GET_PROPERTY" />
- </contenttypeidentifier>
- </hyperlink>
-
- <hyperlink
- class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPBeanSetPropertyHyperlink"
-
id="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPBeanSetPropertyHyperlink">
- <contenttypeidentifier id="org.eclipse.jst.jsp.core.jspsource">
- <partitiontype
id="org.jboss.tools.common.text.ext.jsp.JSP_BEAN_SET_PROPERTY" />
- </contenttypeidentifier>
- </hyperlink>
-
-<!-- JSP -->
-
- <hyperlink
class="org.jboss.tools.common.text.ext.hyperlink.ClassHyperlink"
id="org.jboss.tools.common.text.ext.hyperlink.ClassHyperlink">
<contenttypeidentifier
id="org.eclipse.jst.jsf.facesconfig.facesConfigFile">
@@ -833,17 +565,6 @@
</hyperlink>
<hyperlink
- class="org.jboss.tools.common.text.ext.hyperlink.CSSClassHyperlink"
- id="org.jboss.tools.common.text.ext.hyperlink.CSSClassHyperlink">
- <contenttypeidentifier id="org.eclipse.jst.jsp.core.jspsource">
- <partitiontype id="org.jboss.tools.common.text.ext.CSS_CLASS" />
- </contenttypeidentifier>
- <contenttypeidentifier id="org.eclipse.wst.html.core.htmlsource">
- <partitiontype id="org.jboss.tools.common.text.ext.CSS_CLASS" />
- </contenttypeidentifier>
- </hyperlink>
-
- <hyperlink
class="org.jboss.tools.common.text.ext.hyperlink.xml.XMLXmlNsHyperlink"
id="org.jboss.tools.common.text.ext.hyperlink.xml.XMLXmlNsHyperlink">
<contenttypeidentifier
id="org.eclipse.jst.jsf.facesconfig.facesConfigFile">
@@ -869,100 +590,7 @@
</contenttypeidentifier>
</hyperlink>
- <!-- Web.inf File -->
-
<hyperlink
- class="org.jboss.tools.common.text.ext.hyperlink.FilterNameHyperlink"
- id="org.jboss.tools.common.text.ext.hyperlink.FilterNameHyperlink">
- <contenttypeidentifier id="org.eclipse.wst.xml.core.xmlsource">
- <partitiontype id="org.jboss.tools.common.text.ext.xml.XML_FILTER_NAME"
/>
- </contenttypeidentifier>
- <contenttypeidentifier id="org.eclipse.core.runtime.xml">
- <partitiontype id="org.jboss.tools.common.text.ext.xml.XML_FILTER_NAME"
/>
- </contenttypeidentifier>
- <contenttypeidentifier id="org.eclipse.jst.j2ee.webDD">
- <partitiontype id="org.jboss.tools.common.text.ext.xml.XML_FILTER_NAME"
/>
- </contenttypeidentifier>
- <contenttypeidentifier id="org.eclipse.jst.jee.ee5webDD">
- <partitiontype id="org.jboss.tools.common.text.ext.xml.XML_FILTER_NAME"
/>
- </contenttypeidentifier>
- <contenttypeidentifier id="org.jboss.tools.common.model.ui.xml">
- <partitiontype id="org.jboss.tools.common.text.ext.xml.XML_FILTER_NAME"
/>
- </contenttypeidentifier>
- </hyperlink>
-
- <hyperlink
- class="org.jboss.tools.common.text.ext.hyperlink.RoleNameHyperlink"
- id="org.jboss.tools.common.text.ext.hyperlink.RoleNameHyperlink">
- <contenttypeidentifier id="org.eclipse.wst.xml.core.xmlsource">
- <partitiontype id="org.jboss.tools.common.text.ext.xml.XML_ROLE_NAME"
/>
- </contenttypeidentifier>
- <contenttypeidentifier id="org.eclipse.core.runtime.xml">
- <partitiontype id="org.jboss.tools.common.text.ext.xml.XML_ROLE_NAME"
/>
- </contenttypeidentifier>
- <contenttypeidentifier id="org.eclipse.jst.j2ee.webDD">
- <partitiontype id="org.jboss.tools.common.text.ext.xml.XML_ROLE_NAME"
/>
- </contenttypeidentifier>
- <contenttypeidentifier id="org.eclipse.jst.jee.ee5webDD">
- <partitiontype id="org.jboss.tools.common.text.ext.xml.XML_ROLE_NAME"
/>
- </contenttypeidentifier>
- <contenttypeidentifier id="org.jboss.tools.common.model.ui.xml">
- <partitiontype id="org.jboss.tools.common.text.ext.xml.XML_ROLE_NAME"
/>
- </contenttypeidentifier>
- </hyperlink>
-
- <hyperlink
- class="org.jboss.tools.common.text.ext.hyperlink.ServletNameHyperlink"
-
id="org.jboss.tools.common.text.ext.hyperlink.ServletNameHyperlink">
- <contenttypeidentifier id="org.eclipse.wst.xml.core.xmlsource">
- <partitiontype
id="org.jboss.tools.common.text.ext.xml.XML_SERVLET_NAME" />
- </contenttypeidentifier>
- <contenttypeidentifier id="org.eclipse.core.runtime.xml">
- <partitiontype
id="org.jboss.tools.common.text.ext.xml.XML_SERVLET_NAME" />
- </contenttypeidentifier>
- <contenttypeidentifier id="org.eclipse.jst.j2ee.webDD">
- <partitiontype
id="org.jboss.tools.common.text.ext.xml.XML_SERVLET_NAME" />
- </contenttypeidentifier>
- <contenttypeidentifier id="org.eclipse.jst.jee.ee5webDD">
- <partitiontype
id="org.jboss.tools.common.text.ext.xml.XML_SERVLET_NAME" />
- </contenttypeidentifier>
- <contenttypeidentifier id="org.jboss.tools.common.model.ui.xml">
- <partitiontype
id="org.jboss.tools.common.text.ext.xml.XML_SERVLET_NAME" />
- </contenttypeidentifier>
- </hyperlink>
- <!-- Web.inf File -->
-
- <!-- TLD Files -->
- <hyperlink
- class="org.jboss.tools.common.text.ext.hyperlink.TLDAttributeNameHyperlink"
-
id="org.jboss.tools.common.text.ext.hyperlink.TLDAttributeNameHyperlink">
- <contenttypeidentifier id="org.eclipse.wst.xml.core.xmlsource">
- <partitiontype
id="org.jboss.tools.common.text.ext.tld.TLD_ATTRIBUTE_NAME" />
- </contenttypeidentifier>
- <contenttypeidentifier id="org.eclipse.jst.jsp.core.tldsource">
- <partitiontype
id="org.jboss.tools.common.text.ext.tld.TLD_ATTRIBUTE_NAME" />
- </contenttypeidentifier>
- <contenttypeidentifier id="org.eclipse.core.runtime.xml">
- <partitiontype
id="org.jboss.tools.common.text.ext.tld.TLD_ATTRIBUTE_NAME" />
- </contenttypeidentifier>
- <contenttypeidentifier id="org.jboss.tools.common.model.ui.xml">
- <partitiontype
id="org.jboss.tools.common.text.ext.tld.TLD_ATTRIBUTE_NAME" />
- </contenttypeidentifier>
- </hyperlink>
- <!-- TLD Files -->
-
- <hyperlink
- class="org.jboss.tools.common.text.ext.hyperlink.JSPStylesheetRelLinkHyperlink"
-
id="org.jboss.tools.common.text.ext.hyperlink.JSPStylesheetRelLinkHyperlink">
- <contenttypeidentifier id="org.eclipse.jst.jsp.core.jspsource">
- <partitiontype
id="org.jboss.tools.common.text.ext.jsp.JSP_STYLESHEET_REL_LINK" />
- </contenttypeidentifier>
- <contenttypeidentifier id="org.eclipse.wst.html.core.htmlsource">
- <partitiontype
id="org.jboss.tools.common.text.ext.jsp.JSP_STYLESHEET_REL_LINK" />
- </contenttypeidentifier>
- </hyperlink>
-
- <hyperlink
class="org.jboss.tools.common.text.ext.hyperlink.xml.PortletHyperlink"
id="org.jboss.tools.common.text.ext.hyperlink.xml.PortletHyperlink">
<contenttypeidentifier id="org.eclipse.core.runtime.xml">
Deleted:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlink.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlink.java 2009-09-25
15:33:04 UTC (rev 17753)
+++
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlink.java 2009-09-25
15:57:36 UTC (rev 17754)
@@ -1,508 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and 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
- ******************************************************************************/
-package org.jboss.tools.common.text.ext.hyperlink;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IModelProvideAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
-import org.eclipse.wst.html.core.internal.htmlcss.LinkElementAdapter;
-import org.eclipse.wst.html.core.internal.htmlcss.URLModelProvider;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.jboss.tools.common.text.ext.ExtensionsPlugin;
-import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
-import org.jboss.tools.common.text.ext.util.RegionHolder;
-import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
-import org.jboss.tools.common.text.ext.util.StructuredSelectionHelper;
-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.NodeList;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.css.CSSStyleSheet;
-
-/**
- * @author Jeremy
- */
-public class CSSClassHyperlink extends AbstractHyperlink {
-
- public static final String[] STYLE_TAGS = new String[] { "style",
"link" }; //$NON-NLS-1$//$NON-NLS-2$
- public static final String LINK_TAG = "link"; //$NON-NLS-1$
- public static final String HREF_ATTRIBUTE = "href"; //$NON-NLS-1$
- public static final String COMPARE_CLASS_REGEX_PREFIX = "[\\.]?";
//$NON-NLS-1$
- public static final String CONTEXT_PATH_EXPRESSION =
"^\\s*(\\#|\\$)\\{facesContext.externalContext.requestContextPath\\}";
//$NON-NLS-1$
-
- /**
- *
- */
- protected void doHyperlink(IRegion region) {
-
- IDOMModel model = (IDOMModel) getModelManager()
- .getExistingModelForRead(getDocument());
-
- // get name of looked for style
- String styleName = getStyleName(region);
-
- // get elements which copntans information about styles (style and link
- // tags)
- List<Node> styleElementList = getStyleContainerList(model);
-
- // sort nodes by position in inverse order - from larger position to
- // smaller
- Collections.sort(styleElementList, new Comparator<Node>() {
-
- public int compare(Node o1, Node o2) {
- return ((IDOMNode) o2).getStartOffset()
- - ((IDOMNode) o1).getStartOffset();
- }
-
- });
-
- RegionHolder styleRegion = null;
- // look for style in each Style element
- for (Node styleContainer : styleElementList) {
-
- styleRegion = findStyleRegion(styleContainer, styleName);
-
- if (styleRegion != null) {
- showRegion(styleRegion);
- break;
- }
-
- }
-
- model.releaseFromRead();
- }
-
- /**
- *
- * @param model
- * @return
- */
- private List<Node> getStyleContainerList(IDOMModel model) {
-
- // get model of current page
- IDOMDocument document = model.getDocument();
-
- List<Node> getStyleContainerList = new ArrayList<Node>();
-
- // get all tags which contains style ( link, style)
- for (String tagName : STYLE_TAGS) {
- getStyleContainerList.addAll(getList(document
- .getElementsByTagName(tagName)));
- }
-
- return getStyleContainerList;
- }
-
- /**
- * move nodes from NodeList to List
- *
- * @param nodeList
- * @return
- */
- List<Node> getList(NodeList nodeList) {
-
- List<Node> newContainerList = new ArrayList<Node>();
- for (int i = 0; i < nodeList.getLength(); i++) {
- newContainerList.add(nodeList.item(i));
- }
- return newContainerList;
- }
-
- /**
- *
- * @param stylesContainer
- * @param styleName
- * @return
- */
- public RegionHolder findStyleRegion(Node stylesContainer, String styleName) {
-
- // get style sheet
- CSSStyleSheet sheet = getSheet(stylesContainer);
-
- if (sheet != null) {
-
- CSSRuleList ruleList = sheet.getCssRules();
-
- // for each cssRule
- for (int i = 0; i < ruleList.getLength(); i++) {
-
- CSSRule cssRule = ruleList.item(i);
-
- // if cssRule describe looked for style
- if (isRuleMatch(cssRule, styleName)) {
-
- return new RegionHolder(getFile((ICSSNode) cssRule),
- getRegion(cssRule));
-
- }
- }
-
- }
- return null;
- }
-
- /**
- *
- * @param stylesContainer
- * @return
- */
- private CSSStyleSheet getSheet(final Node stylesContainer) {
-
- INodeNotifier notifier = (INodeNotifier) stylesContainer;
-
- IStyleSheetAdapter adapter = (IStyleSheetAdapter) notifier
- .getAdapterFor(IStyleSheetAdapter.class);
-
- if (LINK_TAG.equalsIgnoreCase(stylesContainer.getNodeName())
- && !(adapter instanceof ExtendedLinkElementAdapter)) {
-
- notifier.removeAdapter(adapter);
- adapter = new ExtendedLinkElementAdapter(
- (Element) stylesContainer);
- notifier.addAdapter(adapter);
-
- }
-
- CSSStyleSheet sheet = null;
-
- if (adapter != null) {
- sheet = (CSSStyleSheet) adapter.getSheet();
-
- }
-
- return sheet;
-
- }
-
- protected String processURL(String href) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- *
- * @param cssRule
- * @param styleName
- * @return
- */
- private boolean isRuleMatch(CSSRule cssRule, String styleName) {
-
- // get selector text
- String selectorText = ((ICSSStyleRule) cssRule).getSelectorText();
-
- if (selectorText != null) {
-
- // split selector text by whitespace
- String[] styles = selectorText.trim().split(" "); //$NON-NLS-1$
- int searchIndex = Arrays.binarySearch(styles, styleName,
- new Comparator<String>() {
-
- public int compare(String o1, String o2) {
- Matcher matcher = Pattern.compile(
- COMPARE_CLASS_REGEX_PREFIX + o2)
- .matcher(o1);
- return matcher.matches() ? 0 : 1;
- }
-
- });
- if (searchIndex >= 0)
- return true;
- }
- return false;
- }
-
- /**
- *
- * @param node
- * @return
- */
- private IFile getFile(ICSSNode node) {
-
- ICSSDocument sheet = node.getOwnerDocument();
-
- return AbstractHyperlink.getFile(sheet.getModel());
- }
-
- /**
- *
- * @param cssRule
- * @return
- */
- protected Region getRegion(CSSRule cssRule) {
-
- int offset = ((IndexedRegion) cssRule).getStartOffset();
-
- // if css rule is contained in style tag so it is require to take into
- // account offset of this tag
- ICSSStyleSheet document = (ICSSStyleSheet) ((ICSSStyleRule) cssRule)
- .getOwnerDocument();
-
- ICSSModel model = document.getModel();
-
- // get style tag
- Node node = model.getOwnerDOMNode();
-
- // increase offset
- if (node instanceof IDOMElement)
- offset += ((IDOMElement) node).getStartEndOffset();
-
- return new Region(offset, 0);
-
- }
-
- /**
- *
- * @param styleRegion
- */
- private void showRegion(RegionHolder styleRegion) {
-
- IWorkbenchPage workbenchPage = ExtensionsPlugin.getDefault()
- .getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart part = null;
- if (styleRegion.file != null) {
- try {
- part = IDE.openEditor(workbenchPage, styleRegion.file, true);
- } catch (PartInitException e) {
- e.printStackTrace();
- }
- if (part == null) {
- openFileFailed();
- return;
- }
- }
- StructuredSelectionHelper.setSelectionAndReveal(part,
- styleRegion.region);
- }
-
- /**
- *
- * @param region
- * @return
- */
- private String getStyleName(IRegion region) {
- try {
- return getDocument().get(region.getOffset(), region.getLength());
- } catch (BadLocationException e) {
- return null;
- }
- }
-
- IRegion fLastRegion = null;
-
- /**
- * @see com.ibm.sse.editor.AbstractHyperlink#doGetHyperlinkRegion(int)
- */
- protected IRegion doGetHyperlinkRegion(int offset) {
- fLastRegion = getRegion(offset);
- return fLastRegion;
- }
-
- /**
- * TODO research method
- *
- * @param offset
- * @return
- */
- protected IRegion getRegion(int offset) {
- StructuredModelWrapper smw = new StructuredModelWrapper();
- try {
- smw.init(getDocument());
- Document xmlDocument = smw.getDocument();
- if (xmlDocument == null)
- return null;
-
- Node n = Utils.findNodeForOffset(xmlDocument, offset);
-
- if (n == null || !(n instanceof Attr))
- return null;
- int start = Utils.getValueStart(n);
- int end = Utils.getValueEnd(n);
- if (start > offset)
- return null;
-
- String attrText = getDocument().get(start, end - start);
-
- StringBuffer sb = new StringBuffer(attrText);
- // find start of bean property
- int bStart = offset - start;
- while (bStart >= 0) {
- if (!Character.isJavaIdentifierPart(sb.charAt(bStart))
- && sb.charAt(bStart) != '_' && sb.charAt(bStart) !=
'-'
- && sb.charAt(bStart) != '.') {
- bStart++;
- break;
- }
-
- if (bStart == 0)
- break;
- bStart--;
- }
- // find end of bean property
- int bEnd = offset - start;
- while (bEnd < sb.length()) {
- if (!Character.isJavaIdentifierPart(sb.charAt(bEnd))
- && sb.charAt(bEnd) != '_' && sb.charAt(bEnd) !=
'-'
- && sb.charAt(bEnd) != '.')
- break;
- bEnd++;
- }
-
- final int propStart = bStart + start;
- final int propLength = bEnd - bStart;
-
- if (propStart > offset || propStart + propLength < offset)
- return null;
- return new Region(propStart, propLength);
- } catch (BadLocationException x) {
- // ignore
- return null;
- } finally {
- smw.dispose();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- String styleName = getStyleName(fLastRegion);
- if (styleName == null)
- return MessageFormat.format(Messages.OpenA, Messages.CSSStyle);
-
- return MessageFormat.format(Messages.OpenCSSStyle, styleName);
- }
-
- @Override
- protected String findAndReplaceElVariable(String fileName) {
- if (fileName != null)
- fileName = fileName
- .replaceFirst(
- "^\\s*(\\#|\\$)\\{facesContext.externalContext.requestContextPath\\}",
- "");
- return super.findAndReplaceElVariable(fileName);
- }
-
- public class ExtendedLinkElementAdapter extends LinkElementAdapter {
-
- private Element element;
-
- public ExtendedLinkElementAdapter(Element element) {
- this.element = element;
- }
-
- @Override
- public Element getElement() {
- return element;
- }
-
- @Override
- protected boolean isValidAttribute() {
- String href = getElement().getAttribute(HREF_ATTRIBUTE);
- if (href == null || href.length() == 0)
- return false;
- return true;
- }
-
- /**
- */
- public ICSSModel getModel() {
- ICSSModel model = super.getModel();
- if (model == null) {
- model = retrieveModel();
- setModel(model);
- }
- return model;
- }
-
- /**
- */
- private ICSSModel retrieveModel() {
- if (!isValidAttribute()) {
- return null;
- }
-
- // null,attr check is done in isValidAttribute()
- Element element = getElement();
- String href = findAndReplaceElVariable(element
- .getAttribute(HREF_ATTRIBUTE));
-
- IDOMModel baseModel = ((IDOMNode) element).getModel();
- if (baseModel == null)
- return null;
- Object id = baseModel.getId();
- if (!(id instanceof String))
- return null;
- // String base = (String)id;
-
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement())
- .getAdapterFor(IModelProvideAdapter.class);
-
- URLModelProvider provider = new URLModelProvider();
- try {
- IStructuredModel newModel = provider.getModelForRead(baseModel,
- href);
- if (newModel == null)
- return null;
- if (!(newModel instanceof ICSSModel)) {
- newModel.releaseFromRead();
- return null;
- }
-
- // notify adapter
- if (adapter != null)
- adapter.modelProvided(newModel);
-
- return (ICSSModel) newModel;
- } catch (UnsupportedEncodingException e) {
- } catch (IOException e) {
- }
-
- return null;
- }
- }
-
-}
\ No newline at end of file
Deleted:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlinkPartitioner.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlinkPartitioner.java 2009-09-25
15:33:04 UTC (rev 17753)
+++
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlinkPartitioner.java 2009-09-25
15:57:36 UTC (rev 17754)
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2009 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
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.text.ext.hyperlink;
-
-import org.eclipse.jface.text.IDocument;
-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.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.Node;
-
-/**
- *
- * @author Sergey Dzmitrovich
- *
- */
-public class CSSClassHyperlinkPartitioner extends
- AbstractHyperlinkPartitioner implements IHyperlinkPartitionRecognizer {
-
- public static final String CSS_CLASS_PARTITION =
"org.jboss.tools.common.text.ext.CSS_CLASS"; //$NON-NLS-1$
-
- private static final String CSS_CLASS_TOKEN = "class/"; //$NON-NLS-1$
-
- /**
- * @see
com.ibm.sse.editor.hyperlink.AbstractHyperlinkPartitioner#parse(org.eclipse.jface.text.IDocument,
- * com.ibm.sse.editor.extensions.hyperlink.IHyperlinkRegion)
- */
- protected IHyperlinkRegion parse(IDocument document,
- IHyperlinkRegion superRegion) {
- StructuredModelWrapper smw = new StructuredModelWrapper();
- try {
- smw.init(document);
- Document xmlDocument = smw.getDocument();
- if (xmlDocument == null)
- return null;
-
- Node n = Utils.findNodeForOffset(xmlDocument, superRegion
- .getOffset());
- if (n == null || !(n instanceof Attr))
- return null;
-
- String axis = getAxis(document, superRegion);
- String contentType = superRegion.getContentType();
- String type = getPartitionType(axis);
- int start = Utils.getValueStart(n);
- int end = Utils.getValueEnd(n);
- if (start < 0 || end < start)
- return null;
- int length = end - start;
- int offset = superRegion.getOffset();
-
- IHyperlinkRegion region = new HyperlinkRegion(offset, length, axis,
- contentType, type);
- return region;
- } finally {
- smw.dispose();
- }
- }
-
- private String getPartitionType(String axis) {
- return CSS_CLASS_PARTITION;
- }
-
- public boolean recognize(IDocument document, IHyperlinkRegion region) {
-
- if (region.getAxis() != null
- && region.getAxis().toLowerCase().endsWith(CSS_CLASS_TOKEN))
- return true;
- return false;
- }
-
-}
Deleted:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/FilterNameHyperlink.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/FilterNameHyperlink.java 2009-09-25
15:33:04 UTC (rev 17753)
+++
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/FilterNameHyperlink.java 2009-09-25
15:57:36 UTC (rev 17754)
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and 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
- ******************************************************************************/
-package org.jboss.tools.common.text.ext.hyperlink;
-
-import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
-/**
- * @author Jeremy
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class FilterNameHyperlink extends JumpToHyperlink {
- protected String getDestinationAxis() {
- return "/web-app/filter/filter-name/"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- return Messages.BrowseToFilterNameDefinition;
- }
-
-}
Deleted:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/JSPStylesheetRelLinkHyperlink.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/JSPStylesheetRelLinkHyperlink.java 2009-09-25
15:33:04 UTC (rev 17753)
+++
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/JSPStylesheetRelLinkHyperlink.java 2009-09-25
15:57:36 UTC (rev 17754)
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and 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
- ******************************************************************************/
-package org.jboss.tools.common.text.ext.hyperlink;
-
-import org.eclipse.jface.text.BadLocationException;
-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.Node;
-import org.w3c.dom.Text;
-
-import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
-import org.jboss.tools.common.text.ext.util.Utils;
-
-/**
- * @author Jeremy
- *
- */
-public class JSPStylesheetRelLinkHyperlink extends RelativeLinkHyperlink {
-
- private static final String HREF_ATTRNAME = "href"; //$NON-NLS-1$
-
- protected IRegion getRegion (int offset) {
- StructuredModelWrapper smw = new StructuredModelWrapper();
- smw.init(getDocument());
- try {
- Document xmlDocument = smw.getDocument();
- if (xmlDocument == null) return null;
-
- Node n = Utils.findNodeForOffset(xmlDocument, offset);
-
- if (n == null || !(n instanceof Text || n instanceof Attr)) return null;
-
- String text = null;
- int bStart = 0;
- int bEnd = 0;
-
- if (n instanceof Text) {
- int start = Utils.getValueStart(n);
- int end = Utils.getValueEnd(n);
- if (start < 0 || start > offset) return null;
-
- text = getDocument().get(start, end - start);
- bStart = offset - start;
- bEnd = offset - start;
- } else if (n instanceof Attr) {
- Attr attr = (Attr)n;
- if (!HREF_ATTRNAME.equalsIgnoreCase(attr.getName())) return null;
- int start = Utils.getValueStart(n);
- int end = Utils.getValueEnd(n);
- if(start < 0) return null;
-
- text = getDocument().get(start, end - start);
- bStart = offset - start;
- bEnd = offset - start;
- }
- StringBuffer sb = new StringBuffer(text);
- //find start of bean property
- while (bStart >= 0) {
- if (!Character.isJavaIdentifierPart(sb.charAt(bStart)) &&
- sb.charAt(bStart) != '\\' && sb.charAt(bStart) != '/'
&&
- sb.charAt(bStart) != ':' && sb.charAt(bStart) != '-'
&&
- sb.charAt(bStart) != '.' && sb.charAt(bStart) != '_'
&&
- sb.charAt(bStart) != '%' && sb.charAt(bStart) != '?'
&&
- sb.charAt(bStart) != '&' && sb.charAt(bStart) != '=')
{
- bStart++;
- break;
- }
-
- if (bStart == 0) break;
- bStart--;
- }
- // find end of bean property
- while (bEnd >= 0 && bEnd < sb.length()) {
- if (!Character.isJavaIdentifierPart(sb.charAt(bEnd)) &&
- sb.charAt(bEnd) != '\\' && sb.charAt(bEnd) != '/'
&&
- sb.charAt(bEnd) != ':' && sb.charAt(bEnd) != '-'
&&
- sb.charAt(bEnd) != '.' && sb.charAt(bEnd) != '_'
&&
- sb.charAt(bEnd) != '%' && sb.charAt(bEnd) != '?'
&&
- sb.charAt(bEnd) != '&' && sb.charAt(bEnd) != '=') {
- break;
- }
- bEnd++;
- }
-
- final int propStart = bStart + Utils.getValueStart(n);
- final int propLength = bEnd - bStart;
-
- if (propStart > offset || propStart + propLength < offset) return null;
-
- return new Region(propStart,propLength);
- } catch (BadLocationException x) {
- //ignore
- return null;
- } finally {
- smw.dispose();
- }
- }
-
-}
Deleted:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/RoleNameHyperlink.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/RoleNameHyperlink.java 2009-09-25
15:33:04 UTC (rev 17753)
+++
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/RoleNameHyperlink.java 2009-09-25
15:57:36 UTC (rev 17754)
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and 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
- ******************************************************************************/
-package org.jboss.tools.common.text.ext.hyperlink;
-
-import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
-
-
-/**
- * @author Jeremy
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class RoleNameHyperlink extends JumpToHyperlink {
- protected String getDestinationAxis() {
- return "/web-app/security-role/role-name/"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- return Messages.BrowseToRoleNameDefinition;
- }
-
-}
Deleted:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/ServletNameHyperlink.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/ServletNameHyperlink.java 2009-09-25
15:33:04 UTC (rev 17753)
+++
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/ServletNameHyperlink.java 2009-09-25
15:57:36 UTC (rev 17754)
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and 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
- ******************************************************************************/
-package org.jboss.tools.common.text.ext.hyperlink;
-
-import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
-
-
-/**
- * @author Jeremy
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class ServletNameHyperlink extends JumpToHyperlink {
- protected String getDestinationAxis() {
- return "/web-app/servlet/servlet-name/"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- return Messages.BrowseToServletNameDefinition;
- }
-
-}
Deleted:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/TLDAttributeNameHyperlink.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/TLDAttributeNameHyperlink.java 2009-09-25
15:33:04 UTC (rev 17753)
+++
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/TLDAttributeNameHyperlink.java 2009-09-25
15:57:36 UTC (rev 17754)
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and 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
- ******************************************************************************/
-package org.jboss.tools.common.text.ext.hyperlink;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.jface.text.IRegion;
-import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
-import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
-import org.jboss.tools.common.text.ext.util.Utils;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @author Jeremy
- *
- */
-public class TLDAttributeNameHyperlink extends JumpToHyperlink {
- protected String getDestinationAxis() {
- return "/taglib/tag/attribute/name/"; //$NON-NLS-1$
- }
-
- protected NodeList getRootElementsToSearch (IRegion region) {
- StructuredModelWrapper smw = new StructuredModelWrapper();
- try {
- smw.init(getDocument());
- Document xmlDocument = smw.getDocument();
- if (xmlDocument == null) return null;
-
- Node n = Utils.findNodeForOffset(xmlDocument, region.getOffset());
-
- Element tagElement = null;
- while(n != null && tagElement == null) {
- n = n.getParentNode();
- if (n instanceof Element && validAxis(n, "/taglib/tag/")) {
//$NON-NLS-1$
- tagElement = (Element)n;
- }
- }
- if (tagElement == null)
- return null;
-
- return tagElement.getChildNodes();
- } finally {
- smw.dispose();
- }
- }
-
- private boolean validAxis(Node n, String validAxisEnding) {
- if (validAxisEnding == null || validAxisEnding.lastIndexOf('/') == -1) return
false;
- StringTokenizer st = new StringTokenizer(validAxisEnding, "/");
//$NON-NLS-1$
- List<String> tokens = new ArrayList<String>();
- while (st.hasMoreTokens()) {
- tokens.add(st.nextToken());
- }
- if (tokens.size() == 0) return false;
- Node currentElement = n;
- for (int i = tokens.size() - 1; i >= 0; i--) {
- if (currentElement == null || !(currentElement instanceof Element))
- return false;
- String token = (String)tokens.get(i);
- if (!token.equals(currentElement.getNodeName()))
- return false;
- currentElement = currentElement.getParentNode();
- }
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- return Messages.BrowseToTLDAttributeNameDeclaration;
- }
-
-}
Deleted:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/TaglibDefinitionFilesHyperlinkPartitioner.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/TaglibDefinitionFilesHyperlinkPartitioner.java 2009-09-25
15:33:04 UTC (rev 17753)
+++
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/TaglibDefinitionFilesHyperlinkPartitioner.java 2009-09-25
15:57:36 UTC (rev 17754)
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2009 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
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.text.ext.hyperlink;
-
-import org.eclipse.jface.text.IDocument;
-import org.jboss.tools.common.text.ext.hyperlink.xml.XMLClassHyperlinkPartitioner;
-import org.jboss.tools.common.text.ext.hyperlink.xml.XMLTextHyperlinkPartitioner;
-import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
-import org.jboss.tools.common.text.ext.util.Utils;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * @author mareshkau
- *
- */
-public class TaglibDefinitionFilesHyperlinkPartitioner extends
XMLTextHyperlinkPartitioner {
-
- public static final String TAGLIB_XML_PARTITION =
"org.jboss.tools.common.text.ext.xml.TAGLIB_XML"; //$NON-NLS-1$
- /* (non-Javadoc)
- * @see
org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlinkPartitioner#parse(org.eclipse.jface.text.IDocument,
org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion)
- */
- /**
- * @see
com.ibm.sse.editor.extensions.hyperlink.IHyperlinkPartitionRecognizer#recognize(org.eclipse.jface.text.IDocument,
com.ibm.sse.editor.extensions.hyperlink.IHyperlinkRegion)
- */
- @Override
- public boolean recognize(IDocument document, IHyperlinkRegion region) {
- StructuredModelWrapper smw = new StructuredModelWrapper();
- try {
- smw.init(document);
- Document xmlDocument = smw.getDocument();
- if (xmlDocument == null) return false;
-
- Node n = Utils.findNodeForOffset(xmlDocument, region.getOffset());
- return (n instanceof Text);
- } finally {
- smw.dispose();
- }
- }
-
- @Override
- protected String getPartitionType(String axis) {
- if(axis!=null && axis.contains("class")) { //$NON-NLS-1$
- return XMLClassHyperlinkPartitioner.XML_CLASS_PARTITION;
- }
- return TAGLIB_XML_PARTITION;
- }
-}