Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2009-01-28 03:32:49 +0000
committerspingel2009-01-28 03:32:49 +0000
commitdbc797550296c92f02a9fdff50b8d02d48a678bc (patch)
treed8468199c33d1fb5d503a3b276fc3d121ea29d37 /org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors
parent6d22dfedbf911e5f52514c9123055d6172926c7e (diff)
downloadorg.eclipse.mylyn.tasks-dbc797550296c92f02a9fdff50b8d02d48a678bc.tar.gz
org.eclipse.mylyn.tasks-dbc797550296c92f02a9fdff50b8d02d48a678bc.tar.xz
org.eclipse.mylyn.tasks-dbc797550296c92f02a9fdff50b8d02d48a678bc.zip
NEW - bug 251506: Pressing Ctrl in an open task window marks the task as changed
https://bugs.eclipse.org/bugs/show_bug.cgi?id=251506
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java25
1 files changed, 14 insertions, 11 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java
index fc47f5282..c99720aa9 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java
@@ -72,7 +72,6 @@ import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -191,6 +190,7 @@ public class TaskPlanningEditor extends TaskFormPage {
/**
* Override for customizing the tool bar.
*/
+ @Override
public void fillToolBar(IToolBarManager toolBarManager) {
TaskEditorInput taskEditorInput = (TaskEditorInput) getEditorInput();
if (taskEditorInput.getTask() instanceof LocalTask) {
@@ -650,21 +650,17 @@ public class TaskPlanningEditor extends TaskFormPage {
toolkit.paintBordersFor(nameValueComp);
scheduleDatePicker.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
- scheduleDatePicker.addPickerSelectionListener(new SelectionListener() {
+ scheduleDatePicker.addPickerSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent arg0) {
TaskPlanningEditor.this.markDirty(true);
}
-
- public void widgetDefaultSelected(SelectionEvent arg0) {
- // ignore
- }
});
ImageHyperlink clearScheduledDate = toolkit.createImageHyperlink(nameValueComp, SWT.NONE);
clearScheduledDate.setImage(CommonImages.getImage(CommonImages.REMOVE));
clearScheduledDate.setToolTipText(Messages.TaskPlanningEditor_Clear);
clearScheduledDate.addHyperlinkListener(new HyperlinkAdapter() {
-
@Override
public void linkActivated(HyperlinkEvent e) {
scheduleDatePicker.setScheduledDate(null);
@@ -690,8 +686,10 @@ public class TaskPlanningEditor extends TaskFormPage {
dueDatePicker.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
dueDatePicker.addPickerSelectionListener(new SelectionAdapter() {
@Override
- public void widgetSelected(SelectionEvent arg0) {
- TaskPlanningEditor.this.markDirty(true);
+ public void widgetSelected(SelectionEvent event) {
+ if (!areEqual(dueDatePicker.getDate(), task.getDueDate())) {
+ TaskPlanningEditor.this.markDirty(true);
+ }
}
});
@@ -703,11 +701,12 @@ public class TaskPlanningEditor extends TaskFormPage {
clearDueDate.setImage(CommonImages.getImage(CommonImages.REMOVE));
clearDueDate.setToolTipText(Messages.TaskPlanningEditor_Clear);
clearDueDate.addHyperlinkListener(new HyperlinkAdapter() {
-
@Override
public void linkActivated(HyperlinkEvent e) {
dueDatePicker.setDate(null);
- TaskPlanningEditor.this.markDirty(true);
+ if (!areEqual(dueDatePicker.getDate(), task.getDueDate())) {
+ TaskPlanningEditor.this.markDirty(true);
+ }
}
});
@@ -941,4 +940,8 @@ public class TaskPlanningEditor extends TaskFormPage {
return this.summaryEditor.getTextWidget().getText();
}
+ private boolean areEqual(Object oldValue, Object newValue) {
+ return (oldValue != null) ? oldValue.equals(newValue) : oldValue == newValue;
+ }
+
}

Back to the top