Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2009-09-18 21:50:54 +0000
committerspingel2009-09-18 21:50:54 +0000
commit0bf158952fe668dd3340df25b00290ea5d5d4e52 (patch)
tree4c00652cfbc9bf1305626f4675439fd731532023 /org.eclipse.mylyn.bugzilla.ui/src
parent809f9c494c81565a8143a1f2d0998bc428af979e (diff)
downloadorg.eclipse.mylyn.tasks-0bf158952fe668dd3340df25b00290ea5d5d4e52.tar.gz
org.eclipse.mylyn.tasks-0bf158952fe668dd3340df25b00290ea5d5d4e52.tar.xz
org.eclipse.mylyn.tasks-0bf158952fe668dd3340df25b00290ea5d5d4e52.zip
NEW - bug 288892: fix validation in query dialog
https://bugs.eclipse.org/bugs/show_bug.cgi?id=288892
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.ui/src')
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java17
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/Messages.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/messages.properties1
3 files changed, 17 insertions, 3 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java
index 47dec17ee..f6ee80e29 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java
@@ -30,6 +30,7 @@ import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.DialogSettings;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.fieldassist.ComboContentAdapter;
import org.eclipse.jface.fieldassist.ContentProposalAdapter;
@@ -1131,13 +1132,23 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage implements L
throw new NumberFormatException();
}
} catch (NumberFormatException ex) {
- setErrorMessage(NLS.bind(Messages.BugzillaSearchPage_Number_of_days_must_be_a_positive_integer,
- days));
+ setMessage(NLS.bind(Messages.BugzillaSearchPage_Number_of_days_must_be_a_positive_integer, days),
+ IMessageProvider.ERROR);
return false;
}
}
}
- return getWizard() == null ? canQuery() : canQuery() && super.isPageComplete();
+ if (getWizard() == null) {
+ return canQuery();
+ } else {
+ if (super.isPageComplete()) {
+ if (canQuery()) {
+ return true;
+ }
+ setMessage(Messages.BugzillaSearchPage_Enter_search_option);
+ }
+ return false;
+ }
}
/**
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/Messages.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/Messages.java
index 12fdada01..df15f26a1 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/Messages.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/Messages.java
@@ -51,6 +51,8 @@ public class Messages extends NLS {
public static String BugzillaSearchPage_Email_2;
+ public static String BugzillaSearchPage_Enter_search_option;
+
public static String BugzillaSearchPage_Error_updating_search_options;
public static String BugzillaSearchPage_Error_was_X;
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/messages.properties b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/messages.properties
index 58b6862f8..d098c75b3 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/messages.properties
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/messages.properties
@@ -21,6 +21,7 @@ BugzillaSearchPage_Component=Compo&nent:
BugzillaSearchPage_days=\ days.
BugzillaSearchPage_Email=&Email:
BugzillaSearchPage_Email_2=Email &2:
+BugzillaSearchPage_Enter_search_option=Enter or select a search option
BugzillaSearchPage_Error_updating_search_options=Error updating search options
BugzillaSearchPage_Error_was_X=Error was: {0}
BugzillaSearchPage_exact=exact

Back to the top