Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2007-02-14 17:39:04 +0000
committermkersten2007-02-14 17:39:04 +0000
commit376865399d4aee61ac7faf6cbde3ba38831973cb (patch)
tree1a957a72be962210c65a3f4315465ff7c6240188
parentcd04d6a29f63fe6855988733308d2e3fc7c02e20 (diff)
downloadorg.eclipse.mylyn.tasks-376865399d4aee61ac7faf6cbde3ba38831973cb.tar.gz
org.eclipse.mylyn.tasks-376865399d4aee61ac7faf6cbde3ba38831973cb.tar.xz
org.eclipse.mylyn.tasks-376865399d4aee61ac7faf6cbde3ba38831973cb.zip
NEW - bug 166174: invalid handle for task, can not contain: -, was: MNGECLIPSE-9
https://bugs.eclipse.org/bugs/show_bug.cgi?id=166174
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java6
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryTaskHandleUtil.java2
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractQueryHit.java2
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java15
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskActivityLabelProvider.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskElementLabelProvider.java13
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListTableSorter.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/OpenRepositoryTaskJob.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeTaskJob.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/NewTaskEditorInput.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/RepositoryTaskEditorInput.java13
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditorInput.java31
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracTaskEditorFactory.java2
14 files changed, 43 insertions, 62 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java
index 33d49b9a2..832b710f8 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java
@@ -34,9 +34,9 @@ public class BugzillaTaskEditorInput extends RepositoryTaskEditorInput {
private BugzillaTask bugTask;
- public BugzillaTaskEditorInput(TaskRepository repository, BugzillaTask bugTask, boolean offline) {
- super(repository, bugTask.getHandleIdentifier(), bugTask.getTaskUrl());
- this.bugTask = bugTask;
+ public BugzillaTaskEditorInput(TaskRepository repository, BugzillaTask bugzillaTask, boolean offline) {
+ super(repository, bugzillaTask.getHandleIdentifier(), bugzillaTask.getTaskUrl(), bugzillaTask.getTaskId());
+ this.bugTask = bugzillaTask;
updateOptions(getTaskData());
updateOptions(getOldTaskData());
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryTaskHandleUtil.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryTaskHandleUtil.java
index 61cfad9a4..b659a4c03 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryTaskHandleUtil.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryTaskHandleUtil.java
@@ -11,8 +11,6 @@
package org.eclipse.mylar.internal.tasks.core;
-
-
/**
* @author Mik Kersten
*/
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractQueryHit.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractQueryHit.java
index 7bd016f86..6ba045fa7 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractQueryHit.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractQueryHit.java
@@ -128,7 +128,7 @@ public abstract class AbstractQueryHit implements ITaskListElement {
* @return An ID that can be presented to the user for identifying the task,
* override to return null if no such ID exists.
*/
- public String getIdLabel() {
+ public String getIdentifyingLabel() {
return getTaskId();
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java
index 033b93c52..432394ef7 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java
@@ -27,7 +27,6 @@ import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.mylar.core.MylarStatusHandler;
-import org.eclipse.mylar.internal.tasks.core.RepositoryTaskHandleUtil;
import org.eclipse.mylar.internal.tasks.core.TaskRepositoriesExternalizer;
/**
@@ -176,7 +175,7 @@ public class TaskRepositoryManager {
if (activeTasks.size() == 1) {
ITask activeTask = activeTasks.get(0);
if (activeTask instanceof AbstractRepositoryTask) {
- String repositoryUrl = RepositoryTaskHandleUtil.getRepositoryUrl(activeTask.getHandleIdentifier());
+ String repositoryUrl = ((AbstractRepositoryTask)activeTask).getRepositoryUrl();
for (TaskRepository repository : getRepositories(repositoryKind)) {
if (repository.getUrl().equals(repositoryUrl)) {
return repository;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java
index 8c93d1299..24a0f5932 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java
@@ -27,10 +27,10 @@ import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.mylar.internal.tasks.core.RepositoryTaskHandleUtil;
import org.eclipse.mylar.internal.tasks.ui.views.TaskElementLabelProvider;
import org.eclipse.mylar.tasks.core.AbstractQueryHit;
import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery;
+import org.eclipse.mylar.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylar.tasks.core.ITask;
import org.eclipse.mylar.tasks.core.ITaskListElement;
import org.eclipse.mylar.tasks.core.TaskList;
@@ -84,14 +84,17 @@ public class TaskSelectionDialog extends SelectionStatusDialog {
return TasksUiPlugin.getTaskListManager().getTaskActivationHistory().getPreviousTasks().contains(
element);
}
- if (element instanceof ITask) {
- ITask task = (ITask) element;
- String taskString = RepositoryTaskHandleUtil.getTaskId(task.getHandleIdentifier()) + ": "
- + task.getSummary();
+ if (element instanceof AbstractRepositoryTask) {
+ AbstractRepositoryTask repositoryTask = (AbstractRepositoryTask) element;
+ String taskString = repositoryTask.getIdentifyingLabel() + ": "
+ + repositoryTask.getSummary();
+ return pattern.matcher(taskString).find();
+ } else if (element instanceof ITask) {
+ String taskString = ((ITask) element).getSummary();
return pattern.matcher(taskString).find();
} else if (element instanceof AbstractQueryHit) {
AbstractQueryHit hit = (AbstractQueryHit) element;
- String taskString = hit.getIdLabel() + ": " + hit.getSummary();
+ String taskString = hit.getIdentifyingLabel() + ": " + hit.getSummary();
return pattern.matcher(taskString).find();
}
return false;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskActivityLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskActivityLabelProvider.java
index 907cf0fa4..88c1fea1d 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskActivityLabelProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskActivityLabelProvider.java
@@ -21,7 +21,6 @@ import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.mylar.core.MylarStatusHandler;
import org.eclipse.mylar.internal.core.util.DateUtil;
-import org.eclipse.mylar.internal.tasks.core.RepositoryTaskHandleUtil;
import org.eclipse.mylar.internal.tasks.ui.TaskListColorsAndFonts;
import org.eclipse.mylar.internal.tasks.ui.TaskListImages;
import org.eclipse.mylar.tasks.core.AbstractRepositoryTask;
@@ -77,7 +76,7 @@ public class TaskActivityLabelProvider extends DecoratingLabelProvider implement
switch (columnIndex) {
case 2:
if(task instanceof AbstractRepositoryTask) {
- return RepositoryTaskHandleUtil.getTaskId(task.getHandleIdentifier())+": "+task.getSummary();
+ return ((AbstractRepositoryTask)task).getIdentifyingLabel() +": " + task.getSummary();
} else {
return task.getSummary();
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskElementLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskElementLabelProvider.java
index 9bf06bafb..133a0b848 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskElementLabelProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskElementLabelProvider.java
@@ -16,7 +16,6 @@ import java.util.regex.Pattern;
import org.eclipse.jface.viewers.IColorProvider;
import org.eclipse.jface.viewers.IFontProvider;
import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.mylar.internal.tasks.core.RepositoryTaskHandleUtil;
import org.eclipse.mylar.internal.tasks.ui.ITaskHighlighter;
import org.eclipse.mylar.internal.tasks.ui.TaskListColorsAndFonts;
import org.eclipse.mylar.internal.tasks.ui.TaskListImages;
@@ -112,14 +111,14 @@ public class TaskElementLabelProvider extends LabelProvider implements IColorPro
if (object instanceof AbstractQueryHit) {
AbstractQueryHit hit = (AbstractQueryHit) object;
if (hit.getSummary() == null) {
- if (hit.getIdLabel() != null) {
- return hit.getIdLabel() + NO_SUMMARY_AVAILABLE;
+ if (hit.getIdentifyingLabel() != null) {
+ return hit.getIdentifyingLabel() + NO_SUMMARY_AVAILABLE;
} else {
return hit.getTaskId() + NO_SUMMARY_AVAILABLE;
}
- } else if (!pattern.matcher(hit.getSummary()).matches() && hit.getIdLabel() != null
- && !hit.getIdLabel().equals("")) {
- return hit.getIdLabel() + ": " + hit.getSummary();
+ } else if (!pattern.matcher(hit.getSummary()).matches() && hit.getIdentifyingLabel() != null
+ && !hit.getIdentifyingLabel().equals("")) {
+ return hit.getIdentifyingLabel() + ": " + hit.getSummary();
} else {
return hit.getSummary();
}
@@ -129,7 +128,7 @@ public class TaskElementLabelProvider extends LabelProvider implements IColorPro
if (task.getIdentifyingLabel() != null) {
return task.getIdentifyingLabel() + NO_SUMMARY_AVAILABLE;
} else {
- return RepositoryTaskHandleUtil.getTaskId(task.getHandleIdentifier()) + NO_SUMMARY_AVAILABLE;
+ return task.getTaskId() + NO_SUMMARY_AVAILABLE;
}
} else if (!pattern.matcher(task.getSummary()).matches()) {
if (task.getIdentifyingLabel() != null) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListTableSorter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListTableSorter.java
index 2a0ad5a18..4ffdee1f1 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListTableSorter.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListTableSorter.java
@@ -111,7 +111,7 @@ public class TaskListTableSorter extends ViewerSorter {
if (task1 != null && task1.getIdentifyingLabel() != null) {
summary = task1.getIdentifyingLabel() + ": " + summary;
} else {
- summary = ((AbstractQueryHit)element).getIdLabel() + ": " + summary;
+ summary = ((AbstractQueryHit)element).getIdentifyingLabel() + ": " + summary;
}
} else if (element instanceof AbstractRepositoryTask) {
AbstractRepositoryTask task1 = (AbstractRepositoryTask)element;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/OpenRepositoryTaskJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/OpenRepositoryTaskJob.java
index 3dbb46e29..bce2fe1d7 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/OpenRepositoryTaskJob.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/OpenRepositoryTaskJob.java
@@ -86,8 +86,7 @@ public class OpenRepositoryTaskJob extends Job {
TasksUiPlugin.getDefault().getTaskDataManager().push(RepositoryTaskHandleUtil.getHandle(repository.getUrl(), taskId),
downloadedTaskData);
}
- openEditor(repository, RepositoryTaskHandleUtil.getHandle(repository.getUrl(), taskId),
- downloadedTaskData);
+ openEditor(repository, RepositoryTaskHandleUtil.getHandle(repository.getUrl(), taskId), taskId, downloadedTaskData);
} else {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
@@ -107,7 +106,7 @@ public class OpenRepositoryTaskJob extends Job {
return new Status(IStatus.OK, TasksUiPlugin.PLUGIN_ID, IStatus.OK, "", null);
}
- private void openEditor(final TaskRepository repository, final String handle, final RepositoryTaskData taskData) {
+ private void openEditor(final TaskRepository repository, final String handle, final String taskId, final RepositoryTaskData taskData) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
if (taskData == null) {
@@ -116,7 +115,7 @@ public class OpenRepositoryTaskJob extends Job {
// AbstractTaskEditorInput editorInput = new
// RepositoryTaskEditorInput(taskUrl, repository, taskData,
// null);
- AbstractTaskEditorInput editorInput = new RepositoryTaskEditorInput(repository, handle, taskUrl);
+ AbstractTaskEditorInput editorInput = new RepositoryTaskEditorInput(repository, handle, taskUrl, taskId);
TasksUiUtil.openEditor(editorInput, TaskListPreferenceConstants.TASK_EDITOR_ID, page);
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeTaskJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeTaskJob.java
index 78be1c144..3923e39d0 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeTaskJob.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeTaskJob.java
@@ -20,7 +20,6 @@ import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.mylar.core.MylarStatusHandler;
-import org.eclipse.mylar.internal.tasks.core.RepositoryTaskHandleUtil;
import org.eclipse.mylar.internal.tasks.ui.TaskListImages;
import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylar.tasks.core.AbstractRepositoryTask;
@@ -117,7 +116,7 @@ class SynchronizeTaskJob extends Job {
TasksUiPlugin.getTaskListManager().getTaskList().notifyLocalInfoChanged(repositoryTask);
ITaskDataHandler taskDataHandler = connector.getTaskDataHandler();
if (taskDataHandler != null) {
- String taskId = RepositoryTaskHandleUtil.getTaskId(repositoryTask.getHandleIdentifier());
+ String taskId = repositoryTask.getTaskId();
RepositoryTaskData downloadedTaskData = taskDataHandler.getTaskData(repository, taskId);
if (downloadedTaskData != null) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/NewTaskEditorInput.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/NewTaskEditorInput.java
index 289c36069..6fd0c71d3 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/NewTaskEditorInput.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/NewTaskEditorInput.java
@@ -20,7 +20,8 @@ import org.eclipse.mylar.tasks.core.TaskRepository;
public class NewTaskEditorInput extends RepositoryTaskEditorInput {
public NewTaskEditorInput(TaskRepository repository, RepositoryTaskData taskData) {
- super(repository, taskData.getId(), "");
+ // TODO: should not have taskData.getId() twice
+ super(repository, taskData.getId(), "", taskData.getId());
super.setOldTaskData(taskData);
super.setEditableTaskData(taskData);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/RepositoryTaskEditorInput.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/RepositoryTaskEditorInput.java
index 1a4509d71..b02a5f1c3 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/RepositoryTaskEditorInput.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/RepositoryTaskEditorInput.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.mylar.tasks.ui.editors;
-import org.eclipse.mylar.internal.tasks.core.RepositoryTaskHandleUtil;
import org.eclipse.mylar.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylar.tasks.core.ITask;
import org.eclipse.mylar.tasks.core.TaskRepository;
@@ -22,15 +21,15 @@ import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
*/
public class RepositoryTaskEditorInput extends AbstractTaskEditorInput {
- protected String id;
+ protected String taskId;
protected String url;
protected AbstractRepositoryTask repositoryTask = null;
- public RepositoryTaskEditorInput(TaskRepository repository, String handle, String taskUrl) {
+ public RepositoryTaskEditorInput(TaskRepository repository, String handle, String taskUrl, String taskId) {
super(repository, handle);
- this.id = RepositoryTaskHandleUtil.getTaskId(handle);
+ this.taskId = taskId;
this.url = taskUrl;
ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(handle);
if (task != null && task instanceof AbstractRepositoryTask) {
@@ -54,8 +53,8 @@ public class RepositoryTaskEditorInput extends AbstractTaskEditorInput {
return label;
} else if (getTaskData() != null && getTaskData().getLabel() != null) {
return getTaskData().getId()+": "+getTaskData().getLabel();
- } else if (id != null) {
- return id;
+ } else if (taskId != null) {
+ return taskId;
} else {
return "<unknown>";
}
@@ -65,7 +64,7 @@ public class RepositoryTaskEditorInput extends AbstractTaskEditorInput {
* @return The taskId of the bug for this editor input.
*/
public String getId() {
- return id;
+ return taskId;
}
@Override
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditorInput.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditorInput.java
index 39145a464..f50bd162c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditorInput.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditorInput.java
@@ -14,7 +14,6 @@
package org.eclipse.mylar.tasks.ui.editors;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.mylar.internal.tasks.core.RepositoryTaskHandleUtil;
import org.eclipse.mylar.internal.tasks.ui.editors.TaskEditorInputFactory;
import org.eclipse.mylar.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylar.tasks.core.ITask;
@@ -33,21 +32,14 @@ public class TaskEditorInput implements IEditorInput, IPersistableElement {
private ITask task;
- private String id;
-
- private String label;
+ private String summary;
private boolean newTask = false;
public TaskEditorInput(ITask task, boolean newTask) {
this.newTask = newTask;
- init(task);
- }
-
- private void init(ITask task) {
this.task = task;
- id = RepositoryTaskHandleUtil.getTaskId(task.getHandleIdentifier());
- label = truncateDescription(task.getSummary());
+ summary = truncateDescription(task.getSummary());
}
private String truncateDescription(String description) {
@@ -95,7 +87,7 @@ public class TaskEditorInput implements IEditorInput, IPersistableElement {
* @see org.eclipse.ui.IEditorInput#getToolTipText()
*/
public String getToolTipText() {
- return label;
+ return summary;
}
/*
@@ -119,13 +111,6 @@ public class TaskEditorInput implements IEditorInput, IPersistableElement {
}
/**
- * @return Returns the taskId.
- */
- public String getId() {
- return id;
- }
-
- /**
* @return Returns the label.
*/
public String getLabel() {
@@ -133,15 +118,15 @@ public class TaskEditorInput implements IEditorInput, IPersistableElement {
AbstractRepositoryTask repositoryTask = (AbstractRepositoryTask)task;
String idLabel = repositoryTask.getIdentifyingLabel();
- label = "";
+ summary = "";
if (idLabel != null) {
- label += idLabel + ": ";
+ summary += idLabel + ": ";
}
- label += truncateDescription(task.getSummary());
+ summary += truncateDescription(task.getSummary());
} else if (task != null){
- label = truncateDescription(task.getSummary());
+ summary = truncateDescription(task.getSummary());
}
- return label;
+ return summary;
}
@Override
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracTaskEditorFactory.java b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracTaskEditorFactory.java
index 1271011b2..3237c3504 100644
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracTaskEditorFactory.java
+++ b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracTaskEditorFactory.java
@@ -69,7 +69,7 @@ public class TracTaskEditorFactory implements ITaskEditorFactory {
TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(TracCorePlugin.REPOSITORY_KIND,
tracTask.getRepositoryUrl());
try {
- return new RepositoryTaskEditorInput(repository, tracTask.getHandleIdentifier(), tracTask.getTaskUrl());
+ return new RepositoryTaskEditorInput(repository, tracTask.getHandleIdentifier(), tracTask.getTaskUrl(), tracTask.getTaskId());
} catch (Exception e) {
MylarStatusHandler.fail(e, "Could not create Trac editor input", true);
}

Back to the top