Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2009-02-26 18:56:39 -0500
committermkersten2009-02-26 18:56:39 -0500
commit963586f7cff598b709041780a22f1c6dd6598320 (patch)
tree8dd2ff3ce96a754547f9098a6bd0061386949346
parentdf7cbab358bd656969aebfc4c1cbfa0c6949ed1c (diff)
downloadorg.eclipse.mylyn.tasks-963586f7cff598b709041780a22f1c6dd6598320.tar.gz
org.eclipse.mylyn.tasks-963586f7cff598b709041780a22f1c6dd6598320.tar.xz
org.eclipse.mylyn.tasks-963586f7cff598b709041780a22f1c6dd6598320.zip
RESOLVED - bug 266403: make it easier to add remote tasks to the Task List
https://bugs.eclipse.org/bugs/show_bug.cgi?id=266403
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java15
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java13
4 files changed, 31 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java
index f233dc1fb..0fd1843f1 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java
@@ -257,6 +257,8 @@ public class Messages extends NLS {
public static String AbstractTaskEditorPage_Synchronize_to_update_editor_contents;
+ public static String AbstractTaskEditorPage_Add_task_to_tasklist;
+
public static String AbstractTaskEditorPage_Task_has_incoming_changes;
public static String AbstractTaskEditorPage_Title;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties
index 332e731d2..c12921f1a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties
@@ -135,6 +135,7 @@ AbstractTaskEditorPage_Submit_failed=Submit failed
AbstractTaskEditorPage_Submit_failed_=Submit failed:
AbstractTaskEditorPage_Synchronize_to_retrieve_task_data=Synchronize to retrieve task data
AbstractTaskEditorPage_Synchronize_to_update_editor_contents=Synchronize to update editor contents
+AbstractTaskEditorPage_Add_task_to_tasklist=Not in Task List. Click to add.
AbstractTaskEditorPage_Task_has_incoming_changes=Task has incoming changes
AbstractTaskEditorPage_Title=Title
AbstractTaskEditorPage_Unable_to_submit_at_this_time=Unable to submit at this time. Check connectivity and retry.
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
index 915af919a..354791723 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
@@ -1415,6 +1415,21 @@ public abstract class AbstractTaskEditorPage extends TaskFormPage implements ISe
}
});
}
+ if (getTaskEditor().getMessage() == null
+ && TasksUiPlugin.getTaskList().getTask(task.getRepositoryUrl(), task.getTaskId()) == null) {
+ getTaskEditor().setMessage(Messages.AbstractTaskEditorPage_Add_task_to_tasklist,
+ IMessageProvider.INFORMATION, new HyperlinkAdapter() {
+ @Override
+ public void linkActivated(HyperlinkEvent e) {
+ if (TasksUiPlugin.getTaskList().getTask(task.getRepositoryUrl(), task.getTaskId()) == null) {
+ TasksUiPlugin.getTaskList().addTask(task,
+ TasksUiPlugin.getTaskList().getDefaultCategory());
+ getTaskEditor().setMessage(null, IMessageProvider.NONE, null);
+// updateHeaderMessage();
+ }
+ }
+ });
+ }
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
index 01af3efe7..f6a47f81a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
@@ -460,6 +460,19 @@ public class TaskEditor extends SharedHeaderFormEditor {
}
/**
+ * @since 3.1
+ */
+ public String getMessage() {
+ if (getHeaderForm() != null && getHeaderForm().getForm() != null) {
+ if (!getHeaderForm().getForm().isDisposed()) {
+ Form form = getHeaderForm().getForm().getForm();
+ return form.getMessage();
+ }
+ }
+ return null;
+ }
+
+ /**
* @since 3.0
*/
public void setStatus(String message, final String title, final IStatus status) {

Back to the top