Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2008-08-20 21:02:01 -0400
committerspingel2008-08-20 21:02:01 -0400
commit2a5370b63e5e4c8127c7c232a082ed29af1e3e39 (patch)
tree8c510856c9650187b818dd249d754c272d158959
parent0659d51cdc4a21cfdb5a4e6f16c18e61bbcd8e54 (diff)
downloadorg.eclipse.mylyn.tasks-2a5370b63e5e4c8127c7c232a082ed29af1e3e39.tar.gz
org.eclipse.mylyn.tasks-2a5370b63e5e4c8127c7c232a082ed29af1e3e39.tar.xz
org.eclipse.mylyn.tasks-2a5370b63e5e4c8127c7c232a082ed29af1e3e39.zip
NEW - bug 242807: It should not be possible to resolve a JIRA issue without selecting a resolution
https://bugs.eclipse.org/bugs/show_bug.cgi?id=242807
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/SingleSelectionAttributeEditor.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionPart.java8
2 files changed, 15 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/SingleSelectionAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/SingleSelectionAttributeEditor.java
index c74462640..92fcc808d 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/SingleSelectionAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/SingleSelectionAttributeEditor.java
@@ -110,4 +110,11 @@ public class SingleSelectionAttributeEditor extends AbstractAttributeEditor {
attributeChanged();
}
+ void selectDefaultValue() {
+ if (combo.getSelectionIndex() == -1 && values.length > 0) {
+ combo.select(0);
+ setValue(values[0]);
+ }
+ }
+
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionPart.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionPart.java
index ca1b32c54..d246ffabf 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionPart.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionPart.java
@@ -75,6 +75,8 @@ public class TaskEditorActionPart extends AbstractTaskEditorPart {
private static final int RADIO_OPTION_WIDTH = 120;
+ private static final String KEY_ASSOCIATED_EDITOR = "associatedEditor";
+
private List<Button> operationButtons;
private Button submitButton;
@@ -235,6 +237,7 @@ public class TaskEditorActionPart extends AbstractTaskEditorPart {
}
editor.getControl().setLayoutData(gd);
editor.getControl().addFocusListener(new FocusListener(button));
+ button.setData(KEY_ASSOCIATED_EDITOR, editor);
getTaskEditorPage().getAttributeEditorToolkit().adapt(editor);
}
}
@@ -315,6 +318,11 @@ public class TaskEditorActionPart extends AbstractTaskEditorPart {
TaskOperation taskOperation = (TaskOperation) selectedButton.getData(KEY_OPERATION);
getTaskData().getAttributeMapper().setTaskOperation(selectedOperationAttribute, taskOperation);
getModel().attributeChanged(selectedOperationAttribute);
+
+ AbstractAttributeEditor editor = (AbstractAttributeEditor) selectedButton.getData(KEY_ASSOCIATED_EDITOR);
+ if (editor instanceof SingleSelectionAttributeEditor) {
+ ((SingleSelectionAttributeEditor) editor).selectDefaultValue();
+ }
}
}

Back to the top