JBoss Tools SVN: r33695 - branches/jbosstools-3.2.x/ws/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-08-08 18:15:06 -0400 (Mon, 08 Aug 2011)
New Revision: 33695
Modified:
branches/jbosstools-3.2.x/ws/docs/reference/en-US/Book_Info.xml
Log:
updated for brew
Modified: branches/jbosstools-3.2.x/ws/docs/reference/en-US/Book_Info.xml
===================================================================
--- branches/jbosstools-3.2.x/ws/docs/reference/en-US/Book_Info.xml 2011-08-08 22:14:37 UTC (rev 33694)
+++ branches/jbosstools-3.2.x/ws/docs/reference/en-US/Book_Info.xml 2011-08-08 22:15:06 UTC (rev 33695)
@@ -7,7 +7,7 @@
<productname>JBoss Developer Studio</productname>
<productnumber>4.1</productnumber>
<edition>4.1.0</edition>
- <pubsnumber>8</pubsnumber>
+ <pubsnumber>9</pubsnumber>
<abstract>
<para>The JBoss Web Services User Guide explains how to use the JBoss Web Services module to implement web services in Java.</para>
</abstract>
14 years, 8 months
JBoss Tools SVN: r33694 - trunk/ws/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-08-08 18:14:37 -0400 (Mon, 08 Aug 2011)
New Revision: 33694
Modified:
trunk/ws/docs/reference/en-US/Book_Info.xml
Log:
updated for brew
Modified: trunk/ws/docs/reference/en-US/Book_Info.xml
===================================================================
--- trunk/ws/docs/reference/en-US/Book_Info.xml 2011-08-08 22:14:13 UTC (rev 33693)
+++ trunk/ws/docs/reference/en-US/Book_Info.xml 2011-08-08 22:14:37 UTC (rev 33694)
@@ -7,7 +7,7 @@
<productname>JBoss Developer Studio</productname>
<productnumber>4.1</productnumber>
<edition>4.1.0</edition>
- <pubsnumber>8</pubsnumber>
+ <pubsnumber>9</pubsnumber>
<abstract>
<para>The JBoss Web Services User Guide explains how to use the JBoss Web Services module to implement web services in Java.</para>
</abstract>
14 years, 8 months
JBoss Tools SVN: r33693 - trunk/ws/docs/restful_reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-08-08 18:14:13 -0400 (Mon, 08 Aug 2011)
New Revision: 33693
Modified:
trunk/ws/docs/restful_reference/en-US/proc-jbt-new_dynamic_web_project.xml
trunk/ws/docs/restful_reference/en-US/proc-jbt-test_JAX-RS.xml
trunk/ws/docs/restful_reference/en-US/proc-jbt-test_resteasy_JAX-RS.xml
Log:
updated with small corrections
Modified: trunk/ws/docs/restful_reference/en-US/proc-jbt-new_dynamic_web_project.xml
===================================================================
--- trunk/ws/docs/restful_reference/en-US/proc-jbt-new_dynamic_web_project.xml 2011-08-08 22:13:58 UTC (rev 33692)
+++ trunk/ws/docs/restful_reference/en-US/proc-jbt-new_dynamic_web_project.xml 2011-08-08 22:14:13 UTC (rev 33693)
@@ -242,7 +242,7 @@
</table>
<table id="table-jbt-new_dynamic_web_project_03">
- <title>New Dymanic Project - Configuration</title>
+ <title>New Dynamic Project - Configuration</title>
<tgroup cols='2' align='left' colsep='1' rowsep='1'>
<colspec colname='c1' colwidth="1*"/>
<colspec colname='c2' colwidth="2*"/>
@@ -333,7 +333,7 @@
<!-- <para>&HORIZ_LINE;</para>-->
</step>
<step>
- <title>Define the source and ouput folders</title>
+ <title>Define the source and output folders</title>
<para>
Define the Dynamic Web Project source and output folders by adding or editing folders as required.
</para>
Modified: trunk/ws/docs/restful_reference/en-US/proc-jbt-test_JAX-RS.xml
===================================================================
--- trunk/ws/docs/restful_reference/en-US/proc-jbt-test_JAX-RS.xml 2011-08-08 22:13:58 UTC (rev 33692)
+++ trunk/ws/docs/restful_reference/en-US/proc-jbt-test_JAX-RS.xml 2011-08-08 22:14:13 UTC (rev 33693)
@@ -91,7 +91,7 @@
<para>Click the <guibutton>Invoke</guibutton> button.</para>
<formalpara><title>Result:</title>
<para>
- The <guilabel>Response Headers</guilabel> area indicated that a record was created and lists the location as <ulink url="http://localhost:8080/simple/rest-services/cuntomers/1">http://localhost:8080/simple/rest-services/cuntomers/1</ulink> as shown in <xref linkend="figure-jbt-test_resteasy_JAX-RS_05"/>.
+ The <guilabel>Response Headers</guilabel> area indicated that a record was created and lists the location as <ulink url="http://localhost:8080/simple/rest-services/customers/1">http://localhost:8080/simple/rest-services/customers/1</ulink> as shown in <xref linkend="figure-jbt-test_resteasy_JAX-RS_05"/>.
</para>
</formalpara>
<figure id="figure-jbt-test_resteasy_JAX-RS_05">
Modified: trunk/ws/docs/restful_reference/en-US/proc-jbt-test_resteasy_JAX-RS.xml
===================================================================
--- trunk/ws/docs/restful_reference/en-US/proc-jbt-test_resteasy_JAX-RS.xml 2011-08-08 22:13:58 UTC (rev 33692)
+++ trunk/ws/docs/restful_reference/en-US/proc-jbt-test_resteasy_JAX-RS.xml 2011-08-08 22:14:13 UTC (rev 33693)
@@ -91,7 +91,7 @@
<para>Click the <guibutton>Invoke</guibutton> button.</para>
<formalpara><title>Result:</title>
<para>
- The <guilabel>Response Headers</guilabel> area indicated that a record was created and lists the location as <ulink url="http://localhost:8080/simple/rest-services/cuntomers/1">http://localhost:8080/simple/rest-services/cuntomers/1</ulink> as shown in <xref linkend="figure-jbt-test_resteasy_JAX-RS_05"/>.
+ The <guilabel>Response Headers</guilabel> area indicated that a record was created and lists the location as <ulink url="http://localhost:8080/simple/rest-services/customers/1">http://localhost:8080/simple/rest-services/customers/1</ulink> as shown in <xref linkend="figure-jbt-test_resteasy_JAX-RS_05"/>.
</para>
</formalpara>
<figure id="figure-jbt-test_resteasy_JAX-RS_05">
14 years, 8 months
JBoss Tools SVN: r33692 - trunk/ws/docs/soap_reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-08-08 18:13:58 -0400 (Mon, 08 Aug 2011)
New Revision: 33692
Modified:
trunk/ws/docs/soap_reference/en-US/proc-jbt-new_dynamic_web_project.xml
trunk/ws/docs/soap_reference/en-US/topdown.xml
Log:
updated with small corrections
Modified: trunk/ws/docs/soap_reference/en-US/proc-jbt-new_dynamic_web_project.xml
===================================================================
--- trunk/ws/docs/soap_reference/en-US/proc-jbt-new_dynamic_web_project.xml 2011-08-08 22:03:29 UTC (rev 33691)
+++ trunk/ws/docs/soap_reference/en-US/proc-jbt-new_dynamic_web_project.xml 2011-08-08 22:13:58 UTC (rev 33692)
@@ -242,7 +242,7 @@
</table>
<table id="table-jbt-new_dynamic_web_project_03">
- <title>New Dymanic Project - Configuration</title>
+ <title>New Dynamic Project - Configuration</title>
<tgroup cols='2' align='left' colsep='1' rowsep='1'>
<colspec colname='c1' colwidth="1*"/>
<colspec colname='c2' colwidth="2*"/>
@@ -333,7 +333,7 @@
<!-- <para>&HORIZ_LINE;</para>-->
</step>
<step>
- <title>Define the source and ouput folders</title>
+ <title>Define the source and output folders</title>
<para>
Define the Dynamic Web Project source and output folders by adding or editing folders as required.
</para>
Modified: trunk/ws/docs/soap_reference/en-US/topdown.xml
===================================================================
--- trunk/ws/docs/soap_reference/en-US/topdown.xml 2011-08-08 22:03:29 UTC (rev 33691)
+++ trunk/ws/docs/soap_reference/en-US/topdown.xml 2011-08-08 22:13:58 UTC (rev 33692)
@@ -172,7 +172,7 @@
</guilabel>
and
<guilabel>
- Applicaiton Class
+ Application Class
</guilabel>
fields with your specific classes, within the instructions in <xref linkend="simple_web_service" />.
</para>
@@ -317,7 +317,7 @@
</listitem>
<listitem>
<para>
- <emphasis> <property>Package name</property> </emphasis> : input a package name. You can click the Brown button to choose one. If you don't input a package name, system will generate one for you.
+ <emphasis> <property>Package name</property> </emphasis> : input a package name. You can click the Browse button to choose one. If you don't input a package name, system will generate one for you.
</para>
</listitem>
<listitem>
@@ -421,7 +421,7 @@
</guilabel>
and
<guilabel>
- Applicaiton Class
+ Application Class
</guilabel>
fields with your specific classes, within the instructions in <xref linkend="simple_web_service" />.
</para>
14 years, 8 months
JBoss Tools SVN: r33691 - branches/jbosstools-3.2.x/ws/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-08-08 18:03:29 -0400 (Mon, 08 Aug 2011)
New Revision: 33691
Modified:
branches/jbosstools-3.2.x/ws/docs/reference/en-US/proc-jbt-new_dynamic_web_project.xml
branches/jbosstools-3.2.x/ws/docs/reference/en-US/proc-jbt-test_JAX-RS.xml
branches/jbosstools-3.2.x/ws/docs/reference/en-US/proc-jbt-test_resteasy_JAX-RS.xml
branches/jbosstools-3.2.x/ws/docs/reference/en-US/topdown.xml
Log:
updated with small fixes from jjankovi
Modified: branches/jbosstools-3.2.x/ws/docs/reference/en-US/proc-jbt-new_dynamic_web_project.xml
===================================================================
--- branches/jbosstools-3.2.x/ws/docs/reference/en-US/proc-jbt-new_dynamic_web_project.xml 2011-08-08 21:22:48 UTC (rev 33690)
+++ branches/jbosstools-3.2.x/ws/docs/reference/en-US/proc-jbt-new_dynamic_web_project.xml 2011-08-08 22:03:29 UTC (rev 33691)
@@ -242,7 +242,7 @@
</table>
<table id="table-jbt-new_dynamic_web_project_03">
- <title>New Dymanic Project - Configuration</title>
+ <title>New Dynamic Project - Configuration</title>
<tgroup cols='2' align='left' colsep='1' rowsep='1'>
<colspec colname='c1' colwidth="1*"/>
<colspec colname='c2' colwidth="2*"/>
@@ -333,7 +333,7 @@
<!-- <para>&HORIZ_LINE;</para>-->
</step>
<step>
- <title>Define the source and ouput folders</title>
+ <title>Define the source and output folders</title>
<para>
Define the Dynamic Web Project source and output folders by adding or editing folders as required.
</para>
Modified: branches/jbosstools-3.2.x/ws/docs/reference/en-US/proc-jbt-test_JAX-RS.xml
===================================================================
--- branches/jbosstools-3.2.x/ws/docs/reference/en-US/proc-jbt-test_JAX-RS.xml 2011-08-08 21:22:48 UTC (rev 33690)
+++ branches/jbosstools-3.2.x/ws/docs/reference/en-US/proc-jbt-test_JAX-RS.xml 2011-08-08 22:03:29 UTC (rev 33691)
@@ -91,7 +91,7 @@
<para>Click the <guibutton>Invoke</guibutton> button.</para>
<formalpara><title>Result:</title>
<para>
- The <guilabel>Response Headers</guilabel> area indicated that a record was created and lists the location as <ulink url="http://localhost:8080/simple/rest-services/cuntomers/1">http://localhost:8080/simple/rest-services/cuntomers/1</ulink> as shown in <xref linkend="figure-jbt-test_resteasy_JAX-RS_05"/>.
+ The <guilabel>Response Headers</guilabel> area indicated that a record was created and lists the location as <ulink url="http://localhost:8080/simple/rest-services/customers/1">http://localhost:8080/simple/rest-services/customers/1</ulink> as shown in <xref linkend="figure-jbt-test_resteasy_JAX-RS_05"/>.
</para>
</formalpara>
<figure id="figure-jbt-test_resteasy_JAX-RS_05">
Modified: branches/jbosstools-3.2.x/ws/docs/reference/en-US/proc-jbt-test_resteasy_JAX-RS.xml
===================================================================
--- branches/jbosstools-3.2.x/ws/docs/reference/en-US/proc-jbt-test_resteasy_JAX-RS.xml 2011-08-08 21:22:48 UTC (rev 33690)
+++ branches/jbosstools-3.2.x/ws/docs/reference/en-US/proc-jbt-test_resteasy_JAX-RS.xml 2011-08-08 22:03:29 UTC (rev 33691)
@@ -91,7 +91,7 @@
<para>Click the <guibutton>Invoke</guibutton> button.</para>
<formalpara><title>Result:</title>
<para>
- The <guilabel>Response Headers</guilabel> area indicated that a record was created and lists the location as <ulink url="http://localhost:8080/simple/rest-services/cuntomers/1">http://localhost:8080/simple/rest-services/cuntomers/1</ulink> as shown in <xref linkend="figure-jbt-test_resteasy_JAX-RS_05"/>.
+ The <guilabel>Response Headers</guilabel> area indicated that a record was created and lists the location as <ulink url="http://localhost:8080/simple/rest-services/customers/1">http://localhost:8080/simple/rest-services/customers/1</ulink> as shown in <xref linkend="figure-jbt-test_resteasy_JAX-RS_05"/>.
</para>
</formalpara>
<figure id="figure-jbt-test_resteasy_JAX-RS_05">
Modified: branches/jbosstools-3.2.x/ws/docs/reference/en-US/topdown.xml
===================================================================
--- branches/jbosstools-3.2.x/ws/docs/reference/en-US/topdown.xml 2011-08-08 21:22:48 UTC (rev 33690)
+++ branches/jbosstools-3.2.x/ws/docs/reference/en-US/topdown.xml 2011-08-08 22:03:29 UTC (rev 33691)
@@ -172,7 +172,7 @@
</guilabel>
and
<guilabel>
- Applicaiton Class
+ Application Class
</guilabel>
fields with your specific classes, within the instructions in <xref linkend="simple_web_service" />.
</para>
@@ -317,7 +317,7 @@
</listitem>
<listitem>
<para>
- <emphasis> <property>Package name</property> </emphasis> : input a package name. You can click the Brown button to choose one. If you don't input a package name, system will generate one for you.
+ <emphasis> <property>Package name</property> </emphasis> : input a package name. You can click the Browse button to choose one. If you don't input a package name, system will generate one for you.
</para>
</listitem>
<listitem>
@@ -421,7 +421,7 @@
</guilabel>
and
<guilabel>
- Applicaiton Class
+ Application Class
</guilabel>
fields with your specific classes, within the instructions in <xref linkend="simple_web_service" />.
</para>
14 years, 8 months
JBoss Tools SVN: r33690 - in trunk: common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-08-08 17:22:48 -0400 (Mon, 08 Aug 2011)
New Revision: 33690
Added:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/ChainTextHover.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/InfoHoverMessages.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/InfoHoverMessages.properties
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/TextHoverInformationProvider.java
Removed:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/TextHoverInformationProvider.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ChainTextHover.java
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHoverMessages.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHoverMessages.properties
Log:
JBIDE-9448
EL tooltip doesn't work
Issue is fixed.
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/META-INF/MANIFEST.MF 2011-08-08 19:48:27 UTC (rev 33689)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/META-INF/MANIFEST.MF 2011-08-08 21:22:48 UTC (rev 33690)
@@ -8,6 +8,7 @@
Bundle-Localization: plugin
Export-Package: org.jboss.tools.common.text.xml,
org.jboss.tools.common.text.xml.contentassist,
+ org.jboss.tools.common.text.xml.info,
org.jboss.tools.common.text.xml.internal.ui.preferencies,
org.jboss.tools.common.text.xml.ui,
org.jboss.tools.common.text.xml.ui.xpl,
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java 2011-08-08 19:48:27 UTC (rev 33689)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java 2011-08-08 21:22:48 UTC (rev 33690)
@@ -26,6 +26,7 @@
import org.eclipse.jface.text.ITextHover;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
+import org.eclipse.jface.text.information.IInformationProvider;
import org.eclipse.jface.text.quickassist.IQuickAssistAssistant;
import org.eclipse.jface.text.quickassist.QuickAssistAssistant;
import org.eclipse.jface.text.source.ISourceViewer;
@@ -33,22 +34,21 @@
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
import org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter;
import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
import org.eclipse.wst.sse.ui.internal.taginfo.AnnotationHoverProcessor;
-import org.eclipse.wst.sse.ui.internal.taginfo.BestMatchHover;
-import org.eclipse.wst.sse.ui.internal.taginfo.ProblemAnnotationHoverProcessor;
import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
import org.eclipse.wst.xml.ui.internal.contentassist.XMLStructuredContentAssistProcessor;
import org.jboss.tools.common.text.xml.contentassist.ProposalSorter;
+import org.jboss.tools.common.text.xml.info.ChainTextHover;
import org.jboss.tools.common.text.xml.xpl.MarkerProblemAnnotationHoverProcessor;
-
+import org.jboss.tools.common.text.xml.info.TextHoverInformationProvider;
/**
* @author Igels
*/
@@ -185,21 +185,76 @@
return findDeclaredMethod(sc, name, paramTypes);
}
+ /**
+ * Create documentation hovers based on hovers contributed via
+ * <code>org.eclipse.wst.sse.ui.editorConfiguration</code> extension point
+ *
+ * Copied from
+ * {@link org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration} because
+ * of private modifier
+ *
+ * @param partitionType
+ * @return
+ */
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ private ITextHover[] createDocumentationHovers(String partitionType) {
+ List extendedTextHover = ExtendedConfigurationBuilder.getInstance()
+ .getConfigurations(
+ ExtendedConfigurationBuilder.DOCUMENTATIONTEXTHOVER,
+ partitionType);
+ return (ITextHover[]) extendedTextHover
+ .toArray(new ITextHover[extendedTextHover.size()]);
+ }
+
@Override
- public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
- TextHoverManager.TextHoverDescriptor[] hoverDescs = SSEUIPlugin.getDefault().getTextHoverManager().getTextHovers();
+ protected IInformationProvider getInformationProvider(
+ ISourceViewer sourceViewer, String partitionType) {
+ ITextHover[] hovers = createDocumentationHovers(partitionType);
+ if (hovers == null) {
+ hovers = new ITextHover[] {new ChainTextHover(
+ new ITextHover[0])};
+ }
+
+ return new TextHoverInformationProvider(new ChainTextHover(
+ hovers));
+ }
+
+ @Override
+ public ITextHover getTextHover(ISourceViewer sourceViewer,
+ String contentType, int stateMask) {
+ ITextHover textHover = null;
+
+ /*
+ * Returns a default problem, annotation, and best match hover depending
+ * on stateMask
+ */
+ TextHoverManager.TextHoverDescriptor[] hoverDescs = SSEUIPlugin
+ .getDefault().getTextHoverManager().getTextHovers();
int i = 0;
- while (i < hoverDescs.length) {
- if (hoverDescs[i].isEnabled() && computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
+ while (i < hoverDescs.length && textHover == null) {
+ if (hoverDescs[i].isEnabled()
+ && computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
String hoverType = hoverDescs[i].getId();
- if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType)){
- return new MarkerProblemAnnotationHoverProcessor();
+ if (TextHoverManager.PROBLEM_HOVER.equalsIgnoreCase(hoverType))
+// textHover = new ProblemAnnotationHoverProcessor();
+ textHover = new MarkerProblemAnnotationHoverProcessor();
+ else if (TextHoverManager.ANNOTATION_HOVER
+ .equalsIgnoreCase(hoverType))
+ textHover = new AnnotationHoverProcessor();
+ else if (TextHoverManager.COMBINATION_HOVER
+ .equalsIgnoreCase(hoverType)) {
+ textHover = new ChainTextHover(createDocumentationHovers(contentType));
+ } else if (TextHoverManager.DOCUMENTATION_HOVER
+ .equalsIgnoreCase(hoverType)) {
+ ITextHover[] hovers = createDocumentationHovers(contentType);
+ if (hovers.length > 0) {
+ textHover = hovers[0];
+ }
}
}
i++;
}
-
- return super.getTextHover(sourceViewer, contentType, stateMask);
+ return textHover;
}
private IQuickAssistAssistant fQuickAssistant = null;
Copied: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/ChainTextHover.java (from rev 33688, trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ChainTextHover.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/ChainTextHover.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/ChainTextHover.java 2011-08-08 21:22:48 UTC (rev 33690)
@@ -0,0 +1,207 @@
+/*******************************************************************************
+ * Copyright (c) 2009-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.common.text.xml.info;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.text.IInformationControlCreator;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.ITextHoverExtension;
+import org.eclipse.jface.text.ITextHoverExtension2;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.taginfo.AnnotationHoverProcessor;
+import org.eclipse.wst.sse.ui.internal.taginfo.DebugInfoHoverProcessor;
+import org.jboss.tools.common.text.xml.XmlEditorPlugin;
+import org.jboss.tools.common.text.xml.xpl.MarkerProblemAnnotationHoverProcessor;
+
+
+/**
+ * Provides the best hover help documentation (by using other hover help
+ * processors) Priority of hover help processors is: ProblemHoverProcessor,
+ * FaceletTagInfoProcessor, TagInfoProcessor, AnnotationHoverProcessor
+ *
+ * The processors are acquired in order of their priorities. If a hover doesn'n returns an information
+ * (i.e. returns null as a display string) the next processor will be acquired.
+ *
+ * @author Victor Rubezhny
+ *
+ */
+@SuppressWarnings("restriction")
+public class ChainTextHover implements ITextHover, ITextHoverExtension, ITextHoverExtension2 {
+ private ITextHover fBestMatchHover; // current best match text hover
+ private ITextHover[] fTagInfoHovers; // documentation/information hover
+ private List<ITextHover> fTextHovers; // list of text hovers to consider in best
+ // match
+
+ public ChainTextHover(ITextHover infoTagHover) {
+ this(new ITextHover[]{infoTagHover});
+ }
+
+ public ChainTextHover(ITextHover[] infoTagHovers) {
+ fTagInfoHovers = infoTagHovers;
+ }
+
+ /**
+ * Create a list of text hovers applicable to this best match hover
+ * processor
+ *
+ * @return List of ITextHover - in abstract class this is empty list
+ */
+ private List<ITextHover> createTextHoversList() {
+ List<ITextHover> hoverList = new ArrayList<ITextHover>();
+ // if currently debugging, then add the debug hover to the list of
+ // best match
+ if (Logger.isTracing(DebugInfoHoverProcessor.TRACEFILTER)) {
+ hoverList.add(new DebugInfoHoverProcessor());
+ }
+
+// hoverList.add(new ProblemAnnotationHoverProcessor());
+ hoverList.add(new MarkerProblemAnnotationHoverProcessor());
+
+ if (fTagInfoHovers != null) {
+ for (int i = 0; i < fTagInfoHovers.length; i++) {
+// if (fTagInfoHovers[i] instanceof FaceletTagInfoHoverProcessor) {
+ if (fTagInfoHovers[i].getClass().getName().startsWith("org.jboss.tools.")) {
+ hoverList.add(fTagInfoHovers[i]);
+ }
+ }
+ for (int i = 0; i < fTagInfoHovers.length; i++) {
+// if (!(fTagInfoHovers[i] instanceof FaceletTagInfoHoverProcessor)) {
+ if (!(fTagInfoHovers[i].getClass().getName().startsWith("org.jboss.tools."))) {
+ hoverList.add(fTagInfoHovers[i]);
+ }
+ }
+ }
+ hoverList.add(new AnnotationHoverProcessor());
+ return hoverList;
+ }
+
+ public IInformationControlCreator getHoverControlCreator() {
+ IInformationControlCreator creator = null;
+
+ if (fBestMatchHover instanceof ITextHoverExtension) {
+ creator = ((ITextHoverExtension) fBestMatchHover).getHoverControlCreator();
+ }
+ return creator;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.text.ITextHover#getHoverInfo(org.eclipse.jface.text.ITextViewer,
+ * org.eclipse.jface.text.IRegion)
+ */
+ public String getHoverInfo(ITextViewer viewer, IRegion hoverRegion) {
+ String displayInfo = null;
+
+ // already have a best match hover picked out from getHoverRegion call
+ if (fBestMatchHover != null) {
+ try {
+ displayInfo = fBestMatchHover.getHoverInfo(viewer, hoverRegion);
+ } catch (Exception e) {
+ XmlEditorPlugin.getPluginLog().logError(InfoHoverMessages.InfoHoover_error_gettingInfo, e);
+ }
+ }
+ // either had no best match hover or best match hover returned null
+ if (displayInfo == null) {
+ // go through the list of text hovers and return first display string
+ Iterator<ITextHover> i = getTextHovers().iterator();
+ while ((i.hasNext()) && (displayInfo == null)) {
+ ITextHover hover = (ITextHover) i.next();
+ try {
+ if(hover instanceof ITextHoverExtension2) {
+ Object displayInfoObject = ((ITextHoverExtension2)hover).getHoverInfo2(viewer, hoverRegion);
+ if(displayInfoObject!=null) {
+ displayInfo = displayInfoObject.toString();
+ }
+ } else {
+ displayInfo = hover.getHoverInfo(viewer, hoverRegion);
+ }
+ } catch (Exception e) {
+ XmlEditorPlugin.getPluginLog().logError(InfoHoverMessages.InfoHoover_error_gettingInfo, e);
+ }
+ }
+ }
+ return displayInfo;
+ }
+
+ public Object getHoverInfo2(ITextViewer viewer, IRegion hoverRegion) {
+ Object objectInfo = null;
+
+ // already have a best match hover picked out from getHoverRegion call
+ if (fBestMatchHover != null) {
+ try {
+ if (fBestMatchHover instanceof ITextHoverExtension2) {
+ objectInfo = ((ITextHoverExtension2) fBestMatchHover).getHoverInfo2(viewer, hoverRegion);
+ } else {
+ objectInfo = fBestMatchHover.getHoverInfo(viewer, hoverRegion);
+ }
+ } catch (Exception e) {
+ XmlEditorPlugin.getPluginLog().logError(InfoHoverMessages.InfoHoover_error_gettingInfo, e);
+ }
+ }
+ // either had no best match hover or best match hover returned null
+ if (objectInfo == null) {
+ // go through the list of text hovers and return first display string
+ Iterator<ITextHover> i = getTextHovers().iterator();
+ while ((i.hasNext()) && (objectInfo == null)) {
+ ITextHover hover = (ITextHover) i.next();
+ try {
+ if(hover instanceof ITextHoverExtension2) {
+ objectInfo = ((ITextHoverExtension2)hover).getHoverInfo2(viewer, hoverRegion);
+ } else {
+ objectInfo = hover.getHoverInfo(viewer, hoverRegion);
+ }
+ } catch (Exception e) {
+ XmlEditorPlugin.getPluginLog().logError(InfoHoverMessages.InfoHoover_error_gettingInfo, e);
+ }
+ }
+ }
+ return objectInfo;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer,
+ * int)
+ */
+ public IRegion getHoverRegion(ITextViewer viewer, int offset) {
+ IRegion hoverRegion = null;
+
+ // go through list of text hovers and return first hover region
+ ITextHover hover = null;
+ Iterator<ITextHover> i = getTextHovers().iterator();
+ while ((i.hasNext()) && (hoverRegion == null)) {
+ hover = i.next();
+ hoverRegion = hover.getHoverRegion(viewer, offset);
+ }
+
+ // store the text hover processor that found region
+ if (hoverRegion != null)
+ fBestMatchHover = hover;
+ else
+ fBestMatchHover = null;
+
+ return hoverRegion;
+ }
+
+ private List<ITextHover> getTextHovers() {
+ if (fTextHovers == null) {
+ fTextHovers = createTextHoversList();
+ }
+ return fTextHovers;
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/ChainTextHover.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/InfoHoverMessages.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/InfoHoverMessages.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/InfoHoverMessages.java 2011-08-08 21:22:48 UTC (rev 33690)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * 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.common.text.xml.info;
+
+import org.eclipse.osgi.util.NLS;
+
+public class InfoHoverMessages extends NLS {
+
+ private static final String BUNDLE_NAME= InfoHoverMessages.class.getName();
+
+ private InfoHoverMessages() {
+ // Do not instantiate
+ }
+
+// public static String ELInfoHover_noAttachments; //
+// public static String ELInfoHover_noAttachedJavadoc; //
+// public static String ELInfoHover_noAttachedJavaSource; //
+// public static String ELInfoHover_noInformation; //
+// public static String ELInfoHover_error_gettingJavadoc; //
+ public static String InfoHoover_error_gettingInfo; //
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, InfoHoverMessages.class);
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/InfoHoverMessages.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/InfoHoverMessages.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/InfoHoverMessages.properties (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/InfoHoverMessages.properties 2011-08-08 21:22:48 UTC (rev 33690)
@@ -0,0 +1 @@
+InfoHoover_error_gettingInfo=<em>Note: An exception occurred while getting the Hover Info. See log for details.</em>
\ No newline at end of file
Property changes on: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/InfoHoverMessages.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/TextHoverInformationProvider.java (from rev 33604, trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/TextHoverInformationProvider.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/TextHoverInformationProvider.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/TextHoverInformationProvider.java 2011-08-08 21:22:48 UTC (rev 33690)
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2009-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.common.text.xml.info;
+
+import org.eclipse.jface.text.IInformationControlCreator;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.ITextHoverExtension2;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.information.IInformationProvider;
+import org.eclipse.jface.text.information.IInformationProviderExtension;
+import org.eclipse.jface.text.information.IInformationProviderExtension2;
+
+/**
+ *
+ * @author Victor Rubezhny
+ *
+ */
+public class TextHoverInformationProvider implements IInformationProvider, IInformationProviderExtension, IInformationProviderExtension2 {
+ private ITextHover fTextHover;
+
+ public TextHoverInformationProvider(ITextHover hover) {
+ fTextHover = hover;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.text.information.IInformationProvider#getInformation(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
+ */
+ public String getInformation(ITextViewer textViewer, IRegion subject) {
+ return (String) getInformation2(textViewer, subject);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.text.information.IInformationProviderExtension#getInformation2(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
+ */
+ public Object getInformation2(ITextViewer textViewer, IRegion subject) {
+ return (fTextHover instanceof ITextHoverExtension2 ?
+ ((ITextHoverExtension2)fTextHover).getHoverInfo2(textViewer, subject) :
+ fTextHover.getHoverInfo(textViewer, subject));
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.text.information.IInformationProviderExtension2#getInformationPresenterControlCreator()
+ */
+ public IInformationControlCreator getInformationPresenterControlCreator() {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.text.information.IInformationProvider#getSubject(org.eclipse.jface.text.ITextViewer, int)
+ */
+ public IRegion getSubject(ITextViewer textViewer, int offset) {
+ return fTextHover.getHoverRegion(textViewer, offset);
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/TextHoverInformationProvider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java 2011-08-08 19:48:27 UTC (rev 33689)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java 2011-08-08 21:22:48 UTC (rev 33690)
@@ -52,9 +52,10 @@
import org.jboss.tools.common.text.ext.hyperlink.HyperlinkDetector;
import org.jboss.tools.common.text.xml.JBDSQuickAssistProcessor;
import org.jboss.tools.common.text.xml.contentassist.ProposalSorter;
+import org.jboss.tools.common.text.xml.info.ChainTextHover;
+import org.jboss.tools.common.text.xml.info.TextHoverInformationProvider;
import org.jboss.tools.common.text.xml.xpl.MarkerProblemAnnotationHoverProcessor;
import org.jboss.tools.jst.jsp.format.HTMLFormatProcessor;
-import org.jboss.tools.jst.jsp.jspeditor.info.ChainTextHover;
@SuppressWarnings("restriction")
public class HTMLTextViewerConfiguration extends
@@ -199,21 +200,14 @@
@Override
protected IInformationProvider getInformationProvider(
ISourceViewer sourceViewer, String partitionType) {
- ITextHover chainTextHover = null;
ITextHover[] hovers = createDocumentationHovers(partitionType);
if (hovers == null) {
hovers = new ITextHover[] {new ChainTextHover(
new ITextHover[0])};
}
- if (hovers.length == 1) {
- chainTextHover = hovers[0];
- } else {
- chainTextHover = new ChainTextHover(
- hovers);
- }
-
- return new TextHoverInformationProvider(chainTextHover);
+ return new TextHoverInformationProvider(new ChainTextHover(
+ hovers));
}
@Override
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java 2011-08-08 19:48:27 UTC (rev 33689)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java 2011-08-08 21:22:48 UTC (rev 33690)
@@ -45,8 +45,9 @@
import org.jboss.tools.common.text.ext.hyperlink.HyperlinkDetector;
import org.jboss.tools.common.text.xml.JBDSQuickAssistProcessor;
import org.jboss.tools.common.text.xml.contentassist.ProposalSorter;
+import org.jboss.tools.common.text.xml.info.ChainTextHover;
+import org.jboss.tools.common.text.xml.info.TextHoverInformationProvider;
import org.jboss.tools.common.text.xml.xpl.MarkerProblemAnnotationHoverProcessor;
-import org.jboss.tools.jst.jsp.jspeditor.info.ChainTextHover;
/**
* @author Igels
@@ -206,21 +207,14 @@
@Override
protected IInformationProvider getInformationProvider(
ISourceViewer sourceViewer, String partitionType) {
- ITextHover chainTextHover = null;
ITextHover[] hovers = createDocumentationHovers(partitionType);
if (hovers == null) {
hovers = new ITextHover[] {new ChainTextHover(
new ITextHover[0])};
}
- if (hovers.length == 1) {
- chainTextHover = hovers[0];
- } else {
- chainTextHover = new ChainTextHover(
- hovers);
- }
-
- return new TextHoverInformationProvider(chainTextHover);
+ return new TextHoverInformationProvider(new ChainTextHover(
+ hovers));
}
@Override
Deleted: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/TextHoverInformationProvider.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/TextHoverInformationProvider.java 2011-08-08 19:48:27 UTC (rev 33689)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/TextHoverInformationProvider.java 2011-08-08 21:22:48 UTC (rev 33690)
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.jsp;
-
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextHoverExtension2;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.IInformationProviderExtension;
-import org.eclipse.jface.text.information.IInformationProviderExtension2;
-
-/**
- *
- * @author Victor Rubezhny
- *
- */
-class TextHoverInformationProvider implements IInformationProvider, IInformationProviderExtension, IInformationProviderExtension2 {
- private ITextHover fTextHover;
-
- public TextHoverInformationProvider(ITextHover hover) {
- fTextHover = hover;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.information.IInformationProvider#getInformation(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
- */
- public String getInformation(ITextViewer textViewer, IRegion subject) {
- return (String) getInformation2(textViewer, subject);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.information.IInformationProviderExtension#getInformation2(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
- */
- public Object getInformation2(ITextViewer textViewer, IRegion subject) {
- return (fTextHover instanceof ITextHoverExtension2 ?
- ((ITextHoverExtension2)fTextHover).getHoverInfo2(textViewer, subject) :
- fTextHover.getHoverInfo(textViewer, subject));
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.information.IInformationProviderExtension2#getInformationPresenterControlCreator()
- */
- public IInformationControlCreator getInformationPresenterControlCreator() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.information.IInformationProvider#getSubject(org.eclipse.jface.text.ITextViewer, int)
- */
- public IRegion getSubject(ITextViewer textViewer, int offset) {
- return fTextHover.getHoverRegion(textViewer, offset);
- }
-}
Deleted: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ChainTextHover.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ChainTextHover.java 2011-08-08 19:48:27 UTC (rev 33689)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ChainTextHover.java 2011-08-08 21:22:48 UTC (rev 33690)
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009-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.jst.jsp.jspeditor.info;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextHoverExtension;
-import org.eclipse.jface.text.ITextHoverExtension2;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.taginfo.AnnotationHoverProcessor;
-import org.eclipse.wst.sse.ui.internal.taginfo.DebugInfoHoverProcessor;
-import org.jboss.tools.common.text.xml.xpl.MarkerProblemAnnotationHoverProcessor;
-import org.jboss.tools.jst.jsp.JspEditorPlugin;
-
-
-/**
- * Provides the best hover help documentation (by using other hover help
- * processors) Priority of hover help processors is: ProblemHoverProcessor,
- * FaceletTagInfoProcessor, TagInfoProcessor, AnnotationHoverProcessor
- *
- * The processors are acquired in order of their priorities. If a hover doesn'n returns an information
- * (i.e. returns null as a display string) the next processor will be acquired.
- *
- * @author Victor Rubezhny
- *
- */
-@SuppressWarnings("restriction")
-public class ChainTextHover implements ITextHover, ITextHoverExtension, ITextHoverExtension2 {
- private ITextHover fBestMatchHover; // current best match text hover
- private ITextHover[] fTagInfoHovers; // documentation/information hover
- private List<ITextHover> fTextHovers; // list of text hovers to consider in best
- // match
-
- public ChainTextHover(ITextHover infoTagHover) {
- this(new ITextHover[]{infoTagHover});
- }
-
- public ChainTextHover(ITextHover[] infoTagHovers) {
- fTagInfoHovers = infoTagHovers;
- }
-
- /**
- * Create a list of text hovers applicable to this best match hover
- * processor
- *
- * @return List of ITextHover - in abstract class this is empty list
- */
- private List<ITextHover> createTextHoversList() {
- List<ITextHover> hoverList = new ArrayList<ITextHover>();
- // if currently debugging, then add the debug hover to the list of
- // best match
- if (Logger.isTracing(DebugInfoHoverProcessor.TRACEFILTER)) {
- hoverList.add(new DebugInfoHoverProcessor());
- }
-
-// hoverList.add(new ProblemAnnotationHoverProcessor());
- hoverList.add(new MarkerProblemAnnotationHoverProcessor());
-
- if (fTagInfoHovers != null) {
- for (int i = 0; i < fTagInfoHovers.length; i++) {
- if (fTagInfoHovers[i] instanceof FaceletTagInfoHoverProcessor) {
- hoverList.add(fTagInfoHovers[i]);
- }
- }
- for (int i = 0; i < fTagInfoHovers.length; i++) {
- if (!(fTagInfoHovers[i] instanceof FaceletTagInfoHoverProcessor)) {
- hoverList.add(fTagInfoHovers[i]);
- }
- }
- }
- hoverList.add(new AnnotationHoverProcessor());
- return hoverList;
- }
-
- public IInformationControlCreator getHoverControlCreator() {
- IInformationControlCreator creator = null;
-
- if (fBestMatchHover instanceof ITextHoverExtension) {
- creator = ((ITextHoverExtension) fBestMatchHover).getHoverControlCreator();
- }
- return creator;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.ITextHover#getHoverInfo(org.eclipse.jface.text.ITextViewer,
- * org.eclipse.jface.text.IRegion)
- */
- public String getHoverInfo(ITextViewer viewer, IRegion hoverRegion) {
- String displayInfo = null;
-
- // already have a best match hover picked out from getHoverRegion call
- if (fBestMatchHover != null) {
- try {
- displayInfo = fBestMatchHover.getHoverInfo(viewer, hoverRegion);
- } catch (Exception e) {
- JspEditorPlugin.getPluginLog().logError(ELInfoHoverMessages.ELInfoHoover_error_gettingInfo, e);
- }
- }
- // either had no best match hover or best match hover returned null
- if (displayInfo == null) {
- // go through the list of text hovers and return first display string
- Iterator<ITextHover> i = getTextHovers().iterator();
- while ((i.hasNext()) && (displayInfo == null)) {
- ITextHover hover = (ITextHover) i.next();
- try {
- if(hover instanceof ITextHoverExtension2) {
- Object displayInfoObject = ((ITextHoverExtension2)hover).getHoverInfo2(viewer, hoverRegion);
- if(displayInfoObject!=null) {
- displayInfo = displayInfoObject.toString();
- }
- } else {
- displayInfo = hover.getHoverInfo(viewer, hoverRegion);
- }
- } catch (Exception e) {
- JspEditorPlugin.getPluginLog().logError(ELInfoHoverMessages.ELInfoHoover_error_gettingInfo, e);
- }
- }
- }
- return displayInfo;
- }
-
-
-
- @Override
- public Object getHoverInfo2(ITextViewer viewer, IRegion hoverRegion) {
- Object objectInfo = null;
-
- // already have a best match hover picked out from getHoverRegion call
- if (fBestMatchHover != null) {
- try {
- if (fBestMatchHover instanceof ITextHoverExtension2) {
- objectInfo = ((ITextHoverExtension2) fBestMatchHover).getHoverInfo2(viewer, hoverRegion);
- } else {
- objectInfo = fBestMatchHover.getHoverInfo(viewer, hoverRegion);
- }
- } catch (Exception e) {
- JspEditorPlugin.getPluginLog().logError(ELInfoHoverMessages.ELInfoHoover_error_gettingInfo, e);
- }
- }
- // either had no best match hover or best match hover returned null
- if (objectInfo == null) {
- // go through the list of text hovers and return first display string
- Iterator<ITextHover> i = getTextHovers().iterator();
- while ((i.hasNext()) && (objectInfo == null)) {
- ITextHover hover = (ITextHover) i.next();
- try {
- if(hover instanceof ITextHoverExtension2) {
- objectInfo = ((ITextHoverExtension2)hover).getHoverInfo2(viewer, hoverRegion);
- } else {
- objectInfo = hover.getHoverInfo(viewer, hoverRegion);
- }
- } catch (Exception e) {
- JspEditorPlugin.getPluginLog().logError(ELInfoHoverMessages.ELInfoHoover_error_gettingInfo, e);
- }
- }
- }
- return objectInfo;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer,
- * int)
- */
- public IRegion getHoverRegion(ITextViewer viewer, int offset) {
- IRegion hoverRegion = null;
-
- // go through list of text hovers and return first hover region
- ITextHover hover = null;
- Iterator<ITextHover> i = getTextHovers().iterator();
- while ((i.hasNext()) && (hoverRegion == null)) {
- hover = i.next();
- hoverRegion = hover.getHoverRegion(viewer, offset);
- }
-
- // store the text hover processor that found region
- if (hoverRegion != null)
- fBestMatchHover = hover;
- else
- fBestMatchHover = null;
-
- return hoverRegion;
- }
-
- private List<ITextHover> getTextHovers() {
- if (fTextHovers == null) {
- fTextHovers = createTextHoversList();
- }
- return fTextHovers;
- }
-}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHoverMessages.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHoverMessages.java 2011-08-08 19:48:27 UTC (rev 33689)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHoverMessages.java 2011-08-08 21:22:48 UTC (rev 33690)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2010-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,
@@ -25,7 +25,6 @@
public static String ELInfoHover_noAttachedJavaSource; //
public static String ELInfoHover_noInformation; //
public static String ELInfoHover_error_gettingJavadoc; //
- public static String ELInfoHoover_error_gettingInfo; //
static {
NLS.initializeMessages(BUNDLE_NAME, ELInfoHoverMessages.class);
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHoverMessages.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHoverMessages.properties 2011-08-08 19:48:27 UTC (rev 33689)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHoverMessages.properties 2011-08-08 21:22:48 UTC (rev 33690)
@@ -3,4 +3,3 @@
ELInfoHover_noAttachedJavadoc= <em>Note: This element has no attached Javadoc and the Javadoc could not be found in the attached source.</em>
ELInfoHover_noInformation= <em>Note: The Javadoc for this element could neither be found in the attached source nor the attached Javadoc.</em>
ELInfoHover_error_gettingJavadoc= <em>Note: An exception occurred while getting the Javadoc. See log for details.</em>
-ELInfoHoover_error_gettingInfo=<em>Note: An exception occurred while getting the Hover Info. See log for details.</em>
\ No newline at end of file
14 years, 8 months
JBoss Tools SVN: r33689 - workspace/bfitzpat/SOA_5_2_Examples.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2011-08-08 15:48:27 -0400 (Mon, 08 Aug 2011)
New Revision: 33689
Modified:
workspace/bfitzpat/SOA_5_2_Examples/aggregator_eclipse.zip
Log:
SOA-2988 - updating one of the example zips
Modified: workspace/bfitzpat/SOA_5_2_Examples/aggregator_eclipse.zip
===================================================================
(Binary files differ)
14 years, 8 months
JBoss Tools SVN: r33688 - in trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp: jspeditor/info and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-08-08 15:30:21 -0400 (Mon, 08 Aug 2011)
New Revision: 33688
Added:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHoverMessages.java
Removed:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHooverMessages.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ChainTextHover.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/FaceletTagInfoHoverProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/JavaStringELInfoHover.java
Log:
JBIDE-9448
EL tooltip doesn't work
Issue is fixed.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java 2011-08-08 19:30:03 UTC (rev 33687)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java 2011-08-08 19:30:21 UTC (rev 33688)
@@ -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.jsp;
@@ -21,7 +21,6 @@
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionAssistant;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.text.DefaultInformationControl;
import org.eclipse.jface.text.IInformationControl;
@@ -35,23 +34,19 @@
import org.eclipse.jface.text.quickassist.IQuickAssistAssistant;
import org.eclipse.jface.text.quickassist.QuickAssistAssistant;
import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
import org.eclipse.wst.html.core.text.IHTMLPartitions;
import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
import org.eclipse.wst.html.ui.internal.contentassist.HTMLStructuredContentAssistProcessor;
import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.correction.CompoundQuickAssistProcessor;
import org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter;
import org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy;
import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
import org.eclipse.wst.sse.ui.internal.taginfo.AnnotationHoverProcessor;
-import org.eclipse.wst.sse.ui.internal.taginfo.ProblemAnnotationHoverProcessor;
import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
import org.jboss.tools.common.text.ext.hyperlink.HyperlinkDetector;
@@ -195,15 +190,29 @@
partitionType);
ITextHover[] hovers = (ITextHover[]) extendedTextHover
.toArray(new ITextHover[extendedTextHover.size()]);
- return hovers;
+
+ ITextHover chainTextHover = new ChainTextHover(hovers);
+
+ return new ITextHover[] {chainTextHover};
}
@Override
protected IInformationProvider getInformationProvider(
ISourceViewer sourceViewer, String partitionType) {
-
- ITextHover chainTextHover = new ChainTextHover(
- createDocumentationHovers(partitionType));
+ ITextHover chainTextHover = null;
+ ITextHover[] hovers = createDocumentationHovers(partitionType);
+ if (hovers == null) {
+ hovers = new ITextHover[] {new ChainTextHover(
+ new ITextHover[0])};
+ }
+
+ if (hovers.length == 1) {
+ chainTextHover = hovers[0];
+ } else {
+ chainTextHover = new ChainTextHover(
+ hovers);
+ }
+
return new TextHoverInformationProvider(chainTextHover);
}
@@ -224,15 +233,16 @@
&& computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
String hoverType = hoverDescs[i].getId();
if (TextHoverManager.PROBLEM_HOVER.equalsIgnoreCase(hoverType))
- textHover = new ProblemAnnotationHoverProcessor();
+// textHover = new ProblemAnnotationHoverProcessor();
+ textHover = new MarkerProblemAnnotationHoverProcessor();
else if (TextHoverManager.ANNOTATION_HOVER
.equalsIgnoreCase(hoverType))
textHover = new AnnotationHoverProcessor();
else if (TextHoverManager.COMBINATION_HOVER
- .equalsIgnoreCase(hoverType))
- return new MarkerProblemAnnotationHoverProcessor();
- else if (TextHoverManager.DOCUMENTATION_HOVER
.equalsIgnoreCase(hoverType)) {
+ textHover = new ChainTextHover(createDocumentationHovers(contentType));
+ } else if (TextHoverManager.DOCUMENTATION_HOVER
+ .equalsIgnoreCase(hoverType)) {
ITextHover[] hovers = createDocumentationHovers(contentType);
if (hovers.length > 0) {
textHover = hovers[0];
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java 2011-08-08 19:30:03 UTC (rev 33687)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java 2011-08-08 19:30:21 UTC (rev 33688)
@@ -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.jsp;
@@ -22,6 +22,7 @@
import org.eclipse.jface.text.ITextHover;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
+import org.eclipse.jface.text.information.IInformationProvider;
import org.eclipse.jface.text.quickassist.IQuickAssistAssistant;
import org.eclipse.jface.text.quickassist.QuickAssistAssistant;
import org.eclipse.jface.text.source.ISourceViewer;
@@ -32,18 +33,20 @@
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
import org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter;
import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+import org.eclipse.wst.sse.ui.internal.taginfo.AnnotationHoverProcessor;
import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
import org.jboss.tools.common.text.ext.hyperlink.HyperlinkDetector;
import org.jboss.tools.common.text.xml.JBDSQuickAssistProcessor;
import org.jboss.tools.common.text.xml.contentassist.ProposalSorter;
import org.jboss.tools.common.text.xml.xpl.MarkerProblemAnnotationHoverProcessor;
+import org.jboss.tools.jst.jsp.jspeditor.info.ChainTextHover;
/**
* @author Igels
@@ -175,22 +178,89 @@
return new IContentAssistProcessor[0];
}
+ /**
+ * Create documentation hovers based on hovers contributed via
+ * <code>org.eclipse.wst.sse.ui.editorConfiguration</code> extension point
+ *
+ * Copied from
+ * {@link org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration} because
+ * of private modifier
+ *
+ * @param partitionType
+ * @return
+ */
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ private ITextHover[] createDocumentationHovers(String partitionType) {
+ List extendedTextHover = ExtendedConfigurationBuilder.getInstance()
+ .getConfigurations(
+ ExtendedConfigurationBuilder.DOCUMENTATIONTEXTHOVER,
+ partitionType);
+ ITextHover[] hovers = (ITextHover[]) extendedTextHover
+ .toArray(new ITextHover[extendedTextHover.size()]);
+
+ ITextHover chainTextHover = new ChainTextHover(hovers);
+
+ return new ITextHover[] {chainTextHover};
+ }
+
@Override
- public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
- TextHoverManager.TextHoverDescriptor[] hoverDescs = SSEUIPlugin.getDefault().getTextHoverManager().getTextHovers();
+ protected IInformationProvider getInformationProvider(
+ ISourceViewer sourceViewer, String partitionType) {
+ ITextHover chainTextHover = null;
+ ITextHover[] hovers = createDocumentationHovers(partitionType);
+ if (hovers == null) {
+ hovers = new ITextHover[] {new ChainTextHover(
+ new ITextHover[0])};
+ }
+
+ if (hovers.length == 1) {
+ chainTextHover = hovers[0];
+ } else {
+ chainTextHover = new ChainTextHover(
+ hovers);
+ }
+
+ return new TextHoverInformationProvider(chainTextHover);
+ }
+
+ @Override
+ public ITextHover getTextHover(ISourceViewer sourceViewer,
+ String contentType, int stateMask) {
+ ITextHover textHover = null;
+
+ /*
+ * Returns a default problem, annotation, and best match hover depending
+ * on stateMask
+ */
+ TextHoverManager.TextHoverDescriptor[] hoverDescs = SSEUIPlugin
+ .getDefault().getTextHoverManager().getTextHovers();
int i = 0;
- while (i < hoverDescs.length) {
- if (hoverDescs[i].isEnabled() && computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
+ while (i < hoverDescs.length && textHover == null) {
+ if (hoverDescs[i].isEnabled()
+ && computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
String hoverType = hoverDescs[i].getId();
- if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType)){
- return new MarkerProblemAnnotationHoverProcessor();
+ if (TextHoverManager.PROBLEM_HOVER.equalsIgnoreCase(hoverType))
+// textHover = new ProblemAnnotationHoverProcessor();
+ textHover = new MarkerProblemAnnotationHoverProcessor();
+ else if (TextHoverManager.ANNOTATION_HOVER
+ .equalsIgnoreCase(hoverType))
+ textHover = new AnnotationHoverProcessor();
+ else if (TextHoverManager.COMBINATION_HOVER
+ .equalsIgnoreCase(hoverType)) {
+ textHover = new ChainTextHover(createDocumentationHovers(contentType));
+ } else if (TextHoverManager.DOCUMENTATION_HOVER
+ .equalsIgnoreCase(hoverType)) {
+ ITextHover[] hovers = createDocumentationHovers(contentType);
+ if (hovers.length > 0) {
+ textHover = hovers[0];
+ }
}
}
i++;
}
-
- return super.getTextHover(sourceViewer, contentType, stateMask);
+ return textHover;
}
+
private IQuickAssistAssistant fQuickAssistant = null;
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ChainTextHover.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ChainTextHover.java 2011-08-08 19:30:03 UTC (rev 33687)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ChainTextHover.java 2011-08-08 19:30:21 UTC (rev 33688)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
+ * Copyright (c) 2009-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,
@@ -23,7 +23,7 @@
import org.eclipse.wst.sse.ui.internal.Logger;
import org.eclipse.wst.sse.ui.internal.taginfo.AnnotationHoverProcessor;
import org.eclipse.wst.sse.ui.internal.taginfo.DebugInfoHoverProcessor;
-import org.eclipse.wst.sse.ui.internal.taginfo.ProblemAnnotationHoverProcessor;
+import org.jboss.tools.common.text.xml.xpl.MarkerProblemAnnotationHoverProcessor;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
@@ -39,7 +39,7 @@
*
*/
@SuppressWarnings("restriction")
-public class ChainTextHover implements ITextHover, ITextHoverExtension {
+public class ChainTextHover implements ITextHover, ITextHoverExtension, ITextHoverExtension2 {
private ITextHover fBestMatchHover; // current best match text hover
private ITextHover[] fTagInfoHovers; // documentation/information hover
private List<ITextHover> fTextHovers; // list of text hovers to consider in best
@@ -67,7 +67,8 @@
hoverList.add(new DebugInfoHoverProcessor());
}
- hoverList.add(new ProblemAnnotationHoverProcessor());
+// hoverList.add(new ProblemAnnotationHoverProcessor());
+ hoverList.add(new MarkerProblemAnnotationHoverProcessor());
if (fTagInfoHovers != null) {
for (int i = 0; i < fTagInfoHovers.length; i++) {
@@ -108,7 +109,7 @@
try {
displayInfo = fBestMatchHover.getHoverInfo(viewer, hoverRegion);
} catch (Exception e) {
- JspEditorPlugin.getPluginLog().logError(ELInfoHooverMessages.ELInfoHoover_error_gettingInfo, e);
+ JspEditorPlugin.getPluginLog().logError(ELInfoHoverMessages.ELInfoHoover_error_gettingInfo, e);
}
}
// either had no best match hover or best match hover returned null
@@ -127,13 +128,51 @@
displayInfo = hover.getHoverInfo(viewer, hoverRegion);
}
} catch (Exception e) {
- JspEditorPlugin.getPluginLog().logError(ELInfoHooverMessages.ELInfoHoover_error_gettingInfo, e);
+ JspEditorPlugin.getPluginLog().logError(ELInfoHoverMessages.ELInfoHoover_error_gettingInfo, e);
}
}
}
return displayInfo;
}
+
+
+ @Override
+ public Object getHoverInfo2(ITextViewer viewer, IRegion hoverRegion) {
+ Object objectInfo = null;
+
+ // already have a best match hover picked out from getHoverRegion call
+ if (fBestMatchHover != null) {
+ try {
+ if (fBestMatchHover instanceof ITextHoverExtension2) {
+ objectInfo = ((ITextHoverExtension2) fBestMatchHover).getHoverInfo2(viewer, hoverRegion);
+ } else {
+ objectInfo = fBestMatchHover.getHoverInfo(viewer, hoverRegion);
+ }
+ } catch (Exception e) {
+ JspEditorPlugin.getPluginLog().logError(ELInfoHoverMessages.ELInfoHoover_error_gettingInfo, e);
+ }
+ }
+ // either had no best match hover or best match hover returned null
+ if (objectInfo == null) {
+ // go through the list of text hovers and return first display string
+ Iterator<ITextHover> i = getTextHovers().iterator();
+ while ((i.hasNext()) && (objectInfo == null)) {
+ ITextHover hover = (ITextHover) i.next();
+ try {
+ if(hover instanceof ITextHoverExtension2) {
+ objectInfo = ((ITextHoverExtension2)hover).getHoverInfo2(viewer, hoverRegion);
+ } else {
+ objectInfo = hover.getHoverInfo(viewer, hoverRegion);
+ }
+ } catch (Exception e) {
+ JspEditorPlugin.getPluginLog().logError(ELInfoHoverMessages.ELInfoHoover_error_gettingInfo, e);
+ }
+ }
+ }
+ return objectInfo;
+ }
+
/*
* (non-Javadoc)
*
Deleted: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHooverMessages.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHooverMessages.java 2011-08-08 19:30:03 UTC (rev 33687)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHooverMessages.java 2011-08-08 19:30:21 UTC (rev 33688)
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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.jst.jsp.jspeditor.info;
-
-import org.eclipse.osgi.util.NLS;
-
-public class ELInfoHooverMessages extends NLS {
-
- private static final String BUNDLE_NAME= ELInfoHooverMessages.class.getName();
-
- private ELInfoHooverMessages() {
- // Do not instantiate
- }
-
- public static String ELInfoHover_noAttachments; //
- public static String ELInfoHover_noAttachedJavadoc; //
- public static String ELInfoHover_noAttachedJavaSource; //
- public static String ELInfoHover_noInformation; //
- public static String ELInfoHover_error_gettingJavadoc; //
- public static String ELInfoHoover_error_gettingInfo; //
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, ELInfoHooverMessages.class);
- }
-}
Copied: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHoverMessages.java (from rev 33604, trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHooverMessages.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHoverMessages.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHoverMessages.java 2011-08-08 19:30:21 UTC (rev 33688)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.jst.jsp.jspeditor.info;
+
+import org.eclipse.osgi.util.NLS;
+
+public class ELInfoHoverMessages extends NLS {
+
+ private static final String BUNDLE_NAME= ELInfoHoverMessages.class.getName();
+
+ private ELInfoHoverMessages() {
+ // Do not instantiate
+ }
+
+ public static String ELInfoHover_noAttachments; //
+ public static String ELInfoHover_noAttachedJavadoc; //
+ public static String ELInfoHover_noAttachedJavaSource; //
+ public static String ELInfoHover_noInformation; //
+ public static String ELInfoHover_error_gettingJavadoc; //
+ public static String ELInfoHoover_error_gettingInfo; //
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, ELInfoHoverMessages.class);
+ }
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/ELInfoHoverMessages.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/FaceletTagInfoHoverProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/FaceletTagInfoHoverProcessor.java 2011-08-08 19:30:03 UTC (rev 33687)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/FaceletTagInfoHoverProcessor.java 2011-08-08 19:30:21 UTC (rev 33688)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2010-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,
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.jst.jsp.jspeditor.info;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
import java.util.List;
import java.util.Map;
@@ -18,10 +21,15 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jface.text.DefaultInformationControl;
import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IInformationControl;
+import org.eclipse.jface.text.IInformationControlCreator;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.TextPresentation;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
@@ -29,6 +37,8 @@
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.sse.ui.internal.derived.HTML2TextReader;
+import org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
import org.eclipse.wst.xml.ui.internal.taginfo.XMLTagInfoHoverProcessor;
@@ -44,13 +54,13 @@
import org.jboss.tools.common.el.core.resolver.ELSegment;
import org.jboss.tools.common.el.core.resolver.JavaMemberELSegmentImpl;
import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.jsp.contentassist.AbstractXMLContentAssistProcessor.TextRegion;
import org.jboss.tools.jst.jsp.contentassist.Utils;
-import org.jboss.tools.jst.jsp.contentassist.AbstractXMLContentAssistProcessor.TextRegion;
import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.KbQuery.Type;
import org.jboss.tools.jst.web.kb.PageContextFactory;
import org.jboss.tools.jst.web.kb.PageProcessor;
-import org.jboss.tools.jst.web.kb.KbQuery.Type;
import org.jboss.tools.jst.web.kb.taglib.INameSpace;
import org.w3c.dom.Node;
@@ -389,4 +399,41 @@
return ie;
}
+
+ private static final String EMPTY_STRING= ""; //$NON-NLS-1$
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.text.ITextHoverExtension#getHoverControlCreator()
+ */
+ public IInformationControlCreator getHoverControlCreator() {
+ return new IInformationControlCreator() {
+ public IInformationControl createInformationControl(Shell parent) {
+ return new DefaultInformationControl(parent, new HTMLTextPresenter(true) {
+
+ @Override
+ protected Reader createReader(String hoverInfo,
+ TextPresentation presentation) {
+ return new HTML2TextReader(new StringReader(hoverInfo), presentation) {
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.SubstitutionTextReader#computeSubstitution(int)
+ */
+ protected String computeSubstitution(int c) throws IOException {
+ String substitution = super.computeSubstitution(c);
+ if (substitution != null && substitution.length() > 0) {
+ // This cuts off all The tags from the text
+ if (substitution.startsWith("<") && substitution.endsWith(">")) { //$NON-NLS-1$ //$NON-NLS-2$
+ return EMPTY_STRING;
+ }
+ }
+ return substitution;
+ }
+ };
+ }
+ });
+ }
+ };
+ }
+
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/JavaStringELInfoHover.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/JavaStringELInfoHover.java 2011-08-08 19:30:03 UTC (rev 33687)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/JavaStringELInfoHover.java 2011-08-08 19:30:21 UTC (rev 33688)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2010-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,
@@ -327,7 +327,7 @@
if (useFullHTML) {
HTMLPrinter.addBullet(buffer, getInfoText(elements[i], false, useFullHTML));
} else {
- buffer.append('�').append(' ').append(getInfoText(elements[i], false, useFullHTML));
+ buffer.append('\u002d').append(' ').append(getInfoText(elements[i], false, useFullHTML));
}
hasContents= true;
}
@@ -408,20 +408,20 @@
boolean hasSource= openable.getBuffer() != null;
if (!hasAttachedSource && !hasAttachedJavadoc)
- reader= new StringReader(ELInfoHooverMessages.ELInfoHover_noAttachments);
+ reader= new StringReader(ELInfoHoverMessages.ELInfoHover_noAttachments);
else if (!hasAttachedJavadoc && !hasSource)
- reader= new StringReader(ELInfoHooverMessages.ELInfoHover_noAttachedJavadoc);
+ reader= new StringReader(ELInfoHoverMessages.ELInfoHover_noAttachedJavadoc);
else if (!hasAttachedSource)
- reader= new StringReader(ELInfoHooverMessages.ELInfoHover_noAttachedJavaSource);
+ reader= new StringReader(ELInfoHoverMessages.ELInfoHover_noAttachedJavaSource);
else if (!hasSource)
- reader= new StringReader(ELInfoHooverMessages.ELInfoHover_noInformation);
+ reader= new StringReader(ELInfoHoverMessages.ELInfoHover_noInformation);
} else {
base= JavaDocLocations.getBaseURL(member);
}
} catch (JavaModelException ex) {
- reader= new StringReader(ELInfoHooverMessages.ELInfoHover_error_gettingJavadoc);
+ reader= new StringReader(ELInfoHoverMessages.ELInfoHover_error_gettingJavadoc);
JavaPlugin.log(ex);
}
14 years, 8 months
JBoss Tools SVN: r33687 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test: projects/CDITest1/src/META-INF/services and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-08-08 15:30:03 -0400 (Mon, 08 Aug 2011)
New Revision: 33687
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/META-INF/services/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/META-INF/services/javax.enterprise.inject.spi.Extension
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/META-INF/services/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/META-INF/services/javax.enterprise.inject.spi.Extension
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/extension/ExtensionsInSrsAndUsedProjectTest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
Log:
JBIDE-9483
https://issues.jboss.org/browse/JBIDE-9483
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/META-INF/services/javax.enterprise.inject.spi.Extension
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/META-INF/services/javax.enterprise.inject.spi.Extension (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/META-INF/services/javax.enterprise.inject.spi.Extension 2011-08-08 19:30:03 UTC (rev 33687)
@@ -0,0 +1 @@
+a.b.c
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/META-INF/services/javax.enterprise.inject.spi.Extension
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/META-INF/services/javax.enterprise.inject.spi.Extension (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/META-INF/services/javax.enterprise.inject.spi.Extension 2011-08-08 19:30:03 UTC (rev 33687)
@@ -0,0 +1 @@
+c.d.e
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2011-08-08 19:29:32 UTC (rev 33686)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2011-08-08 19:30:03 UTC (rev 33687)
@@ -17,6 +17,7 @@
import org.jboss.tools.cdi.core.test.ca.BeansXmlCATest;
import org.jboss.tools.cdi.core.test.extension.ExtensionFactoryTest;
import org.jboss.tools.cdi.core.test.extension.ExtensionManagerTest;
+import org.jboss.tools.cdi.core.test.extension.ExtensionsInSrsAndUsedProjectTest;
import org.jboss.tools.cdi.core.test.project.EnableCDISupportForJarTest;
import org.jboss.tools.cdi.core.test.project.EnableCDISupportForWarTest;
import org.jboss.tools.cdi.core.test.tck.AssignabilityOfRawAndParameterizedTypesTest;
@@ -118,6 +119,7 @@
suiteAll.addTestSuite(BeansXMLTest.class);
TestSuite dependentSuite = new TestSuite("Dependent Projects Tests");
dependentSuite.addTestSuite(DependentProjectTest.class);
+ dependentSuite.addTestSuite(ExtensionsInSrsAndUsedProjectTest.class);
DependentProjectsTestSetup dependent = new DependentProjectsTestSetup(dependentSuite);
suiteAll.addTest(dependent);
suiteAll.addTestSuite(EnableCDISupportForWarTest.class);
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/extension/ExtensionsInSrsAndUsedProjectTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/extension/ExtensionsInSrsAndUsedProjectTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/extension/ExtensionsInSrsAndUsedProjectTest.java 2011-08-08 19:30:03 UTC (rev 33687)
@@ -0,0 +1,29 @@
+package org.jboss.tools.cdi.core.test.extension;
+
+import junit.extensions.TestSetup;
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.test.DependentProjectTest;
+
+public class ExtensionsInSrsAndUsedProjectTest extends TestCase {
+ protected static String PLUGIN_ID = "org.jboss.tools.cdi.core.test";
+ IProject project1 = null;
+ IProject project2 = null;
+
+ public ExtensionsInSrsAndUsedProjectTest() {
+ project1 = DependentProjectTest.getTestProject(project1, "/projects/CDITest1", "CDITest1");
+ project2 = DependentProjectTest.getTestProject(project2, "/projects/CDITest2", "CDITest2");
+ }
+
+ public void testRuntimes() {
+ CDICoreNature cdi2 = CDICorePlugin.getCDI(project2, true);
+ //Extension declared in src of project2
+ assertTrue(cdi2.getExtensionManager().isCDIExtensionAvailable("c.d.e"));
+ //Extension declared in src of project1
+ assertTrue(cdi2.getExtensionManager().isCDIExtensionAvailable("a.b.c"));
+ }
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/extension/ExtensionsInSrsAndUsedProjectTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 8 months
JBoss Tools SVN: r33686 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-08-08 15:29:32 -0400 (Mon, 08 Aug 2011)
New Revision: 33686
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java
Log:
JBIDE-9483
https://issues.jboss.org/browse/JBIDE-9483
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java 2011-08-08 19:14:24 UTC (rev 33685)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java 2011-08-08 19:29:32 UTC (rev 33686)
@@ -12,12 +12,17 @@
import java.io.File;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@@ -29,11 +34,14 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
+import org.jboss.tools.common.model.filesystems.impl.Libs;
import org.jboss.tools.common.model.project.ext.AbstractClassPathMonitor;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
public class ClassPathMonitor extends AbstractClassPathMonitor<CDICoreNature>{
IPath[] srcs = new IPath[0];
+
+ Map<FileAnyImpl, Long> servicesInSrc = new HashMap<FileAnyImpl, Long>();
Set<IPath> removedPaths = new HashSet<IPath>();
@@ -46,6 +54,16 @@
super.init();
}
+ public synchronized boolean update() {
+ Libs libs = FileSystemsHelper.getLibs(model);
+ if(libs == null) {
+ return false;
+ }
+ boolean r1 = updateServicesInSrcs();
+ boolean r2 = super.update();
+ return r1 || r2;
+ }
+
public JarSet process() {
JarSet newJars = new JarSet();
for (String p: syncProcessedPaths()) {
@@ -75,6 +93,14 @@
}
newJars.getBeanModules().put(p, b);
}
+
+ for (FileAnyImpl s: servicesInSrc.keySet()) {
+ IResource r = (IResource)s.getAdapter(IResource.class);
+ if(r != null && r.exists()) {
+ System.out.println(project.getProject() + ":" + r);
+ project.getExtensionManager().setRuntimes(r.getFullPath().toString(), readRuntimesInService(s));
+ }
+ }
validateProjectDependencies();
return newJars;
@@ -172,12 +198,60 @@
return list;
}
+ private boolean updateServicesInSrcs() {
+ Set<IFolder> fs = EclipseResourceUtil.getSourceFolders(project.getProject());
+ IJavaProject javaProject = EclipseResourceUtil.getJavaProject(project.getProject());
+ if(javaProject == null) {
+ return false;
+ }
+ IClasspathEntry[] es = null;
+ try {
+ es = javaProject.getResolvedClasspath(true);
+ } catch (CoreException e) {
+ CDICorePlugin.getDefault().logError(e);
+ return false;
+ }
+ for (int i = 0; i < es.length; i++) {
+ if(es[i].getEntryKind() == IClasspathEntry.CPE_PROJECT) {
+ IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(es[i].getPath().lastSegment());
+ if(p != null && p.isAccessible()) {
+ fs.addAll(EclipseResourceUtil.getSourceFolders(p.getProject()));
+ }
+ }
+ }
+ Map<FileAnyImpl, Long> newServices = new HashMap<FileAnyImpl, Long>();
+ boolean result = false;
+ for (IFolder folder: fs) {
+ IFile f = folder.getFile(SERVICE_PATH);
+ if(f.exists()) {
+ XModelObject o = EclipseResourceUtil.createObjectForResource(f);
+ if(o instanceof FileAnyImpl) {
+ FileAnyImpl s = (FileAnyImpl)o;
+ newServices.put(s, s.getTimeStamp());
+ Long old = servicesInSrc.get(s);
+ if(old == null || old.longValue() != s.getTimeStamp()) {
+ result = true;
+ }
+ }
+ }
+ }
+ if(servicesInSrc.size() != newServices.size()) {
+ result = true;
+ }
+ servicesInSrc = newServices;
+ return result;
+ }
+
+ private static String SERVICE_PATH = "META-INF/services/javax.enterprise.inject.spi.Extension";
+
private static Set<String> EMPTY_RUNTIMES = new HashSet<String>();
private Set<String> readRuntimes(XModelObject jar) {
- XModelObject o = jar.getChildByPath("META-INF/services/javax.enterprise.inject.spi.Extension");
- if(o == null) return EMPTY_RUNTIMES;
- if(!(o instanceof FileAnyImpl)) return EMPTY_RUNTIMES;
+ XModelObject o = jar.getChildByPath(SERVICE_PATH);
+ return (o instanceof FileAnyImpl) ? readRuntimesInService((FileAnyImpl)o) : EMPTY_RUNTIMES;
+ }
+
+ private Set<String> readRuntimesInService(FileAnyImpl o) {
Set<String> result = new HashSet<String>();
String text = ((FileAnyImpl)o).getAsText();
if(text == null || text.length() == 0) return EMPTY_RUNTIMES;
@@ -188,6 +262,4 @@
}
return result;
}
-
-
}
\ No newline at end of file
14 years, 8 months