Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2006-01-24 23:54:49 +0000
committermkersten2006-01-24 23:54:49 +0000
commit5688d7479bf404f400ce9aee0f4968ba5fb811b4 (patch)
treef54057be5a15533347ab8902aab3b752baabf57b
parentfd4bde36e21d36b64b1ced6d167a5f7ea3f4146c (diff)
downloadorg.eclipse.mylyn.tasks-5688d7479bf404f400ce9aee0f4968ba5fb811b4.tar.gz
org.eclipse.mylyn.tasks-5688d7479bf404f400ce9aee0f4968ba5fb811b4.tar.xz
org.eclipse.mylyn.tasks-5688d7479bf404f400ce9aee0f4968ba5fb811b4.zip
Completed: Bug 124768: Back button broken in the add repository query wizard
https://bugs.eclipse.org/bugs/show_bug.cgi?id=124768
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTask.java12
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditor.java6
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/NewBugzillaReportWizard.java17
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/Task.java39
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/TaskListManager.java1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/CategoryEditor.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/TaskInfoEditor.java50
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskListView.java75
8 files changed, 94 insertions, 113 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTask.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTask.java
index 5e8fe4b51..2fe751afb 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTask.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTask.java
@@ -232,7 +232,8 @@ public class BugzillaTask extends Task {
*/
public void setDirty(boolean isDirty) {
this.isDirty = isDirty;
- notifyTaskDataChange();
+// MylarTaskListPlugin.getTaskListManager().notifyTaskChanged(this);
+// notifyTaskDataChange();
}
/**
@@ -425,21 +426,24 @@ public class BugzillaTask extends Task {
super(name);
setRule(rule);
state = BugTaskState.WAITING;
- notifyTaskDataChange();
+ MylarTaskListPlugin.getTaskListManager().notifyTaskChanged(BugzillaTask.this);
+// notifyTaskDataChange();
}
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
state = BugTaskState.DOWNLOADING;
- notifyTaskDataChange();
+ MylarTaskListPlugin.getTaskListManager().notifyTaskChanged(BugzillaTask.this);
+// notifyTaskDataChange();
// Update time this bugtask was last downloaded.
lastRefresh = new Date();
bugReport = downloadReport();
state = BugTaskState.FREE;
updateTaskDetails();
- notifyTaskDataChange();
+ MylarTaskListPlugin.getTaskListManager().notifyTaskChanged(BugzillaTask.this);
+// notifyTaskDataChange();
saveBugReport(true);
} catch (Exception e) {
MylarStatusHandler.fail(e, "Could not download report", false);
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditor.java
index 41b0e3709..190fe9a76 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditor.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditor.java
@@ -24,7 +24,6 @@ import org.eclipse.mylar.internal.bugzilla.ui.editor.ExistingBugEditor;
import org.eclipse.mylar.internal.tasklist.ui.MylarTaskEditor;
import org.eclipse.mylar.internal.tasklist.ui.TaskEditorInput;
import org.eclipse.mylar.internal.tasklist.ui.TaskListImages;
-import org.eclipse.mylar.internal.tasklist.ui.views.TaskListView;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorInput;
@@ -57,10 +56,11 @@ public class BugzillaTaskEditor extends MylarTaskEditor {
private IBugzillaAttributeListener ATTRIBUTE_LISTENER = new IBugzillaAttributeListener() {
public void attributeChanged(String attribute, String value) {
+ // TODO: get rid of this?
if (attribute.equals("Priority")) {
bugTask.setPriority(value);
- if (TaskListView.getDefault() != null)
- TaskListView.getDefault().notifyTaskDataChanged(bugTask);
+// if (TaskListView.getDefault() != null)
+// TaskListView.getDefault().notifyTaskDataChanged(bugTask);
}
}
};
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/NewBugzillaReportWizard.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/NewBugzillaReportWizard.java
index adba08917..74bba2e30 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/NewBugzillaReportWizard.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/NewBugzillaReportWizard.java
@@ -10,8 +10,10 @@
*******************************************************************************/
package org.eclipse.mylar.internal.bugzilla.ui.wizard;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.mylar.internal.bugzilla.core.IBugzillaConstants;
import org.eclipse.mylar.internal.bugzilla.ui.BugzillaUiPlugin;
import org.eclipse.mylar.internal.bugzilla.ui.OfflineView;
import org.eclipse.mylar.internal.bugzilla.ui.tasklist.BugzillaTask;
@@ -77,18 +79,23 @@ public class NewBugzillaReportWizard extends AbstractBugWizard {
@Override
public boolean performFinish() {
+ super.performFinish();
String bugIdString = this.getId();
int bugId = -1;
+ boolean validId = false;
try {
if (bugIdString != null) {
bugId = Integer.parseInt(bugIdString);
- } else {
- return false;
- }
+ validId = true;
+ }
} catch (NumberFormatException nfe) {
- // TODO handle error
- return false;
+ // ignore
}
+ if (!validId) {
+ MessageDialog.openError(null, IBugzillaConstants.TITLE_MESSAGE_DIALOG,
+ "Could not create bug id, no valid id");
+ return false;
+ }
// TaskRepository repository =
// MylarTaskListPlugin.getRepositoryManager().getDefaultRepository(BugzillaPlugin.REPOSITORY_KIND);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/Task.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/Task.java
index 7a2dcd700..02527106c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/Task.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/Task.java
@@ -21,7 +21,6 @@ import org.eclipse.mylar.core.MylarPlugin;
import org.eclipse.mylar.internal.core.util.MylarStatusHandler;
import org.eclipse.mylar.internal.tasklist.ui.TaskEditorInput;
import org.eclipse.mylar.internal.tasklist.ui.TaskListImages;
-import org.eclipse.mylar.internal.tasklist.ui.views.TaskListView;
import org.eclipse.mylar.tasklist.ITask;
import org.eclipse.mylar.tasklist.ITaskCategory;
import org.eclipse.mylar.tasklist.MylarTaskListPlugin;
@@ -153,11 +152,7 @@ public class Task implements ITask {
}
}
- /**
- * Opens the task in an editor.
- *
- * @return Resulting <code>IStatus</code> of the operation
- */
+ @Deprecated
protected void openTaskEditor() {
// get the active page so that we can reuse it
@@ -176,22 +171,22 @@ public class Task implements ITask {
}
}
- /**
- * Refreshes the tasklist viewer.
- *
- * TODO: shouldn't be coupled to the TaskListView
- */
- public void notifyTaskDataChange() {
- final Task task = this;
- if (Workbench.getInstance() != null && !Workbench.getInstance().getDisplay().isDisposed()) {
- Workbench.getInstance().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (TaskListView.getDefault() != null)
- TaskListView.getDefault().notifyTaskDataChanged(task);
- }
- });
- }
- }
+// /**
+// * Refreshes the tasklist viewer.
+// *
+// * TODO: shouldn't be coupled to the TaskListView
+// */
+// public void notifyTaskDataChange() {
+// final Task task = this;
+// if (Workbench.getInstance() != null && !Workbench.getInstance().getDisplay().isDisposed()) {
+// Workbench.getInstance().getDisplay().asyncExec(new Runnable() {
+// public void run() {
+// if (TaskListView.getDefault() != null)
+// TaskListView.getDefault().notifyTaskDataChanged(task);
+// }
+// });
+// }
+// }
public String getToolTipText() {
return getDescription();
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/TaskListManager.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/TaskListManager.java
index 36035543b..bbcc34591 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/TaskListManager.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/TaskListManager.java
@@ -112,6 +112,7 @@ public class TaskListManager {
taskListWriter.writeTaskList(taskList, taskListFile);
MylarPlugin.getDefault().getPreferenceStore().setValue(TaskListPreferenceConstants.TASK_ID, nextTaskId);
} else {
+ Thread.dumpStack();
MylarStatusHandler.log("task list save attempted before initialization", this);
}
} catch (Exception e) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/CategoryEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/CategoryEditor.java
index 70ae52f7c..7af6de024 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/CategoryEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/CategoryEditor.java
@@ -12,7 +12,7 @@
package org.eclipse.mylar.internal.tasklist.ui;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.mylar.internal.tasklist.ui.views.TaskListView;
+import org.eclipse.mylar.tasklist.MylarTaskListPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -46,8 +46,9 @@ public class CategoryEditor extends EditorPart {
public void doSave(IProgressMonitor monitor) {
input.setCategoryName(description.getText());
isDirty = false;
- if (TaskListView.getDefault() != null)
- TaskListView.getDefault().notifyTaskDataChanged(null);
+ MylarTaskListPlugin.getTaskListManager().notifyListUpdated();
+// if (TaskListView.getDefault() != null)
+// TaskListView.getDefault().notifyTaskDataChanged(null);
firePropertyChange(PROP_DIRTY);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/TaskInfoEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/TaskInfoEditor.java
index 6ddc77324..94eedbb9b 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/TaskInfoEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/TaskInfoEditor.java
@@ -60,6 +60,7 @@ import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.internal.Workbench;
import org.eclipse.ui.internal.WorkbenchImages;
import org.eclipse.ui.internal.WorkbenchMessages;
import org.eclipse.ui.part.EditorPart;
@@ -149,25 +150,30 @@ public class TaskInfoEditor extends EditorPart {
// ignore
}
- public void taskChanged(ITask updateTask) {
+ public void taskChanged(final ITask updateTask) {
if (updateTask != null && updateTask.getHandleIdentifier().equals(task.getHandleIdentifier())) {
- if (!description.isDisposed()) {
- description.setText(updateTask.getDescription());
- // TaskInfoEditor.this.setPartName(updateTask.getDescription(true));
- parentEditor.changeTitle();
- }
- if (!priorityCombo.isDisposed()) {
- int selectionIndex = priorityCombo.indexOf(updateTask.getPriority());
- priorityCombo.select(selectionIndex);
- }
- if (!statusCombo.isDisposed()) {
- int selectionIndex = statusCombo.indexOf(updateTask.getStatus().toString());
- statusCombo.select(selectionIndex);
- }
- if (updateTask.isLocal() && !endDate.isDisposed()) {
- endDate.setText(getTaskDateString(updateTask));
- }
-
+ if (Workbench.getInstance() != null && !Workbench.getInstance().getDisplay().isDisposed()) {
+ Workbench.getInstance().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ if (!description.isDisposed()) {
+ description.setText(updateTask.getDescription());
+ // TaskInfoEditor.this.setPartName(updateTask.getDescription(true));
+ parentEditor.changeTitle();
+ }
+ if (!priorityCombo.isDisposed()) {
+ int selectionIndex = priorityCombo.indexOf(updateTask.getPriority());
+ priorityCombo.select(selectionIndex);
+ }
+ if (!statusCombo.isDisposed()) {
+ int selectionIndex = statusCombo.indexOf(updateTask.getStatus().toString());
+ statusCombo.select(selectionIndex);
+ }
+ if (updateTask.isLocal() && !endDate.isDisposed()) {
+ endDate.setText(getTaskDateString(updateTask));
+ }
+ }
+ });
+ }
}
}
@@ -228,7 +234,8 @@ public class TaskInfoEditor extends EditorPart {
// MylarTaskListPlugin.getTaskListManager().setStatus(task,
// statusCombo.getItem(statusCombo.getSelectionIndex()));
- refreshTaskListView(task);
+// refreshTaskListView(task);
+ MylarTaskListPlugin.getTaskListManager().notifyTaskChanged(task);
MylarTaskListPlugin.getTaskListManager().notifyTaskChanged(task);
markDirty(false);
@@ -756,11 +763,6 @@ public class TaskInfoEditor extends EditorPart {
// l.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
}
- private void refreshTaskListView(ITask task) {
- if (TaskListView.getDefault() != null)
- TaskListView.getDefault().notifyTaskDataChanged(task);
- }
-
private void markDirty(boolean dirty) {
isDirty = dirty;
if (parentEditor != null) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskListView.java
index a2a7fe983..2bb315de5 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskListView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskListView.java
@@ -241,7 +241,7 @@ public class TaskListView extends ViewPart {
refresh(null);
}
}
-
+
public void tasklistRead() {
refresh(null);
}
@@ -251,17 +251,23 @@ public class TaskListView extends ViewPart {
getViewer().refresh();
}
- private void refresh(ITaskListElement element) {
- if (getViewer().getControl() != null && !getViewer().getControl().isDisposed()) {
- if (element == null) {
- getViewer().getControl().setRedraw(false);
- getViewer().refresh();
- getViewer().getControl().setRedraw(true);
- } else {
- getViewer().refresh(element, true);
- }
+ private void refresh(final ITaskListElement element) {
+ if (Workbench.getInstance() != null && !Workbench.getInstance().getDisplay().isDisposed()) {
+ Workbench.getInstance().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ if (getViewer().getControl() != null && !getViewer().getControl().isDisposed()) {
+ if (element == null) {
+ getViewer().getControl().setRedraw(false);
+ getViewer().refresh();
+ getViewer().getControl().setRedraw(true);
+ } else {
+ getViewer().refresh(element, true);
+ }
+ }
+ }
+ });
}
- }
+ }
};
private final class PriorityDropDownAction extends Action implements IMenuCreator {
@@ -1237,42 +1243,12 @@ public class TaskListView extends ViewPart {
}
}
- // public String[] getLabelPriorityFromUser(String kind) {
- // String[] result = new String[2];
- // Dialog dialog = null;
- // boolean isTask = kind.equals("task");
- // if (isTask) {
- // dialog = new TaskInputDialog(
- // Workbench.getInstance().getActiveWorkbenchWindow().getShell());
- // } else {
- // dialog = new InputDialog(
- // Workbench.getInstance().getActiveWorkbenchWindow().getShell(),
- // "Enter name",
- // "Enter a name for the " + kind + ": ",
- // "",
- // null);
- // }
- //
- // int dialogResult = dialog.open();
- // if (dialogResult == Window.OK) {
- // if (isTask) {
- // result[0] = ((TaskInputDialog)dialog).getTaskname();
- // result[1] = ((TaskInputDialog)dialog).getSelectedPriority();
- // } else {
- // result[0] = ((InputDialog)dialog).getValue();
- // }
- // return result;
- // } else {
- // return null;
- // }
- // }
-
- public void notifyTaskDataChanged(ITask task) {
- if (getViewer().getTree() != null && !getViewer().getTree().isDisposed()) {
- getViewer().refresh();
- expandToActiveTasks();
- }
- }
+// public void notifyTaskDataChanged(ITask task) {
+// if (getViewer().getTree() != null && !getViewer().getTree().isDisposed()) {
+// getViewer().refresh();
+// expandToActiveTasks();
+// }
+// }
public static TaskListView getDefault() {
return INSTANCE;
@@ -1403,9 +1379,4 @@ public class TaskListView extends ViewPart {
public ITaskCategory getDrilledIntoCategory() {
return drilledIntoCategory;
}
-
- // @Override
- // public String getTitleToolTip() {
- // return "xxx";
- // }
}

Back to the top