Author: dazarov
Date: 2011-05-26 20:06:53 -0400 (Thu, 26 May 2011)
New Revision: 31539
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointHyperlinkDetector.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointListHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AlternativeInjectedPointListHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventListHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/MultipleHyperlinkPresenterManager.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ObserverMethodListHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/MultipleHyperlinkPresenter.java
Log:
https://issues.jboss.org/browse/JBIDE-9022
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointHyperlinkDetector.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointHyperlinkDetector.java 2011-05-26
23:42:56 UTC (rev 31538)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointHyperlinkDetector.java 2011-05-27
00:06:53 UTC (rev 31539)
@@ -172,7 +172,7 @@
if(resultBeanList.size() == 1) {
hyperlinks.add(new GenericInjectedPointHyperlink(region, resultBeanList.get(0),
document, true));
} else if(resultBeanList.size() > 0) {
- hyperlinks.add(new GenericInjectedPointListHyperlink(region, resultBeanList, viewer,
document, hyperlinks.size()));
+ hyperlinks.add(new GenericInjectedPointListHyperlink(region, resultBeanList, viewer,
document));
}
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointListHyperlink.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointListHyperlink.java 2011-05-26
23:42:56 UTC (rev 31538)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointListHyperlink.java 2011-05-27
00:06:53 UTC (rev 31539)
@@ -24,8 +24,8 @@
AlternativeInjectedPointListHyperlink {
public GenericInjectedPointListHyperlink(IRegion region, List<IBean> beans,
- ITextViewer viewer, IDocument document, int previousIndex) {
- super(region, beans, viewer, document, previousIndex);
+ ITextViewer viewer, IDocument document) {
+ super(region, beans, viewer, document);
}
@Override
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AlternativeInjectedPointListHyperlink.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AlternativeInjectedPointListHyperlink.java 2011-05-26
23:42:56 UTC (rev 31538)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AlternativeInjectedPointListHyperlink.java 2011-05-27
00:06:53 UTC (rev 31539)
@@ -23,13 +23,11 @@
private IRegion region;
private List<IBean> beans;
private ITextViewer viewer;
- private int previousIndex;
- public AlternativeInjectedPointListHyperlink(IRegion region, List<IBean> beans,
ITextViewer viewer, IDocument document, int previousIndex){
+ public AlternativeInjectedPointListHyperlink(IRegion region, List<IBean> beans,
ITextViewer viewer, IDocument document){
this.beans = beans;
this.region = region;
this.viewer = viewer;
- this.previousIndex = previousIndex;
setDocument(document);
}
@@ -55,7 +53,7 @@
if(hyperlinks.length == 1){
((InjectedPointHyperlink)hyperlinks[0]).doHyperlink(region);
}else{
- MultipleHyperlinkPresenterManager.installAndShow(viewer, hyperlinks, previousIndex);
+ MultipleHyperlinkPresenterManager.installAndShow(viewer, hyperlinks);
}
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java 2011-05-26
23:42:56 UTC (rev 31538)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java 2011-05-27
00:06:53 UTC (rev 31539)
@@ -113,7 +113,7 @@
Set<IObserverMethod> observerMethods =
cdiProject.resolveObserverMethods(injectionPoint);
if(observerMethods.size() > 0)
- hyperlinks.add(new ObserverMethodListHyperlink(textViewer, region,
observerMethods, document, hyperlinks.size()));
+ hyperlinks.add(new ObserverMethodListHyperlink(textViewer, region,
observerMethods, document));
} else if(param != null) {
Set<IInjectionPoint> events = new HashSet<IInjectionPoint>();
@@ -121,7 +121,7 @@
events.addAll(cdiProject.findObservedEvents(p));
if(events.size() > 0)
- hyperlinks.add(new EventListHyperlink(textViewer, region, events, document,
hyperlinks.size()));
+ hyperlinks.add(new EventListHyperlink(textViewer, region, events, document));
}
}
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventListHyperlink.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventListHyperlink.java 2011-05-26
23:42:56 UTC (rev 31538)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventListHyperlink.java 2011-05-27
00:06:53 UTC (rev 31539)
@@ -24,13 +24,11 @@
private ITextViewer viewer;
private Set<IInjectionPoint> events;
private IRegion region;
- private int previousIndex;
- public EventListHyperlink(ITextViewer viewer, IRegion region, Set<IInjectionPoint>
events, IDocument document, int previousIndex){
+ public EventListHyperlink(ITextViewer viewer, IRegion region, Set<IInjectionPoint>
events, IDocument document){
this.viewer = viewer;
this.events = events;
this.region = region;
- this.previousIndex = previousIndex;
setDocument(document);
}
@@ -55,7 +53,7 @@
if(hyperlinks.length == 1){
((EventHyperlink)hyperlinks[0]).doHyperlink(region);
}else{
- MultipleHyperlinkPresenterManager.installAndShow(viewer, hyperlinks, previousIndex);
+ MultipleHyperlinkPresenterManager.installAndShow(viewer, hyperlinks);
}
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2011-05-26
23:42:56 UTC (rev 31538)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2011-05-27
00:06:53 UTC (rev 31539)
@@ -139,7 +139,7 @@
if(resultBeanList.size() > 0){
hyperlinks.add(new InjectedPointHyperlink(region, resultBeanList.get(0), document,
true));
if(alternativeBeanList.size() > 1)
- hyperlinks.add(new AlternativeInjectedPointListHyperlink(region, alternativeBeanList,
viewer, document, hyperlinks.size()));
+ hyperlinks.add(new AlternativeInjectedPointListHyperlink(region, alternativeBeanList,
viewer, document));
}
}
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/MultipleHyperlinkPresenterManager.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/MultipleHyperlinkPresenterManager.java 2011-05-26
23:42:56 UTC (rev 31538)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/MultipleHyperlinkPresenterManager.java 2011-05-27
00:06:53 UTC (rev 31539)
@@ -23,12 +23,12 @@
private static boolean installed = false;
private static MyPartListener listener = new MyPartListener();
- public static void installAndShow(ITextViewer viewer, IHyperlink[] hyperlinks, int
previousIndex){
+ public static void installAndShow(ITextViewer viewer, IHyperlink[] hyperlinks){
if(installed)
uninstall();
mhp.install(viewer);
- mhp.showHyperlinks(hyperlinks, previousIndex);
+ mhp.showHyperlinks(hyperlinks);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().addPartListener(listener);
installed = true;
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ObserverMethodListHyperlink.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ObserverMethodListHyperlink.java 2011-05-26
23:42:56 UTC (rev 31538)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ObserverMethodListHyperlink.java 2011-05-27
00:06:53 UTC (rev 31539)
@@ -24,13 +24,11 @@
private ITextViewer viewer;
private Set<IObserverMethod> observerMethods;
private IRegion region;
- private int previousIndex;
- public ObserverMethodListHyperlink(ITextViewer viewer, IRegion region,
Set<IObserverMethod> observerMethods, IDocument document, int previousIndex){
+ public ObserverMethodListHyperlink(ITextViewer viewer, IRegion region,
Set<IObserverMethod> observerMethods, IDocument document){
this.viewer = viewer;
this.observerMethods = observerMethods;
this.region = region;
- this.previousIndex = previousIndex;
setDocument(document);
}
@@ -55,7 +53,7 @@
if(hyperlinks.length == 1){
((ObserverMethodHyperlink)hyperlinks[0]).doHyperlink(region);
}else{
- MultipleHyperlinkPresenterManager.installAndShow(viewer, hyperlinks, previousIndex);
+ MultipleHyperlinkPresenterManager.installAndShow(viewer, hyperlinks);
}
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/MultipleHyperlinkPresenter.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/MultipleHyperlinkPresenter.java 2011-05-26
23:42:56 UTC (rev 31538)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/MultipleHyperlinkPresenter.java 2011-05-27
00:06:53 UTC (rev 31539)
@@ -595,10 +595,10 @@
* @see
org.eclipse.jface.text.AbstractInformationControlManager#showInformationControl(org.eclipse.swt.graphics.Rectangle)
*/
protected void showInformationControl(Rectangle subjectArea) {
- int offset = fTextViewer.getTextWidget().getLineHeight()*(index+1);
- Rectangle bounds = ((IInformationControlExtension3)fInformationControl).getBounds();
- Point location = new Point(bounds.x, bounds.y+offset);
+ Point point = Display.getCurrent().getCursorLocation();
+ Point location = new Point(point.x-20, point.y-20);
fInformationControl.setLocation(location);
+
if (fTextViewer instanceof IWidgetTokenOwnerExtension) {
if (((IWidgetTokenOwnerExtension) fTextViewer).requestWidgetToken(this,
WIDGET_TOKEN_PRIORITY))
super.showInformationControl(subjectArea);
@@ -764,16 +764,12 @@
fHyperlinks= null;
}
- private static int index=0;
-
/*
* @see
org.eclipse.jface.text.hyperlink.DefaultHyperlinkPresenter#showHyperlinks(org.eclipse.jface.text.hyperlink.IHyperlink[])
*/
- public void showHyperlinks(IHyperlink[] hyperlinks, int index) {
+ public void showHyperlinks(IHyperlink[] hyperlinks) {
super.showHyperlinks(new IHyperlink[] { hyperlinks[0] });
- this.index = index;
-
fSubjectRegion= null;
fHyperlinks= hyperlinks;