Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2012-05-17 03:40:24 -0400
committerFrank Becker2012-05-17 03:40:24 -0400
commit918cbdbcf5d6acd49dca0106a7641cbb48c38bc7 (patch)
treef8f987be423a4a45e6c253dac0ce12c96e0fa6d0 /org.eclipse.mylyn.bugzilla.ui
parent784727b40d8c33a247113e2c81ff45c0a204d32c (diff)
downloadorg.eclipse.mylyn.tasks-918cbdbcf5d6acd49dca0106a7641cbb48c38bc7.tar.gz
org.eclipse.mylyn.tasks-918cbdbcf5d6acd49dca0106a7641cbb48c38bc7.tar.xz
org.eclipse.mylyn.tasks-918cbdbcf5d6acd49dca0106a7641cbb48c38bc7.zip
ASSIGNED - bug 378474: Bugzilla search shows modal dialog when typing
email with having selected a checkbox https://bugs.eclipse.org/bugs/show_bug.cgi?id=378474
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.ui')
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java54
-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, 30 insertions, 27 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 595d73d0d..13b958ff5 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
@@ -31,6 +31,9 @@ import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.fieldassist.ComboContentAdapter;
import org.eclipse.jface.fieldassist.ContentProposalAdapter;
+import org.eclipse.jface.fieldassist.ControlDecoration;
+import org.eclipse.jface.fieldassist.FieldDecoration;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
import org.eclipse.jface.fieldassist.IContentProposalProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.window.Window;
@@ -352,6 +355,8 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage2 implements
private final ArrayList<Chart> charts = new ArrayList<Chart>(1);
+ private final ArrayList<ControlDecoration> errorDecorations = new ArrayList<ControlDecoration>();
+
private class ChartControls {
private final Combo field;
@@ -1183,6 +1188,13 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage2 implements
@Override
public boolean isPageComplete() {
setMessage(""); //$NON-NLS-1$
+ if (errorDecorations.size() > 0) {
+ for (ControlDecoration decoration : errorDecorations) {
+ decoration.hide();
+ decoration.dispose();
+ }
+ errorDecorations.clear();
+ }
if (daysText != null) {
String days = daysText.getText();
if (days.length() > 0) {
@@ -1219,6 +1231,15 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage2 implements
}
}
if (!selectionMade) {
+ FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
+ FieldDecoration fieldDecoration = registry.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
+ final ControlDecoration decoration = new ControlDecoration(emailPattern, SWT.LEFT | SWT.DOWN);
+ decoration.setImage(fieldDecoration.getImage());
+ decoration.setDescriptionText(NLS.bind(Messages.BugzillaSearchPage_ValidationMessage, new String[] {
+ Messages.BugzillaSearchPage_Email.replace('&', ' '), Messages.BugzillaSearchPage_owner,
+ Messages.BugzillaSearchPage_reporter, Messages.BugzillaSearchPage_cc,
+ Messages.BugzillaSearchPage_commenter, Messages.BugzillaSearchPage_qacontact }));
+ errorDecorations.add(decoration);
if (getContainer() != null) {
setMessage(
NLS.bind(Messages.BugzillaSearchPage_ValidationMessage, new String[] {
@@ -1226,18 +1247,6 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage2 implements
Messages.BugzillaSearchPage_owner, Messages.BugzillaSearchPage_reporter,
Messages.BugzillaSearchPage_cc, Messages.BugzillaSearchPage_commenter,
Messages.BugzillaSearchPage_qacontact }), IMessageProvider.ERROR);
- } else {
- ErrorDialog.openError(
- getShell(),
- Messages.BugzillaSearchPage_ValidationTitle,
- NLS.bind(Messages.BugzillaSearchPage_ValidationMessage1,
- Messages.BugzillaSearchPage_Email.replace('&', ' '), email),
- new Status(IStatus.ERROR, BugzillaUiPlugin.ID_PLUGIN, NLS.bind(
- Messages.BugzillaSearchPage_ValidationReason, new String[] {
- Messages.BugzillaSearchPage_owner,
- Messages.BugzillaSearchPage_reporter, Messages.BugzillaSearchPage_cc,
- Messages.BugzillaSearchPage_commenter,
- Messages.BugzillaSearchPage_qacontact })));
}
return false;
}
@@ -1254,6 +1263,15 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage2 implements
}
}
if (!selectionMade) {
+ FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
+ FieldDecoration fieldDecoration = registry.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
+ final ControlDecoration decoration = new ControlDecoration(emailPattern, SWT.LEFT | SWT.DOWN);
+ decoration.setImage(fieldDecoration.getImage());
+ decoration.setDescriptionText(NLS.bind(Messages.BugzillaSearchPage_ValidationMessage, new String[] {
+ Messages.BugzillaSearchPage_Email_2.replace('&', ' '), Messages.BugzillaSearchPage_owner,
+ Messages.BugzillaSearchPage_reporter, Messages.BugzillaSearchPage_cc,
+ Messages.BugzillaSearchPage_commenter, Messages.BugzillaSearchPage_qacontact }));
+ errorDecorations.add(decoration);
if (getContainer() != null) {
setMessage(
NLS.bind(Messages.BugzillaSearchPage_ValidationMessage, new String[] {
@@ -1261,18 +1279,6 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage2 implements
Messages.BugzillaSearchPage_owner, Messages.BugzillaSearchPage_reporter,
Messages.BugzillaSearchPage_cc, Messages.BugzillaSearchPage_commenter,
Messages.BugzillaSearchPage_qacontact }), IMessageProvider.ERROR);
- } else {
- ErrorDialog.openError(
- getShell(),
- Messages.BugzillaSearchPage_ValidationTitle,
- NLS.bind(Messages.BugzillaSearchPage_ValidationMessage1,
- Messages.BugzillaSearchPage_Email_2.replace('&', ' '), email2),
- new Status(IStatus.ERROR, BugzillaUiPlugin.ID_PLUGIN, NLS.bind(
- Messages.BugzillaSearchPage_ValidationReason, new String[] {
- Messages.BugzillaSearchPage_owner,
- Messages.BugzillaSearchPage_reporter, Messages.BugzillaSearchPage_cc,
- Messages.BugzillaSearchPage_commenter,
- Messages.BugzillaSearchPage_qacontact })));
}
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 86b5df9f3..4b28e479c 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
@@ -169,8 +169,6 @@ public class Messages extends NLS {
public static String BugzillaSearchPage_ValidationMessage;
- public static String BugzillaSearchPage_ValidationMessage1;
-
public static String BugzillaSearchPage_ValidationReason;
public static String BugzillaSearchPage_ValidationTitle;
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 96a279d2c..f5c8f3925 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
@@ -80,7 +80,6 @@ BugzillaSearchPage_Severity=Se&verity:
BugzillaSearchPage_Status=Stat&us:
BugzillaSearchPage_Summary=Summar&y:
BugzillaSearchPage_ValidationMessage=Please select one off the following email type ({1},{2},{3},{4},{5}) for {0}
-BugzillaSearchPage_ValidationMessage1=Can not use value {1} from field {0}
BugzillaSearchPage_ValidationReason=You must select at least on of the type checkboxes\n\t{0}\n\t{1}\n\t{2}\n\t{3}\n\t{4}
BugzillaSearchPage_ValidationTitle=Validation
BugzillaSearchPage_Version=Vers&ion:

Back to the top