Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2005-08-16 23:04:55 -0400
committermkersten2005-08-16 23:04:55 -0400
commit1613c77adc6c18f1133e88928741182b8f5dfbae (patch)
tree18c3e0a8e64d1bcb7c4217ff000737aee6eedaee
parentc8934b7abdf5d0e2199d653f0f381b1290e3eeae (diff)
downloadorg.eclipse.mylyn.tasks-1613c77adc6c18f1133e88928741182b8f5dfbae.tar.gz
org.eclipse.mylyn.tasks-1613c77adc6c18f1133e88928741182b8f5dfbae.tar.xz
org.eclipse.mylyn.tasks-1613c77adc6c18f1133e88928741182b8f5dfbae.zip
Fix for Bug #107129: Add "Collapse All" action to tasklist toolba
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/elcl16/collapseall.pngbin0 -> 192 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskListImages.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/CollapseAllAction.java42
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/TaskListView.java10
4 files changed, 50 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/icons/elcl16/collapseall.png b/org.eclipse.mylyn.tasks.ui/icons/elcl16/collapseall.png
new file mode 100644
index 000000000..611a8c5c1
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/icons/elcl16/collapseall.png
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskListImages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskListImages.java
index eb75410c3..70830b73c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskListImages.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskListImages.java
@@ -52,6 +52,8 @@ public class TaskListImages {
public static final ImageDescriptor TASK_INACTIVE = create(T_TOOL, "task-inactive.gif");
public static final ImageDescriptor TASK_COMPLETE = create(T_TOOL, "task-complete.gif");
public static final ImageDescriptor TASK_INCOMPLETE = create(T_TOOL, "task-incomplete.gif");
+
+ public static final ImageDescriptor COLLAPSE_ALL = create(T_ELCL, "collapseall.png");
private static ImageDescriptor create(String prefix, String name) {
try {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/CollapseAllAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/CollapseAllAction.java
new file mode 100644
index 000000000..8473af797
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/CollapseAllAction.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2004 - 2005 University Of British Columbia and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * University Of British Columbia - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylar.tasklist.ui.actions;
+
+import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import org.eclipse.jdt.internal.ui.packageview.PackagesMessages;
+import org.eclipse.jface.action.Action;
+import org.eclipse.mylar.tasklist.TaskListImages;
+import org.eclipse.mylar.tasklist.ui.views.TaskListView;
+
+/**
+ * @author Mik Kersten
+ */
+public class CollapseAllAction extends Action {
+
+ public static final String ID = "org.eclipse.mylar.tasklist.actions.collapse.all";
+
+ private TaskListView taskListView;
+
+ public CollapseAllAction(TaskListView taskListView) {
+ super(PackagesMessages.CollapseAllAction_label);
+ this.taskListView = taskListView;
+ setId(ID);
+ setText("Collapse All");
+ setToolTipText("Collapse All");
+ setImageDescriptor(TaskListImages.COLLAPSE_ALL);
+ JavaPluginImages.setLocalImageDescriptors(this, "collapseall.gif"); //$NON-NLS-1$
+ }
+
+ public void run() {
+ if (taskListView.getViewer() != null) taskListView.getViewer().collapseAll();
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/TaskListView.java
index df8f6e634..ec16f2c3e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/TaskListView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/TaskListView.java
@@ -61,6 +61,7 @@ import org.eclipse.mylar.tasklist.internal.TaskListPatternFilter;
import org.eclipse.mylar.tasklist.internal.TaskPriorityFilter;
import org.eclipse.mylar.tasklist.ui.TaskEditorInput;
import org.eclipse.mylar.tasklist.ui.actions.AutoCloseAction;
+import org.eclipse.mylar.tasklist.ui.actions.CollapseAllAction;
import org.eclipse.mylar.tasklist.ui.actions.CreateCategoryAction;
import org.eclipse.mylar.tasklist.ui.actions.CreateTaskAction;
import org.eclipse.mylar.tasklist.ui.actions.DeleteAction;
@@ -118,6 +119,7 @@ public class TaskListView extends ViewPart {
private CreateTaskAction createTaskToolbar;
private CreateCategoryAction createCategory;
+ private CollapseAllAction collapseAll;
private DeleteAction delete;
private AutoCloseAction autoClose;
private OpenTaskEditorAction doubleClickAction;
@@ -868,6 +870,8 @@ public class TaskListView extends ViewPart {
}
private void fillLocalPullDown(IMenuManager manager) {
+ manager.add(collapseAll);
+ manager.add(new Separator());
manager.add(previousTaskAction);
manager.add(nextTaskAction);
manager.add(new Separator());
@@ -963,14 +967,12 @@ public class TaskListView extends ViewPart {
createCategory = new CreateCategoryAction(this);
delete = new DeleteAction(this);
+ collapseAll = new CollapseAllAction(this);
autoClose = new AutoCloseAction();
completeTask = new MarkTaskCompleteAction(this);
incompleteTask = new MarkTaskIncompleteAction(this);
-// rename = new RenameAction();
-// moveTaskToRoot = new MoveTaskToRootAction(this);
doubleClickAction = new OpenTaskEditorAction(this);
- filterCompleteTask = new FilterCompletedTasksAction(this);
-// filterInCompleteTask = new FilterIncompleteTasksAction();
+ filterCompleteTask = new FilterCompletedTasksAction(this);
filterOnPriority = new PriorityDropDownAction();
previousTaskAction = new NavigatePreviousAction(this, taskHistory);
nextTaskAction = new NextTaskAction(this, taskHistory);

Back to the top