Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/elcl16/context-clear.gifbin544 -> 0 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskContributor.java (renamed from org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListActionContributor.java)11
-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.java12
-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.java26
6 files changed, 22 insertions, 41 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/icons/elcl16/context-clear.gif b/org.eclipse.mylyn.tasks.ui/icons/elcl16/context-clear.gif
deleted file mode 100644
index 2abc46b38..000000000
--- a/org.eclipse.mylyn.tasks.ui/icons/elcl16/context-clear.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListActionContributor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskContributor.java
index 1bdd833c4..cf2f27a5c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListActionContributor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskContributor.java
@@ -11,9 +11,6 @@
package org.eclipse.mylar.tasks;
-import java.util.List;
-
-import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.mylar.tasks.internal.TaskCategory;
import org.eclipse.mylar.tasks.ui.views.TaskListView;
@@ -24,12 +21,8 @@ import org.eclipse.ui.IWorkbenchPage;
*
* TODO: this should use extension points
*/
-public interface ITaskListActionContributor {
-
- public abstract List<IAction> getToolbarActions(TaskListView view);
+public interface ITaskContributor {
- public abstract List<IAction> getPopupActions(TaskListView view, ITaskListElement selection);
-
public abstract MenuManager getSubMenuManager(TaskListView view, ITaskListElement selection);
public abstract void taskActivated(ITask task);
@@ -42,7 +35,7 @@ public interface ITaskListActionContributor {
public abstract void itemOpened(ITaskListElement element);
- public void taskClosed(ITask element, IWorkbenchPage page);
+ public abstract void taskClosed(ITask element, IWorkbenchPage page);
public abstract boolean acceptsItem(ITaskListElement element);
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 9dd144e45..69e3cd486 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<ITaskListActionContributor> contributors = new ArrayList<ITaskListActionContributor>(); // TODO: use extension points
+ private List<ITaskContributor> contributors = new ArrayList<ITaskContributor>(); // 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<ITaskListActionContributor> getContributors() {
+ public List<ITaskContributor> getContributors() {
return contributors;
}
- public ITaskListActionContributor getContributorForElement(ITaskListElement element){
- for(ITaskListActionContributor contributer: contributors){
+ public ITaskContributor getContributorForElement(ITaskListElement element){
+ for(ITaskContributor contributer: contributors){
if(contributer.acceptsItem(element)) return contributer;
}
return null;
}
- public void addContributor(ITaskListActionContributor contributor) {
+ public void addContributor(ITaskContributor 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 72dd2ea30..81af05092 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.ITaskListActionContributor;
+import org.eclipse.mylar.tasks.ITaskContributor;
import org.eclipse.mylar.tasks.ITaskListExternalizer;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.w3c.dom.Document;
@@ -82,14 +82,14 @@ public class TaskListExternalizer {
}
Object contributor = elements[j].createExecutableExtension(MylarTasksPlugin.ACTION_CONTRIBUTER_CLASS_ID);
- if (contributor instanceof ITaskListActionContributor) {
- MylarTasksPlugin.getDefault().addContributor((ITaskListActionContributor) contributor);
+ if (contributor instanceof ITaskContributor) {
+ MylarTasksPlugin.getDefault().addContributor((ITaskContributor) contributor);
}else {
- MylarPlugin.log("Could not load contributor: " + contributor.getClass().getCanonicalName() + " must implement " + ITaskListActionContributor.class.getCanonicalName(), this);
+ MylarPlugin.log("Could not load contributor: " + contributor.getClass().getCanonicalName() + " must implement " + ITaskContributor.class.getCanonicalName(), this);
}
} catch (CoreException e){
- MylarPlugin.log(e, "Could not load extension for externalizer");
+ 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);
- ITaskListActionContributor contributor = MylarTasksPlugin.getDefault().getContributorForElement(newTask);
+ ITaskContributor 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 dd56c697f..af95cfb5b 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.ITaskListActionContributor;
+import org.eclipse.mylar.tasks.ITaskContributor;
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;
- ITaskListActionContributor contributor = MylarTasksPlugin.getDefault().getContributorForElement(element);
+ ITaskContributor 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 74aa13bea..0b850bc20 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
@@ -20,7 +20,6 @@ import javax.security.auth.login.LoginException;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuCreator;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
@@ -52,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.ITaskListActionContributor;
+import org.eclipse.mylar.tasks.ITaskContributor;
import org.eclipse.mylar.tasks.ITaskListElement;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.eclipse.mylar.tasks.Task;
@@ -856,17 +855,12 @@ public class TaskListView extends ViewPart {
manager.add(delete);
manager.add(new Separator());
manager.add(createTask);
-// manager.add(new Separator());
+ manager.add(new Separator("mylar"));
final Object selectedObject = ((IStructuredSelection)viewer.getSelection()).getFirstElement();
if (selectedObject instanceof ITaskListElement) {
- for (ITaskListActionContributor contributor : MylarTasksPlugin.getDefault().getContributors()) {
- for (IAction action : contributor.getPopupActions(this, null)) {
- manager.add(action);
- }
- }
-
- for (ITaskListActionContributor contributor : MylarTasksPlugin.getDefault().getContributors()) {
+
+ for (ITaskContributor contributor : MylarTasksPlugin.getDefault().getContributors()) {
manager.add(new Separator());
MenuManager subMenuManager = contributor.getSubMenuManager(this, (ITaskListElement)selectedObject);
if (subMenuManager != null) manager.add(subMenuManager);
@@ -975,7 +969,7 @@ public class TaskListView extends ViewPart {
}
public void closeTaskEditors(ITask task, IWorkbenchPage page) throws LoginException, IOException{
- ITaskListActionContributor contributor = MylarTasksPlugin.getDefault().getContributorForElement(task);
+ ITaskContributor contributor = MylarTasksPlugin.getDefault().getContributorForElement(task);
if(contributor != null){
contributor.taskClosed(task, page);
} else if (task instanceof Task) {
@@ -1151,17 +1145,11 @@ public class TaskListView extends ViewPart {
private void fillLocalToolBar(IToolBarManager manager) {
manager.removeAll();
- // XXX only adding if there are contributions
- List<ITaskListActionContributor> contributors = MylarTasksPlugin.getDefault().getContributors();
manager.add(createTask);
manager.add(createCategory);
+ manager.add(new Separator("mylar"));
+
manager.add(new Separator());
- for(ITaskListActionContributor contributor: contributors){
- for (IAction action : contributor.getToolbarActions(this)) {
- manager.add(action);
- }
- manager.add(new Separator());
- }
manager.add(filterCompleteTask);
manager.add(filterOnPriority);

Back to the top