Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2007-02-16 22:28:42 -0500
committermkersten2007-02-16 22:28:42 -0500
commit2dca7c20e5bafce0b6d5180230012e0c9b4d3802 (patch)
tree2de6a7445e84133d760d274c75638346cb9ba6d1
parent928535da825634030c1046c75a9767f27941f862 (diff)
downloadorg.eclipse.mylyn.tasks-2dca7c20e5bafce0b6d5180230012e0c9b4d3802.tar.gz
org.eclipse.mylyn.tasks-2dca7c20e5bafce0b6d5180230012e0c9b4d3802.tar.xz
org.eclipse.mylyn.tasks-2dca7c20e5bafce0b6d5180230012e0c9b4d3802.zip
RESOLVED - bug 170659: direct way to add an already opened remote task to the task list
https://bugs.eclipse.org/bugs/show_bug.cgi?id=170659
-rw-r--r--org.eclipse.mylyn.help.ui/doc/new.html22
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AddExistingTaskJob.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java46
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java2
4 files changed, 66 insertions, 6 deletions
diff --git a/org.eclipse.mylyn.help.ui/doc/new.html b/org.eclipse.mylyn.help.ui/doc/new.html
index ea33f8c06..1fb992d5d 100644
--- a/org.eclipse.mylyn.help.ui/doc/new.html
+++ b/org.eclipse.mylyn.help.ui/doc/new.html
@@ -52,9 +52,11 @@ update notes</a><br>
Task editor refreshes with new incoming<br>
Conflict state in editor and what it means (incoming &amp; outgoing at
same time)<br>
- Use 'Clear outgoing' to discard unsubmitted changes<br>
+ Use 'Clear outgoing' to discard unsubmitted changes<p>Add to Task
+ List.<br>
<br>
-&nbsp;<p>
+&nbsp;</p>
+ <p>
<img src="images/1.0/patch-apply.gif"></td>
</tr>
<tr>
@@ -64,6 +66,22 @@ update notes</a><br>
</tr>
</table>
+<table cellpadding="10" cellspacing="0" http://www.eclipse.org/mylar/doc/images/dev/ id="table315">
+ <tr>
+ <td align="left" valign="top" width="15%" bgcolor=#E0D0E6>
+ <p align="right"><b>Hyperlinks in Java Editor<br>
+ (Eclipse 3.3 only)</b></p>
+ </td>
+ <td valign="top" width="70%">
+ repository must be set on project</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr>
+ </td>
+ </tr>
+</table>
+
<table cellpadding="10" cellspacing="0" http://www.eclipse.org/mylar/doc/images/dev/ id="table314">
<tr>
<td align="left" valign="top" width="15%" bgcolor=#E0D0E6>
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AddExistingTaskJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AddExistingTaskJob.java
index 9c893785b..becffc1a2 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AddExistingTaskJob.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AddExistingTaskJob.java
@@ -59,7 +59,7 @@ public class AddExistingTaskJob extends Job {
}
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ public IStatus run(IProgressMonitor monitor) {
final AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
repository.getKind());
try {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java
index 75b94510e..bb11dfd74 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java
@@ -12,6 +12,7 @@
package org.eclipse.mylar.internal.tasks.ui.editors;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import org.eclipse.jface.action.Action;
@@ -28,30 +29,38 @@ import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.mylar.internal.tasks.ui.AddExistingTaskJob;
import org.eclipse.mylar.internal.tasks.ui.IDynamicSubMenuContributor;
+import org.eclipse.mylar.internal.tasks.ui.TaskListImages;
import org.eclipse.mylar.internal.tasks.ui.actions.AttachFileAction;
import org.eclipse.mylar.internal.tasks.ui.actions.CopyTaskDetailsAction;
import org.eclipse.mylar.internal.tasks.ui.actions.OpenWithBrowserAction;
import org.eclipse.mylar.internal.tasks.ui.actions.TaskActivateAction;
import org.eclipse.mylar.internal.tasks.ui.actions.TaskDeactivateAction;
+import org.eclipse.mylar.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylar.tasks.core.AbstractRepositoryTask;
+import org.eclipse.mylar.tasks.core.AbstractTaskContainer;
import org.eclipse.mylar.tasks.core.ITask;
import org.eclipse.mylar.tasks.core.ITaskListElement;
import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
import org.eclipse.mylar.tasks.ui.editors.AbstractRepositoryTaskEditor;
+import org.eclipse.mylar.tasks.ui.editors.RepositoryTaskEditorInput;
import org.eclipse.mylar.tasks.ui.editors.TaskEditor;
import org.eclipse.mylar.tasks.ui.editors.TaskFormPage;
import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.SubActionBars;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.internal.ObjectActionContributorManager;
import org.eclipse.ui.internal.WorkbenchImages;
import org.eclipse.ui.internal.WorkbenchMessages;
import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
+import org.eclipse.ui.progress.IProgressService;
import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
/**
@@ -156,10 +165,28 @@ public class TaskEditorActionContributor extends MultiPageEditorActionBarContrib
addClipboardActions(manager);
}
- if (editor.getTaskEditorInput() == null)
+ if (editor.getTaskEditorInput() == null) {
+ final MenuManager subMenuManager = new MenuManager("Add to " + TaskListView.LABEL_VIEW);
+ List<AbstractTaskContainer> categories = new ArrayList<AbstractTaskContainer>(TasksUiPlugin.getTaskListManager().getTaskList().getCategories());
+ Collections.sort(categories);
+ for (final AbstractTaskContainer category : categories) {
+ if (!category.equals(TasksUiPlugin.getTaskListManager().getTaskList().getArchiveContainer())) {
+ Action action = new Action() {
+ @Override
+ public void run() {
+ moveToCategory(category);
+ }
+ };
+ String text = category.getSummary();
+ action.setText(text);
+ action.setImageDescriptor(TaskListImages.CATEGORY);
+ subMenuManager.add(action);
+ }
+ }
+ manager.add(subMenuManager);
return;
+ }
final ITask task = editor.getTaskEditorInput().getTask();
-
if (task == null) {
return;
} else {
@@ -232,6 +259,21 @@ public class TaskEditorActionContributor extends MultiPageEditorActionBarContrib
manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}
+ private void moveToCategory(AbstractTaskContainer category) {
+ IEditorInput input = getEditor().getEditorInput();
+ if (input instanceof RepositoryTaskEditorInput) {
+ RepositoryTaskEditorInput repositoryTaskEditorInput = (RepositoryTaskEditorInput)input;
+ final IProgressService svc = PlatformUI.getWorkbench().getProgressService();
+ final AddExistingTaskJob job = new AddExistingTaskJob(repositoryTaskEditorInput.getRepository(), repositoryTaskEditorInput.getId(), category);
+ job.schedule();
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ svc.showInDialog(getEditor().getSite().getShell(), job);
+ }
+ });
+ }
+ }
+
public void updateSelectableActions(ISelection selection) {
if (editor != null) {
cutAction.selectionChanged(selection);
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 f9a36e5a4..6244318a4 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
@@ -384,7 +384,7 @@ public class TaskEditor extends FormEditor {
task = taskEditorInput.getTask();
setPartName(taskEditorInput.getLabel());
}
-
+
int selectedIndex = index;
for (ITaskEditorFactory factory : TasksUiPlugin.getDefault().getTaskEditorFactories()) {
if (factory.canCreateEditorFor(task) || factory.canCreateEditorFor(getEditorInput())) {

Back to the top