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/etool16/navigate-next.gifbin0 -> 142 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/etool16/navigate-previous.gifbin0 -> 141 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/MylarTasklistPlugin.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskListImages.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/AutoCloseAction.java37
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/NavigatePreviousAction.java (renamed from org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/PreviousTaskAction.java)9
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/NextTaskAction.java5
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/preferences/MylarTaskPreferencePage.java17
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/TaskListView.java20
9 files changed, 70 insertions, 23 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/icons/etool16/navigate-next.gif b/org.eclipse.mylyn.tasks.ui/icons/etool16/navigate-next.gif
new file mode 100644
index 000000000..b1f1adf18
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/icons/etool16/navigate-next.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/etool16/navigate-previous.gif b/org.eclipse.mylyn.tasks.ui/icons/etool16/navigate-previous.gif
new file mode 100644
index 000000000..ff9c910a7
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/icons/etool16/navigate-previous.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/MylarTasklistPlugin.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/MylarTasklistPlugin.java
index 8c64e5724..b905f545c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/MylarTasklistPlugin.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/MylarTasklistPlugin.java
@@ -303,7 +303,7 @@ public class MylarTasklistPlugin extends AbstractUIPlugin implements IStartup {
@Override
protected void initializeDefaultPreferences(IPreferenceStore store) {
- store.setDefault(MylarPlugin.CLOSE_EDITORS, true);
+ store.setDefault(MylarPlugin.TASKLIST_EDITORS_CLOSE, true);
store.setDefault(SELECTED_PRIORITY, "P5");
store.setDefault(REPORT_OPEN_EDITOR, true);
store.setDefault(REPORT_OPEN_INTERNAL, false);
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 9cde2d7f1..eb75410c3 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
@@ -45,6 +45,9 @@ public class TaskListImages {
public static final ImageDescriptor CATEGORY = create(T_TOOL, "category.gif");
public static final ImageDescriptor CATEGORY_NEW = create(T_TOOL, "category-new.gif");
+ public static final ImageDescriptor NAVIGATE_PREVIOUS = create(T_TOOL, "navigate-previous.gif");
+ public static final ImageDescriptor NAVIGATE_NEXT = create(T_TOOL, "navigate-next.gif");
+
public static final ImageDescriptor TASK_ACTIVE = create(T_TOOL, "task-active.gif");
public static final ImageDescriptor TASK_INACTIVE = create(T_TOOL, "task-inactive.gif");
public static final ImageDescriptor TASK_COMPLETE = create(T_TOOL, "task-complete.gif");
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/AutoCloseAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/AutoCloseAction.java
new file mode 100644
index 000000000..151bd7921
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/AutoCloseAction.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * 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.jface.action.Action;
+import org.eclipse.mylar.core.MylarPlugin;
+import org.eclipse.mylar.tasklist.MylarTasklistPlugin;
+
+/**
+ * @author Mik Kersten and Ken Sueda
+ */
+public class AutoCloseAction extends Action {
+
+ public static final String ID = "org.eclipse.mylar.tasklist.actions.auto.close";
+
+ public AutoCloseAction() {
+ setText("Close files on task deactivation");
+ setId(ID);
+ setChecked(MylarTasklistPlugin.getPrefs().getBoolean(MylarPlugin.TASKLIST_EDITORS_CLOSE));
+// setImageDescriptor(TaskListImages.REMOVE);
+ }
+
+ @Override
+ public void run() {
+ boolean on = !MylarTasklistPlugin.getPrefs().getBoolean(MylarPlugin.TASKLIST_EDITORS_CLOSE);
+ MylarTasklistPlugin.getPrefs().setValue(MylarPlugin.TASKLIST_EDITORS_CLOSE, on);
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/PreviousTaskAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/NavigatePreviousAction.java
index ca089eb6b..3bbc2a4d3 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/PreviousTaskAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/NavigatePreviousAction.java
@@ -11,26 +11,27 @@
package org.eclipse.mylar.tasklist.ui.actions;
import org.eclipse.jface.action.Action;
+import org.eclipse.mylar.tasklist.TaskListImages;
import org.eclipse.mylar.tasklist.ui.views.TaskActivationHistory;
import org.eclipse.mylar.tasklist.ui.views.TaskListView;
/**
* @author Ken Sueda
*/
-public class PreviousTaskAction extends Action {
- public static final String ID = "org.eclipse.mylar.tasklist.actions.tas.previous";
+public class NavigatePreviousAction extends Action {
+ public static final String ID = "org.eclipse.mylar.tasklist.actions.navigate.previous";
private final TaskListView view;
private TaskActivationHistory taskHistory;
- public PreviousTaskAction(TaskListView view, TaskActivationHistory history) {
+ public NavigatePreviousAction(TaskListView view, TaskActivationHistory history) {
this.view = view;
taskHistory = history;
setText("Previous Task");
setToolTipText("Previous Task");
setId(ID);
setEnabled(false);
-// setImageDescriptor(TaskListImages.CATEGORY_NEW);
+ setImageDescriptor(TaskListImages.NAVIGATE_PREVIOUS);
}
@Override
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/NextTaskAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/NextTaskAction.java
index 379de183a..0550eaaee 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/NextTaskAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/NextTaskAction.java
@@ -12,6 +12,7 @@
package org.eclipse.mylar.tasklist.ui.actions;
import org.eclipse.jface.action.Action;
+import org.eclipse.mylar.tasklist.TaskListImages;
import org.eclipse.mylar.tasklist.ui.views.TaskActivationHistory;
import org.eclipse.mylar.tasklist.ui.views.TaskListView;
@@ -20,7 +21,7 @@ import org.eclipse.mylar.tasklist.ui.views.TaskListView;
*/
public class NextTaskAction extends Action {
- public static final String ID = "org.eclipse.mylar.tasklist.actions.task.next";
+ public static final String ID = "org.eclipse.mylar.tasklist.actions.navigate.next";
private final TaskListView view;
private TaskActivationHistory taskHistory;
@@ -32,7 +33,7 @@ public class NextTaskAction extends Action {
setToolTipText("Next Task");
setId(ID);
setEnabled(false);
-// setImageDescriptor(TaskListImages.CATEGORY_NEW);
+ setImageDescriptor(TaskListImages.NAVIGATE_NEXT);
}
@Override
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/preferences/MylarTaskPreferencePage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/preferences/MylarTaskPreferencePage.java
index 78117d465..32667ae76 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/preferences/MylarTaskPreferencePage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/preferences/MylarTaskPreferencePage.java
@@ -11,7 +11,6 @@
package org.eclipse.mylar.tasklist.ui.preferences;
import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.mylar.core.MylarPlugin;
import org.eclipse.mylar.tasklist.MylarTasklistPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -27,12 +26,12 @@ import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
/**
- * @author Ken Sueda
+ * @author Ken Sueda and Mik Kersten
*/
public class MylarTaskPreferencePage extends PreferencePage implements
IWorkbenchPreferencePage {
- private Button closeEditors = null;
+// private Button closeEditors = null;
private Button reportEditor = null;
private Button reportInternal = null;
private Button reportExternal = null;
@@ -65,9 +64,9 @@ public class MylarTaskPreferencePage extends PreferencePage implements
container.setLayoutData(gridData);
GridLayout gl = new GridLayout(1, false);
container.setLayout(gl);
- closeEditors = new Button(container, SWT.CHECK);
- closeEditors.setText("Close all editors on task deactivation (defaults to close only editors of interesting resources)");
- closeEditors.setSelection(getPreferenceStore().getBoolean(MylarPlugin.CLOSE_EDITORS));
+// closeEditors = new Button(container, SWT.CHECK);
+// closeEditors.setText("Close all editors on task deactivation (defaults to close only editors of interesting resources)");
+// closeEditors.setSelection(getPreferenceStore().getBoolean(MylarPlugin.TASKLIST_EDITORS_CLOSE));
multipleActive = new Button(container, SWT.CHECK);
multipleActive.setText("Enable multiple task contexts to be active");
@@ -105,7 +104,7 @@ public class MylarTaskPreferencePage extends PreferencePage implements
}
@Override
public boolean performOk() {
- getPreferenceStore().setValue(MylarPlugin.CLOSE_EDITORS, closeEditors.getSelection());
+// getPreferenceStore().setValue(MylarPlugin.TASKLIST_EDITORS_CLOSE, closeEditors.getSelection());
getPreferenceStore().setValue(MylarTasklistPlugin.REPORT_OPEN_EDITOR, reportEditor.getSelection());
getPreferenceStore().setValue(MylarTasklistPlugin.REPORT_OPEN_INTERNAL, reportInternal.getSelection());
getPreferenceStore().setValue(MylarTasklistPlugin.REPORT_OPEN_EXTERNAL, reportExternal.getSelection());
@@ -115,7 +114,7 @@ public class MylarTaskPreferencePage extends PreferencePage implements
}
@Override
public boolean performCancel() {
- closeEditors.setSelection(getPreferenceStore().getBoolean(MylarPlugin.CLOSE_EDITORS));
+// closeEditors.setSelection(getPreferenceStore().getBoolean(MylarPlugin.TASKLIST_EDITORS_CLOSE));
reportEditor.setSelection(getPreferenceStore().getBoolean(MylarTasklistPlugin.REPORT_OPEN_EDITOR));
reportInternal.setSelection(getPreferenceStore().getBoolean(MylarTasklistPlugin.REPORT_OPEN_INTERNAL));
reportExternal.setSelection(getPreferenceStore().getBoolean(MylarTasklistPlugin.REPORT_OPEN_EXTERNAL));
@@ -126,7 +125,7 @@ public class MylarTaskPreferencePage extends PreferencePage implements
public void performDefaults() {
super.performDefaults();
- closeEditors.setSelection(getPreferenceStore().getDefaultBoolean(MylarPlugin.CLOSE_EDITORS));
+// closeEditors.setSelection(getPreferenceStore().getDefaultBoolean(MylarPlugin.TASKLIST_EDITORS_CLOSE));
reportEditor.setSelection(getPreferenceStore().getDefaultBoolean(MylarTasklistPlugin.REPORT_OPEN_EDITOR));
reportInternal.setSelection(getPreferenceStore().getDefaultBoolean(MylarTasklistPlugin.REPORT_OPEN_INTERNAL));
reportExternal.setSelection(getPreferenceStore().getDefaultBoolean(MylarTasklistPlugin.REPORT_OPEN_EXTERNAL));
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 a95159bb6..b0f5f8849 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
@@ -60,6 +60,7 @@ import org.eclipse.mylar.tasklist.internal.TaskCompleteFilter;
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.CreateCategoryAction;
import org.eclipse.mylar.tasklist.ui.actions.CreateTaskAction;
import org.eclipse.mylar.tasklist.ui.actions.DeleteAction;
@@ -68,7 +69,7 @@ import org.eclipse.mylar.tasklist.ui.actions.MarkTaskCompleteAction;
import org.eclipse.mylar.tasklist.ui.actions.MarkTaskIncompleteAction;
import org.eclipse.mylar.tasklist.ui.actions.NextTaskAction;
import org.eclipse.mylar.tasklist.ui.actions.OpenTaskEditorAction;
-import org.eclipse.mylar.tasklist.ui.actions.PreviousTaskAction;
+import org.eclipse.mylar.tasklist.ui.actions.NavigatePreviousAction;
import org.eclipse.mylar.tasklist.ui.actions.TaskActivateAction;
import org.eclipse.mylar.tasklist.ui.actions.TaskDeactivateAction;
import org.eclipse.swt.SWT;
@@ -118,8 +119,9 @@ public class TaskListView extends ViewPart {
private CreateCategoryAction createCategory;
private DeleteAction delete;
+ private AutoCloseAction autoClose;
private OpenTaskEditorAction doubleClickAction;
- private PreviousTaskAction previousTaskAction;
+ private NavigatePreviousAction previousTaskAction;
private NextTaskAction nextTaskAction;
//private Action toggleIntersectionModeAction = new ToggleIntersectionModeAction();
@@ -963,10 +965,12 @@ public class TaskListView extends ViewPart {
}
private void fillLocalPullDown(IMenuManager manager) {
- drillDownAdapter.addNavigationActions(manager);
- manager.add(new Separator());
manager.add(previousTaskAction);
manager.add(nextTaskAction);
+ manager.add(new Separator());
+ drillDownAdapter.addNavigationActions(manager);
+ manager.add(new Separator());
+ manager.add(autoClose);
}
void fillContextMenu(IMenuManager manager) {
@@ -975,7 +979,8 @@ public class TaskListView extends ViewPart {
if (selectedObject instanceof ITaskListElement) {
element = (ITaskListElement) selectedObject;
}
-
+ addAction(autoClose, manager, element);
+ manager.add(new Separator());
addAction(completeTask, manager, element);
addAction(incompleteTask, manager, element);
addAction(delete, manager, element);
@@ -1056,6 +1061,7 @@ public class TaskListView extends ViewPart {
createCategory = new CreateCategoryAction(this);
delete = new DeleteAction(this);
+ autoClose = new AutoCloseAction();
completeTask = new MarkTaskCompleteAction(this);
incompleteTask = new MarkTaskIncompleteAction(this);
// rename = new RenameAction();
@@ -1064,7 +1070,7 @@ public class TaskListView extends ViewPart {
filterCompleteTask = new FilterCompletedTasksAction(this);
// filterInCompleteTask = new FilterIncompleteTasksAction();
filterOnPriority = new PriorityDropDownAction();
- previousTaskAction = new PreviousTaskAction(this, taskHistory);
+ previousTaskAction = new NavigatePreviousAction(this, taskHistory);
nextTaskAction = new NextTaskAction(this, taskHistory);
}
@@ -1081,7 +1087,7 @@ public class TaskListView extends ViewPart {
return nextTaskAction;
}
- public PreviousTaskAction getPreviousTaskAction() {
+ public NavigatePreviousAction getPreviousTaskAction() {
return previousTaskAction;
}
/**

Back to the top