Author: dgolovin
Date: 2008-10-20 18:05:56 -0400 (Mon, 20 Oct 2008)
New Revision: 11018
Added:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/xhtmlStyleClassHiperlinkTests.xhtml
Modified:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/beanHyperlinkTests.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspXmlFormatTests.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2890 fixed, JUnit Test added
Modified:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/beanHyperlinkTests.jsp
===================================================================
---
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/beanHyperlinkTests.jsp 2008-10-20
21:14:12 UTC (rev 11017)
+++
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/beanHyperlinkTests.jsp 2008-10-20
22:05:56 UTC (rev 11018)
@@ -4,10 +4,8 @@
<jsp:getProperty property="property1" name="b1"/>
<jsp:setProperty property="property2" name="b1"/>
<html>
- <head>
- <link rel="" >
- </head>
-
-<a href="classHyperlinkTests.jsp">test</a>
+<body>
+ <a href="classHyperlinkTests.jsp">${b1.property2}</a>
+</body>
+</html>
-
Modified:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspXmlFormatTests.jsp
===================================================================
---
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspXmlFormatTests.jsp 2008-10-20
21:14:12 UTC (rev 11017)
+++
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspXmlFormatTests.jsp 2008-10-20
22:05:56 UTC (rev 11018)
@@ -15,7 +15,7 @@
</head>
<body>
<f:view>
-
+ <jsp:attribute name="locale">ru</jsp:attribute>
</f:view>
</body>
</html>
Added:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/xhtmlStyleClassHiperlinkTests.xhtml
===================================================================
---
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/xhtmlStyleClassHiperlinkTests.xhtml
(rev 0)
+++
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/xhtmlStyleClassHiperlinkTests.xhtml 2008-10-20
22:05:56 UTC (rev 11018)
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
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:s="http://jboss.com/products/seam/taglib">
+<head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
+ <title>s1</title>
+ <link href="stylesheet/style1.css" rel="stylesheet"
type="text/css" />
+</head>
+
+<body>
+ <f:view>
+ <h:outputText value="test" styleClass="style-class1" />
+ </f:view>
+</body>
+</html>
\ No newline at end of file
Property changes on:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/xhtmlStyleClassHiperlinkTests.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
===================================================================
---
trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-20
21:14:12 UTC (rev 11017)
+++
trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-20
22:05:56 UTC (rev 11018)
@@ -533,4 +533,28 @@
ITextSelection selection =
(ITextSelection)viewer.getSelectionProvider().getSelection();
assertEquals("<name>", selection.getText());
}
+
+ public static final String XHTML_STYLE_CLASS_NAME_TEST_FILE = OPENON_TEST_PROJECT +
"/WebContent/xhtmlStyleClassHiperlinkTests.xhtml";
+
+
+ public void testFacletsStyleClassOpenOnJbide2890() throws BadLocationException {
+ IEditorPart editor = WorkbenchUtils.openEditor(XHTML_STYLE_CLASS_NAME_TEST_FILE);
+ assertTrue(editor instanceof JSPMultiPageEditor);
+ JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
+ ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
+
+ IRegion reg = new
FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
+ "style-class1", true, true, false, false);
+ IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg,
false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ links[0].open();
+ JobUtils.waitForIdle();
+ editor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+
+ String fileName = editor.getEditorInput().getName();
+ assertTrue("style1.css".equals(fileName));
+ }
}