Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2005-07-20 12:55:00 -0400
committermkersten2005-07-20 12:55:00 -0400
commit1051f15709456250ebba01bb32c8fa2aaa0b9de0 (patch)
treec4a8068e3c3ea06d4cbff8bcabf5ab953f1b9af4
parent11b2e084e077f6224756498ae8a10175612e07c4 (diff)
downloadorg.eclipse.mylyn.tasks-1051f15709456250ebba01bb32c8fa2aaa0b9de0.tar.gz
org.eclipse.mylyn.tasks-1051f15709456250ebba01bb32c8fa2aaa0b9de0.tar.xz
org.eclipse.mylyn.tasks-1051f15709456250ebba01bb32c8fa2aaa0b9de0.zip
Created listener interaface
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaTaskAction.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateNewBugzillaTaskAction.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskContributor.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskExternalizer.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListListener.java (renamed from org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskContributor.java)2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/MylarTasksPlugin.java10
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java10
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/OpenTaskEditorAction.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java6
9 files changed, 24 insertions, 24 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaTaskAction.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaTaskAction.java
index 71702a622..154898345 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaTaskAction.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaTaskAction.java
@@ -19,7 +19,7 @@ import org.eclipse.mylar.bugzilla.ui.BugzillaImages;
import org.eclipse.mylar.bugzilla.ui.BugzillaUiPlugin;
import org.eclipse.mylar.bugzilla.ui.tasks.BugzillaTask;
import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.mylar.tasks.ITaskContributor;
+import org.eclipse.mylar.tasks.ITaskListListener;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.eclipse.mylar.tasks.internal.TaskCategory;
import org.eclipse.mylar.tasks.ui.views.TaskListView;
@@ -75,7 +75,7 @@ public class CreateBugzillaTaskAction extends Action implements IViewActionDeleg
ITask newTask = new BugzillaTask("Bugzilla-"+bugId, "<bugzilla info>", true);
Object selectedObject = ((IStructuredSelection)TaskListView.getDefault().getViewer().getSelection()).getFirstElement();
- ITaskContributor contributor = MylarTasksPlugin.getDefault().getContributorForElement(newTask);
+ ITaskListListener contributor = MylarTasksPlugin.getDefault().getContributorForElement(newTask);
if(contributor != null){
ITask addedTask = contributor.taskAdded(newTask);
if(addedTask instanceof BugzillaTask){
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateNewBugzillaTaskAction.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateNewBugzillaTaskAction.java
index c5250bea8..0c60e2afc 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateNewBugzillaTaskAction.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateNewBugzillaTaskAction.java
@@ -22,7 +22,7 @@ import org.eclipse.mylar.bugzilla.ui.BugzillaUiPlugin;
import org.eclipse.mylar.bugzilla.ui.tasks.BugzillaTask;
import org.eclipse.mylar.bugzilla.ui.wizard.NewBugWizard;
import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.mylar.tasks.ITaskContributor;
+import org.eclipse.mylar.tasks.ITaskListListener;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.eclipse.mylar.tasks.internal.TaskCategory;
import org.eclipse.mylar.tasks.ui.views.TaskListView;
@@ -82,7 +82,7 @@ public class CreateNewBugzillaTaskAction extends Action implements IViewActionDe
if(TaskListView.getDefault() != null)
selectedObject = ((IStructuredSelection)TaskListView.getDefault().getViewer().getSelection()).getFirstElement();
- ITaskContributor contributor = MylarTasksPlugin.getDefault().getContributorForElement(newTask);
+ ITaskListListener contributor = MylarTasksPlugin.getDefault().getContributorForElement(newTask);
if(contributor != null){
ITask addedTask = contributor.taskAdded(newTask);
if(addedTask instanceof BugzillaTask){
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskContributor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskContributor.java
index 2fd210553..5ffd9ef68 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskContributor.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskContributor.java
@@ -26,7 +26,7 @@ import org.eclipse.mylar.bugzilla.ui.actions.RefreshBugzillaAction;
import org.eclipse.mylar.bugzilla.ui.actions.RefreshBugzillaReportsAction;
import org.eclipse.mylar.core.MylarPlugin;
import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.mylar.tasks.ITaskContributor;
+import org.eclipse.mylar.tasks.ITaskListListener;
import org.eclipse.mylar.tasks.ITaskListElement;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.eclipse.mylar.tasks.internal.TaskCategory;
@@ -40,7 +40,7 @@ import org.eclipse.ui.internal.Workbench;
/**
* @author Mik Kersten and Ken Sueda
*/
-public class BugzillaTaskContributor implements ITaskContributor {
+public class BugzillaTaskContributor implements ITaskListListener {
public MenuManager getSubMenuManager(TaskListView view, ITaskListElement selection) {
return null;
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskExternalizer.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskExternalizer.java
index 070200e8b..92107736a 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskExternalizer.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskExternalizer.java
@@ -18,7 +18,7 @@ import org.eclipse.mylar.bugzilla.ui.tasks.BugzillaTask.BugTaskState;
import org.eclipse.mylar.core.MylarPlugin;
import org.eclipse.mylar.tasks.AbstractCategory;
import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.mylar.tasks.ITaskContributor;
+import org.eclipse.mylar.tasks.ITaskListListener;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.eclipse.mylar.tasks.internal.DefaultTaskListExternalizer;
import org.eclipse.mylar.tasks.internal.MylarExternalizerException;
@@ -171,7 +171,7 @@ public class BugzillaTaskExternalizer extends DefaultTaskListExternalizer {
MylarPlugin.log(e, "Failed to read bug report");
}
- ITaskContributor contributor = MylarTasksPlugin.getDefault().getContributorForElement(task);
+ ITaskListListener contributor = MylarTasksPlugin.getDefault().getContributorForElement(task);
if(contributor != null){
ITask addedTask = contributor.taskAdded(task);
if(addedTask instanceof BugzillaTask) task = (BugzillaTask)addedTask;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskContributor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListListener.java
index cf2f27a5c..c1d26d2c8 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskContributor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListListener.java
@@ -21,7 +21,7 @@ import org.eclipse.ui.IWorkbenchPage;
*
* TODO: this should use extension points
*/
-public interface ITaskContributor {
+public interface ITaskListListener {
public abstract MenuManager getSubMenuManager(TaskListView view, ITaskListElement selection);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/MylarTasksPlugin.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/MylarTasksPlugin.java
index 69e3cd486..3fb22141a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/MylarTasksPlugin.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/MylarTasksPlugin.java
@@ -42,7 +42,7 @@ public class MylarTasksPlugin extends AbstractUIPlugin {
private static MylarTasksPlugin plugin;
private static TaskListManager taskListManager;
private TaskListExternalizer externalizer;
- private List<ITaskContributor> contributors = new ArrayList<ITaskContributor>(); // TODO: use extension points
+ private List<ITaskListListener> contributors = new ArrayList<ITaskListListener>(); // TODO: use extension points
public static final String TASK_CONTRIBUTER_ID = "org.eclipse.mylar.tasks.taskListContributor";
public static final String EXTERNALIZER_CLASS_ID = "externalizerClass";
@@ -297,18 +297,18 @@ public class MylarTasksPlugin extends AbstractUIPlugin {
return externalizer;
}
- public List<ITaskContributor> getContributors() {
+ public List<ITaskListListener> getContributors() {
return contributors;
}
- public ITaskContributor getContributorForElement(ITaskListElement element){
- for(ITaskContributor contributer: contributors){
+ public ITaskListListener getContributorForElement(ITaskListElement element){
+ for(ITaskListListener contributer: contributors){
if(contributer.acceptsItem(element)) return contributer;
}
return null;
}
- public void addContributor(ITaskContributor contributor) {
+ public void addContributor(ITaskListListener contributor) {
contributors.add(contributor);
// if (TaskListView.getDefault() != null) TaskListView.getDefault().resetToolbarsAndPopups();
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java
index 81af05092..cfee7ddec 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java
@@ -41,7 +41,7 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.mylar.core.MylarPlugin;
import org.eclipse.mylar.tasks.AbstractCategory;
import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.mylar.tasks.ITaskContributor;
+import org.eclipse.mylar.tasks.ITaskListListener;
import org.eclipse.mylar.tasks.ITaskListExternalizer;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.w3c.dom.Document;
@@ -82,11 +82,11 @@ public class TaskListExternalizer {
}
Object contributor = elements[j].createExecutableExtension(MylarTasksPlugin.ACTION_CONTRIBUTER_CLASS_ID);
- if (contributor instanceof ITaskContributor) {
- MylarTasksPlugin.getDefault().addContributor((ITaskContributor) contributor);
+ if (contributor instanceof ITaskListListener) {
+ MylarTasksPlugin.getDefault().addContributor((ITaskListListener) contributor);
}else {
- MylarPlugin.log("Could not load contributor: " + contributor.getClass().getCanonicalName() + " must implement " + ITaskContributor.class.getCanonicalName(), this);
+ MylarPlugin.log("Could not load contributor: " + contributor.getClass().getCanonicalName() + " must implement " + ITaskListListener.class.getCanonicalName(), this);
}
} catch (CoreException e){
MylarPlugin.log(e, "Could not load extensions");
@@ -280,7 +280,7 @@ public class TaskListExternalizer {
if (externalizer.canReadTask(child)) {
// TODO add the tasks properly
ITask newTask = externalizer.readTask(child, tlist, null, null);
- ITaskContributor contributor = MylarTasksPlugin.getDefault().getContributorForElement(newTask);
+ ITaskListListener contributor = MylarTasksPlugin.getDefault().getContributorForElement(newTask);
if(contributor != null){
newTask = contributor.taskAdded(newTask);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/OpenTaskEditorAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/OpenTaskEditorAction.java
index af95cfb5b..1b5fcb931 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/OpenTaskEditorAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/OpenTaskEditorAction.java
@@ -14,7 +14,7 @@ package org.eclipse.mylar.tasks.ui.actions;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.mylar.tasks.ITaskContributor;
+import org.eclipse.mylar.tasks.ITaskListListener;
import org.eclipse.mylar.tasks.ITaskListElement;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.eclipse.mylar.tasks.Task;
@@ -43,7 +43,7 @@ public class OpenTaskEditorAction extends Action {
Object obj = ((IStructuredSelection)selection).getFirstElement();
if (obj instanceof ITaskListElement) {
ITaskListElement element = (ITaskListElement)obj;
- ITaskContributor contributor = MylarTasksPlugin.getDefault().getContributorForElement(element);
+ ITaskListListener contributor = MylarTasksPlugin.getDefault().getContributorForElement(element);
if(contributor != null){
contributor.itemOpened(element);
} else{
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java
index 0b850bc20..7dfe3c4d8 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java
@@ -51,7 +51,7 @@ import org.eclipse.mylar.core.MylarPlugin;
import org.eclipse.mylar.dt.MylarWebRef;
import org.eclipse.mylar.tasks.AbstractCategory;
import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.mylar.tasks.ITaskContributor;
+import org.eclipse.mylar.tasks.ITaskListListener;
import org.eclipse.mylar.tasks.ITaskListElement;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.eclipse.mylar.tasks.Task;
@@ -860,7 +860,7 @@ public class TaskListView extends ViewPart {
final Object selectedObject = ((IStructuredSelection)viewer.getSelection()).getFirstElement();
if (selectedObject instanceof ITaskListElement) {
- for (ITaskContributor contributor : MylarTasksPlugin.getDefault().getContributors()) {
+ for (ITaskListListener contributor : MylarTasksPlugin.getDefault().getContributors()) {
manager.add(new Separator());
MenuManager subMenuManager = contributor.getSubMenuManager(this, (ITaskListElement)selectedObject);
if (subMenuManager != null) manager.add(subMenuManager);
@@ -969,7 +969,7 @@ public class TaskListView extends ViewPart {
}
public void closeTaskEditors(ITask task, IWorkbenchPage page) throws LoginException, IOException{
- ITaskContributor contributor = MylarTasksPlugin.getDefault().getContributorForElement(task);
+ ITaskListListener contributor = MylarTasksPlugin.getDefault().getContributorForElement(task);
if(contributor != null){
contributor.taskClosed(task, page);
} else if (task instanceof Task) {

Back to the top