diff options
author | mkersten | 2005-08-31 03:04:03 +0000 |
---|---|---|
committer | mkersten | 2005-08-31 03:04:03 +0000 |
commit | 4ca262ef0fc1d243f38b7f1f9159f518cc7c5cc8 (patch) | |
tree | f9641c8052d7b3f36507daf8e1587c6f61dd99f5 | |
parent | 01bb119405c704760da012d1f79a30cd8ac9c433 (diff) | |
download | org.eclipse.mylyn.tasks-4ca262ef0fc1d243f38b7f1f9159f518cc7c5cc8.tar.gz org.eclipse.mylyn.tasks-4ca262ef0fc1d243f38b7f1f9159f518cc7c5cc8.tar.xz org.eclipse.mylyn.tasks-4ca262ef0fc1d243f38b7f1f9159f518cc7c5cc8.zip |
Fixed Bug #104253: make mylar bridges extension points
-rw-r--r-- | org.eclipse.mylyn.tasks.core/plugin.xml | 8 | ||||
-rw-r--r-- | org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/BugzillaContextLabelProvider.java | 2 | ||||
-rw-r--r-- | org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/BugzillaSearchManager.java (renamed from org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/BugzillaMylarBridge.java) | 5 | ||||
-rw-r--r-- | org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/BugzillaStructureBridge.java | 4 | ||||
-rw-r--r-- | org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/MylarBugsPlugin.java | 16 | ||||
-rw-r--r-- | org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/BugzillaMylarSearch.java | 8 | ||||
-rw-r--r-- | org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/BugzillaMylarSearchJob.java | 8 | ||||
-rw-r--r-- | org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/BugzillaReferencesProvider.java | 8 |
8 files changed, 29 insertions, 30 deletions
diff --git a/org.eclipse.mylyn.tasks.core/plugin.xml b/org.eclipse.mylyn.tasks.core/plugin.xml index a13527175..fdf1f59ab 100644 --- a/org.eclipse.mylyn.tasks.core/plugin.xml +++ b/org.eclipse.mylyn.tasks.core/plugin.xml @@ -3,10 +3,6 @@ <?eclipse version="3.0"?> <plugin> <extension - point="org.eclipse.mylar.java.javaEditorContributor"> - <hyperlinkDetector class="org.eclipse.mylar.bugs.java.BugzillaHyperLinkDetector"/> - </extension> - <extension point="org.eclipse.mylar.core.context"> <structureBridge class="org.eclipse.mylar.bugs.BugzillaStructureBridge" @@ -17,5 +13,9 @@ <uiBridge class="org.eclipse.mylar.bugs.BugzillaUiBridge" contentType="bugzilla"/> + </extension> + <extension + point="org.eclipse.mylar.java.javaEditorContributor"> + <hyperlinkDetector class="org.eclipse.mylar.bugs.java.BugzillaHyperLinkDetector"/> </extension> </plugin> diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/BugzillaContextLabelProvider.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/BugzillaContextLabelProvider.java index 740372d52..4e6be131d 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/BugzillaContextLabelProvider.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/BugzillaContextLabelProvider.java @@ -48,7 +48,7 @@ public class BugzillaContextLabelProvider extends AbstractContextLabelProvider { Object report; BugzillaReportNode reportNode = MylarBugsPlugin.getReferenceProvider().getCached(node.getElementHandle()); BugReport cachedReport = MylarBugsPlugin.getDefault().getCache().getCached(node.getElementHandle()); - IMylarStructureBridge bridge = MylarPlugin.getDefault().getStructureBridge(BugzillaStructureBridge.EXTENSION); + IMylarStructureBridge bridge = MylarPlugin.getDefault().getStructureBridge(BugzillaStructureBridge.CONTENT_TYPE); if(reportNode != null && cachedReport == null){ report = reportNode; diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/BugzillaMylarBridge.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/BugzillaSearchManager.java index 6e09c0df4..7af4e0547 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/BugzillaMylarBridge.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/BugzillaSearchManager.java @@ -24,13 +24,12 @@ import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IMember; import org.eclipse.mylar.bugzilla.ui.tasklist.BugzillaReportNode; - /** * Class to handle the bridge between mylar and bugzilla * * @author Shawn Minto */ -public class BugzillaMylarBridge { +public class BugzillaSearchManager { /** The hash of all of the landmarks and their related search hits */ private Map<String, Map<Integer, List<BugzillaReportNode>>> landmarksHash; @@ -42,7 +41,7 @@ public class BugzillaMylarBridge { /** * Constructor */ - public BugzillaMylarBridge() { + public BugzillaSearchManager() { landmarksHash = Collections.synchronizedMap(new HashMap<String, Map<Integer, List<BugzillaReportNode>>>()); } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/BugzillaStructureBridge.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/BugzillaStructureBridge.java index 5f92e68fe..9f51578fd 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/BugzillaStructureBridge.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/BugzillaStructureBridge.java @@ -39,12 +39,12 @@ import org.eclipse.ui.views.markers.internal.ProblemMarker; public class BugzillaStructureBridge implements IMylarStructureBridge { - public final static String EXTENSION = "bugzilla"; + public final static String CONTENT_TYPE = "bugzilla"; public List<AbstractRelationshipProvider> providers; public String getResourceExtension() { - return EXTENSION; + return CONTENT_TYPE; } public BugzillaStructureBridge() { diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/MylarBugsPlugin.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/MylarBugsPlugin.java index e7565be1d..93aee1ee8 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/MylarBugsPlugin.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/MylarBugsPlugin.java @@ -20,16 +20,17 @@ import org.osgi.framework.BundleContext; /** * The main plugin class to be used in the desktop. + * + * @author Mik Kersten + * @author Shawn Minto */ public class MylarBugsPlugin extends AbstractUIPlugin { - private static BugzillaMylarBridge bridge = null; -// private BugzillaStructureBridge structureBridge; + private static BugzillaSearchManager bridge = null; private static BugzillaReferencesProvider referencesProvider = new BugzillaReferencesProvider(); private static MylarBugsPlugin plugin; private BugzillaReportCache cache; - - + public MylarBugsPlugin() { plugin = this; } @@ -42,13 +43,12 @@ public class MylarBugsPlugin extends AbstractUIPlugin { cache = new BugzillaReportCache(); cache.readCacheFile(); -// MylarUiPlugin.getDefault().addAdapter(BugzillaStructureBridge.EXTENSION, new BugzillaUiBridge()); MylarPlugin.getDefault().getSelectionMonitors().add(new BugzillaEditingMonitor()); IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (window != null) { // create a new bridge and initialize it - bridge = new BugzillaMylarBridge(); + bridge = new BugzillaSearchManager(); } } @@ -85,10 +85,10 @@ public class MylarBugsPlugin extends AbstractUIPlugin { return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.mylar.bugs.bridge", path); } - public static BugzillaMylarBridge getBridge() { + public static BugzillaSearchManager getBridge() { // make sure that the bridge initialized, if not, make a new one if (bridge == null) { - bridge = new BugzillaMylarBridge(); + bridge = new BugzillaSearchManager(); } return bridge; } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/BugzillaMylarSearch.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/BugzillaMylarSearch.java index 1c96d41d3..efc6bc878 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/BugzillaMylarSearch.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/BugzillaMylarSearch.java @@ -23,7 +23,7 @@ import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IMember; -import org.eclipse.mylar.bugs.BugzillaMylarBridge; +import org.eclipse.mylar.bugs.BugzillaSearchManager; import org.eclipse.mylar.bugzilla.ui.tasklist.BugzillaReportNode; import org.eclipse.mylar.core.InterestComparator; import org.eclipse.mylar.core.search.IActiveSearchListener; @@ -67,7 +67,7 @@ public class BugzillaMylarSearch implements IMylarSearchOperation { List<IJavaElement> landmarks = new ArrayList<IJavaElement>(); landmarks.add(element); - if (!BugzillaMylarBridge.doesJobExist(handle)) { + if (!BugzillaSearchManager.doesJobExist(handle)) { // perform the bugzilla search // get only the useful landmarks (IMember) @@ -103,7 +103,7 @@ public class BugzillaMylarSearch implements IMylarSearchOperation { searchJob.schedule(); // save this searchJobs handle so that we can cancel it if need be - BugzillaMylarBridge.addJob(handle, searchJob); + BugzillaSearchManager.addJob(handle, searchJob); } } return Status.OK_STATUS; @@ -145,7 +145,7 @@ public class BugzillaMylarSearch implements IMylarSearchOperation { public void notifySearchCompleted(List<BugzillaReportNode> doiList) { // go through all of the listeners and call searchCompleted(colelctor, // member) - BugzillaMylarBridge.removeSearchJob(handle); + BugzillaSearchManager.removeSearchJob(handle); for (IActiveSearchListener listener : listeners) { listener.searchCompleted(doiList); } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/BugzillaMylarSearchJob.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/BugzillaMylarSearchJob.java index 5c80db9bf..bfc2a7ee3 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/BugzillaMylarSearchJob.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/BugzillaMylarSearchJob.java @@ -21,7 +21,7 @@ import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.mylar.bugs.BugzillaMylarBridge; +import org.eclipse.mylar.bugs.BugzillaSearchManager; import org.eclipse.mylar.bugzilla.core.BugzillaPlugin; import org.eclipse.mylar.bugzilla.core.IBugzillaConstants; import org.eclipse.ui.PlatformUI; @@ -70,7 +70,7 @@ public class BugzillaMylarSearchJob extends Job { status[0] = Status.OK_STATUS; // make sure that we know this job is not running anymore - BugzillaMylarBridge.removeSearchJob(operation.getSearchMember().getHandleIdentifier()+" "+operation.getScope());//runningJobs.remove(operation.getSearchMember()); + BugzillaSearchManager.removeSearchJob(operation.getSearchMember().getHandleIdentifier()+" "+operation.getScope());//runningJobs.remove(operation.getSearchMember()); return status[0]; } else if (!status[0].isOK()) { // there was an error, so display an error message @@ -85,7 +85,7 @@ public class BugzillaMylarSearchJob extends Job { status[0] = Status.OK_STATUS; // make sure we know that this job is not running anymore - BugzillaMylarBridge.removeSearchJob(operation.getSearchMember().getHandleIdentifier()+" "+operation.getScope());//runningJobs.remove(operation.getSearchMember()); + BugzillaSearchManager.removeSearchJob(operation.getSearchMember().getHandleIdentifier()+" "+operation.getScope());//runningJobs.remove(operation.getSearchMember()); return status[0]; } } catch (LoginException e) { @@ -101,7 +101,7 @@ public class BugzillaMylarSearchJob extends Job { IBugzillaConstants.PLUGIN_ID, IStatus.OK, "", e)); } finally { // make sure that we know that this job is not running anymore - BugzillaMylarBridge.removeSearchJob(operation.getSearchMember().getHandleIdentifier()+" "+operation.getScope());//.runningJobs.remove(operation.getSearchMember()); + BugzillaSearchManager.removeSearchJob(operation.getSearchMember().getHandleIdentifier()+" "+operation.getScope());//.runningJobs.remove(operation.getSearchMember()); } return status[0]; diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/BugzillaReferencesProvider.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/BugzillaReferencesProvider.java index 43f537cd4..de1e52c31 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/BugzillaReferencesProvider.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/BugzillaReferencesProvider.java @@ -25,7 +25,7 @@ import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IMember; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaCore; -import org.eclipse.mylar.bugs.BugzillaMylarBridge; +import org.eclipse.mylar.bugs.BugzillaSearchManager; import org.eclipse.mylar.bugs.BugzillaStructureBridge; import org.eclipse.mylar.bugs.MylarBugsPlugin; import org.eclipse.mylar.bugzilla.ui.tasklist.BugzillaReportNode; @@ -45,7 +45,7 @@ public class BugzillaReferencesProvider extends AbstractRelationshipProvider { public static final String NAME = "Bugilla report references"; public BugzillaReferencesProvider() { - super(BugzillaStructureBridge.EXTENSION, ID); + super(BugzillaStructureBridge.CONTENT_TYPE, ID); } protected boolean acceptElement(IJavaElement javaElement) { @@ -95,7 +95,7 @@ public class BugzillaReferencesProvider extends AbstractRelationshipProvider { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable(){ public void run() { - incrementInterest(node, BugzillaStructureBridge.EXTENSION, handle, degreeOfSeparation); + incrementInterest(node, BugzillaStructureBridge.CONTENT_TYPE, handle, degreeOfSeparation); } }); } @@ -154,7 +154,7 @@ public class BugzillaReferencesProvider extends AbstractRelationshipProvider { @Override public void stopAllRunningJobs() { - BugzillaMylarBridge.cancelAllRunningJobs(); + BugzillaSearchManager.cancelAllRunningJobs(); } } |