Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2010-01-09 21:07:53 +0000
committerfbecker2010-01-09 21:07:53 +0000
commit78be62eac8445363145a83bae3f74309ff99751f (patch)
treef4359a2dce40c94fd67103a131478976ee576e68 /org.eclipse.mylyn.bugzilla.ui
parent6a76866cd8ecb8d3b9564c17fe56aa4e4fb8a7e1 (diff)
downloadorg.eclipse.mylyn.tasks-78be62eac8445363145a83bae3f74309ff99751f.tar.gz
org.eclipse.mylyn.tasks-78be62eac8445363145a83bae3f74309ff99751f.tar.xz
org.eclipse.mylyn.tasks-78be62eac8445363145a83bae3f74309ff99751f.zip
ASSIGNED - bug 282940: validate duplicate textfield before submitting
https://bugs.eclipse.org/bugs/show_bug.cgi?id=282940
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.ui')
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java28
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/Messages.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties1
3 files changed, 31 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java
index 4d83153a8..0040bff01 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java
@@ -212,6 +212,34 @@ public class BugzillaTaskEditorPage extends AbstractTaskEditorPage {
return;
}
+ TaskAttribute attributeOperation = getModel().getTaskData().getRoot().getMappedAttribute(
+ TaskAttribute.OPERATION);
+ if (attributeOperation != null) {
+ if ("duplicate".equals(attributeOperation.getValue())) { //$NON-NLS-1$
+ TaskAttribute originalOperation = getModel().getTaskData().getRoot().getAttribute(
+ TaskAttribute.PREFIX_OPERATION + attributeOperation.getValue());
+ String inputAttributeId = originalOperation.getMetaData().getValue(
+ TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID);
+ if (inputAttributeId != null && !inputAttributeId.equals("")) { //$NON-NLS-1$
+ TaskAttribute inputAttribute = attributeOperation.getTaskData().getRoot().getAttribute(
+ inputAttributeId);
+ if (inputAttribute != null) {
+ String dupValue = inputAttribute.getValue();
+ if (dupValue == null || dupValue.equals("")) { //$NON-NLS-1$
+ getTaskEditor().setMessage(
+ Messages.BugzillaTaskEditorPage_Please_enter_a_bugid_for_duplicate_of_before_submitting,
+ IMessageProvider.ERROR);
+ AbstractTaskEditorPart part = getPart(ID_PART_ACTIONS);
+ if (part != null) {
+ part.setFocus();
+ }
+ return;
+ }
+ }
+ }
+ }
+ }
+
if (getModel().getTaskData().isNew()) {
TaskAttribute productAttribute = getModel().getTaskData().getRoot().getMappedAttribute(
TaskAttribute.PRODUCT);
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/Messages.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/Messages.java
index ce0552166..d7b1bbfd8 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/Messages.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/Messages.java
@@ -49,6 +49,8 @@ public class Messages extends NLS {
public static String BugzillaTaskEditorPage_Please_select_a_component_before_submitting;
+ public static String BugzillaTaskEditorPage_Please_enter_a_bugid_for_duplicate_of_before_submitting;
+
public static String BugzillaVotesEditor_Show_votes;
public static String BugzillaVotesEditor_Vote;
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties
index d1e7238b0..9426f2905 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties
@@ -22,6 +22,7 @@ BugzillaTaskEditorPage_Changes_Submitted_Message=Changes submitted
BugzillaTaskEditorPage_Please_enter_a_description_before_submitting=Please enter a description before submitting
BugzillaTaskEditorPage_Please_enter_a_short_summary_before_submitting=Please enter a short summary before submitting
BugzillaTaskEditorPage_Please_select_a_component_before_submitting=Please select a component before submitting
+BugzillaTaskEditorPage_Please_enter_a_bugid_for_duplicate_of_before_submitting=Please enter a bugid for \"duplicate of\" before submitting
BugzillaVotesEditor_Show_votes=Show votes
BugzillaVotesEditor_Vote=Vote

Back to the top