Author: vrubezhny
Date: 2012-01-30 14:22:08 -0500 (Mon, 30 Jan 2012)
New Revision: 38291
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/CDIExtensionsPlugin.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/AssignableBeansHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/DisposerHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventHyperlink.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/InjectedPointHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ObserverMethodHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ObserverMethodListHyperlink.java
Log:
JBIDE-10621
Redesign HyperlinkDetector so that partitioning and hyperlinks not do twice the same job.
Hyperlinks and Hyperlink Partitioners are redesigned due to exclude duplication work on
regions calculation.
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/CDIExtensionsPlugin.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/CDIExtensionsPlugin.java 2012-01-30
19:21:22 UTC (rev 38290)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/CDIExtensionsPlugin.java 2012-01-30
19:22:08 UTC (rev 38291)
@@ -17,6 +17,7 @@
private static CDIExtensionsPlugin plugin;
public static final String PLUGIN_ID = "org.jboss.tools.cdi.text.ext";
//$NON-NLS-1$
+
/**
* The constructor.
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 2012-01-30
19:21:22 UTC (rev 38290)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AlternativeInjectedPointListHyperlink.java 2012-01-30
19:22:08 UTC (rev 38291)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2010-2012 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,
@@ -11,6 +11,7 @@
package org.jboss.tools.cdi.text.ext.hyperlink;
import java.util.List;
+
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextViewer;
@@ -20,23 +21,16 @@
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
public class AlternativeInjectedPointListHyperlink extends AbstractHyperlink{
- private IRegion region;
protected List<IBean> beans;
protected ITextViewer viewer;
public AlternativeInjectedPointListHyperlink(IRegion region, List<IBean> beans,
ITextViewer viewer, IDocument document){
this.beans = beans;
- this.region = region;
+ setRegion(region);
this.viewer = viewer;
setDocument(document);
}
-
- @Override
- protected IRegion doGetHyperlinkRegion(int offset) {
- return region;
- }
-
protected void doHyperlink(IRegion region) {
IHyperlink[] hyperlinks = new IHyperlink[beans.size()];
@@ -65,5 +59,4 @@
public String getHyperlinkText() {
return CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ALTERNATIVES;
}
-
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansHyperlink.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansHyperlink.java 2012-01-30
19:21:22 UTC (rev 38290)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansHyperlink.java 2012-01-30
19:22:08 UTC (rev 38291)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
+ * Copyright (c) 2011-2012 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,
@@ -22,19 +22,13 @@
public class AssignableBeansHyperlink extends AbstractHyperlink implements
ITestableCDIHyperlink{
protected IInjectionPoint injectionPoint;
- IRegion region;
public AssignableBeansHyperlink(IRegion region, IInjectionPoint injectionPoint,
IDocument document){
this.injectionPoint = injectionPoint;
- this.region = region;
+ setRegion(region);
setDocument(document);
}
- @Override
- protected IRegion doGetHyperlinkRegion(int offset) {
- return region;
- }
-
protected void doHyperlink(IRegion region) {
Display display = Display.getCurrent();
if(display == null) {
@@ -57,5 +51,4 @@
public Set<? extends ICDIElement> getCDIElements() {
return null;
}
-
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/DisposerHyperlink.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/DisposerHyperlink.java 2012-01-30
19:21:22 UTC (rev 38290)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/DisposerHyperlink.java 2012-01-30
19:22:08 UTC (rev 38291)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2010-2012 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,
@@ -24,20 +24,13 @@
public class DisposerHyperlink extends AbstractHyperlink{
IMethod method;
- IRegion region;
public DisposerHyperlink(IRegion region, IMethod method, IDocument document){
this.method = method;
- this.region = region;
+ setRegion(region);
setDocument(document);
}
-
- @Override
- protected IRegion doGetHyperlinkRegion(int offset) {
- return region;
- }
-
protected void doHyperlink(IRegion region) {
IEditorPart part = null;
@@ -65,5 +58,4 @@
text += method.getElementName();
return text;
}
-
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventHyperlink.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventHyperlink.java 2012-01-30
19:21:22 UTC (rev 38290)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventHyperlink.java 2012-01-30
19:22:08 UTC (rev 38291)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2010-2012 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,
@@ -29,20 +29,13 @@
public class EventHyperlink extends AbstractHyperlink implements ITestableCDIHyperlink,
IInformationItem{
IInjectionPoint event;
- IRegion region;
public EventHyperlink(IRegion region, IInjectionPoint event, IDocument document){
this.event = event;
- this.region = region;
+ setRegion(region);
setDocument(document);
}
-
- @Override
- protected IRegion doGetHyperlinkRegion(int offset) {
- return region;
- }
-
protected void doHyperlink(IRegion region) {
IEditorPart part = null;
@@ -74,7 +67,6 @@
return CDIExtensionsMessages.CDI_EVENT_HYPERLINK_OPEN_EVENT+"
"+event.getElementName();
}
-
public ICDIElement getCDIElement() {
return event;
}
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 2012-01-30
19:21:22 UTC (rev 38290)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventListHyperlink.java 2012-01-30
19:22:08 UTC (rev 38291)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2010-2012 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,
@@ -24,20 +24,14 @@
public class EventListHyperlink extends AbstractHyperlink implements
ITestableCDIHyperlink{
private ITextViewer viewer;
private Set<IInjectionPoint> events;
- private IRegion region;
public EventListHyperlink(ITextViewer viewer, IRegion region, Set<IInjectionPoint>
events, IDocument document){
this.viewer = viewer;
this.events = events;
- this.region = region;
+ setRegion(region);
setDocument(document);
}
- @Override
- protected IRegion doGetHyperlinkRegion(int offset) {
- return region;
- }
-
protected void doHyperlink(IRegion region) {
IHyperlink[] hyperlinks = new IHyperlink[events.size()];
@@ -70,5 +64,4 @@
public Set<? extends ICDIElement> getCDIElements() {
return events;
}
-
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlink.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlink.java 2012-01-30
19:21:22 UTC (rev 38290)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlink.java 2012-01-30
19:22:08 UTC (rev 38291)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2010-2012 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,
@@ -30,12 +30,11 @@
public class InjectedPointHyperlink extends AbstractHyperlink implements
ITestableCDIHyperlink, IInformationItem{
protected IBean bean;
- IRegion region;
boolean first = false;
public InjectedPointHyperlink(IRegion region, IBean bean, IDocument document){
this.bean = bean;
- this.region = region;
+ setRegion(region);
setDocument(document);
}
@@ -44,12 +43,6 @@
this.first = first;
}
-
- @Override
- protected IRegion doGetHyperlinkRegion(int offset) {
- return region;
- }
-
public void doHyperlink(IRegion region) {
IEditorPart part = null;
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ObserverMethodHyperlink.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ObserverMethodHyperlink.java 2012-01-30
19:21:22 UTC (rev 38290)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ObserverMethodHyperlink.java 2012-01-30
19:22:08 UTC (rev 38291)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2010-2012 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,
@@ -27,18 +27,13 @@
public class ObserverMethodHyperlink extends AbstractHyperlink implements
IInformationItem, ITestableCDIHyperlink{
IObserverMethod observerMethod;
- IRegion region;
public ObserverMethodHyperlink(IRegion region, IObserverMethod observerMethod, IDocument
document){
this.observerMethod = observerMethod;
- this.region = region;
+ setRegion(region);
setDocument(document);
}
- protected IRegion doGetHyperlinkRegion(int offset) {
- return region;
- }
-
protected void doHyperlink(IRegion region) {
IEditorPart part = null;
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 2012-01-30
19:21:22 UTC (rev 38290)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ObserverMethodListHyperlink.java 2012-01-30
19:22:08 UTC (rev 38291)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2010-2012 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,
@@ -24,20 +24,14 @@
public class ObserverMethodListHyperlink extends AbstractHyperlink implements
ITestableCDIHyperlink{
private ITextViewer viewer;
private Set<IObserverMethod> observerMethods;
- private IRegion region;
public ObserverMethodListHyperlink(ITextViewer viewer, IRegion region,
Set<IObserverMethod> observerMethods, IDocument document){
this.viewer = viewer;
this.observerMethods = observerMethods;
- this.region = region;
+ setRegion(region);
setDocument(document);
}
- @Override
- protected IRegion doGetHyperlinkRegion(int offset) {
- return region;
- }
-
protected void doHyperlink(IRegion region) {
IHyperlink[] hyperlinks = new IHyperlink[observerMethods.size()];
@@ -70,5 +64,4 @@
public Set<? extends ICDIElement> getCDIElements() {
return observerMethods;
}
-
}