Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2010-01-09 19:37:16 +0000
committerfbecker2010-01-09 19:37:16 +0000
commit6a76866cd8ecb8d3b9564c17fe56aa4e4fb8a7e1 (patch)
tree71f1e07e59c5c3d639b25a7f54126640fe62dbc7 /org.eclipse.mylyn.bugzilla.ui
parent78b1aeab8985ccba0a7b6b85614a374ff6b35d1d (diff)
downloadorg.eclipse.mylyn.tasks-6a76866cd8ecb8d3b9564c17fe56aa4e4fb8a7e1.tar.gz
org.eclipse.mylyn.tasks-6a76866cd8ecb8d3b9564c17fe56aa4e4fb8a7e1.tar.xz
org.eclipse.mylyn.tasks-6a76866cd8ecb8d3b9564c17fe56aa4e4fb8a7e1.zip
ASSIGNED - bug 298607: Problem if there are many emails in Changes Submitted dialog
https://bugs.eclipse.org/bugs/show_bug.cgi?id=298607
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.ui')
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaResponseDetailDialog.java75
-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.java10
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties8
4 files changed, 87 insertions, 34 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaResponseDetailDialog.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaResponseDetailDialog.java
new file mode 100644
index 000000000..1ddeb9cb6
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaResponseDetailDialog.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Frank Becker and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Frank Becker - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.bugzilla.ui.editor;
+
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryResponse;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+public class BugzillaResponseDetailDialog extends Dialog {
+
+ private final BugzillaRepositoryResponse response;
+
+ public BugzillaResponseDetailDialog(Shell parentShell, BugzillaRepositoryResponse response) {
+ super(parentShell);
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ this.response = response;
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ getShell().setText(Messages.BugzillaResponseDetailDialog_Titel);
+
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout());
+ GridData gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH);
+ composite.setLayoutData(gd);
+
+ Text text = new Text(composite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL);
+ gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH);
+ gd.heightHint = 120;
+ gd.widthHint = 300;
+ text.setLayoutData(gd);
+ text.setEditable(false);
+
+ String mes = ""; //$NON-NLS-1$
+ for (String iterable_map : response.getResponseData().keySet()) {
+ if (mes.length() > 0) {
+ mes += "\n"; //$NON-NLS-1$
+ }
+ mes += NLS.bind(Messages.BugzillaResponseDetailDialog_Bug_Line, iterable_map);
+ Map<String, List<String>> responseMap = response.getResponseData().get(iterable_map);
+ for (String iterable_list : responseMap.keySet()) {
+ mes += NLS.bind(Messages.BugzillaResponseDetailDialog_Action_Line, iterable_list);
+ List<String> responseList = responseMap.get(iterable_list);
+ for (String string : responseList) {
+ mes += NLS.bind(Messages.BugzillaResponseDetailDialog_Email_Line, string);
+ }
+ }
+
+ }
+ text.setText(mes);
+ parent.pack();
+ applyDialogFont(composite);
+ return composite;
+ }
+}
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 48181251e..4d83153a8 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
@@ -20,9 +20,7 @@ import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
@@ -52,7 +50,6 @@ import org.eclipse.mylyn.tasks.ui.editors.LayoutHint;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditorInput;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditorPartDescriptor;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
@@ -389,28 +386,9 @@ public class BugzillaTaskEditorPage extends AbstractTaskEditorPage {
IMessageProvider.INFORMATION, new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent event) {
- String mes = ""; //$NON-NLS-1$
- for (String iterable_map : bugzillaResponse.getResponseData().keySet()) {
- mes += NLS.bind(Messages.BugzillaTaskEditorPage_Changes_Submitted_Bug_Line,
- iterable_map);
- Map<String, List<String>> responseMap = bugzillaResponse.getResponseData().get(
- iterable_map);
- for (String iterable_list : responseMap.keySet()) {
- mes += NLS.bind(
- Messages.BugzillaTaskEditorPage_Changes_Submitted_Action_Line,
- iterable_list);
- List<String> responseList = responseMap.get(iterable_list);
- for (String string : responseList) {
- mes += NLS.bind(
- Messages.BugzillaTaskEditorPage_Changes_Submitted_Email_Line,
- string);
- }
- }
-
- }
- new MessageDialog(WorkbenchUtil.getShell(),
- Messages.BugzillaTaskEditorPage_Changes_Submitted_Titel, null, mes,
- MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0).open();
+ BugzillaResponseDetailDialog dialog = new BugzillaResponseDetailDialog(
+ WorkbenchUtil.getShell(), bugzillaResponse);
+ dialog.open();
}
});
} else {
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 4829f7c23..ce0552166 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
@@ -33,15 +33,15 @@ public class Messages extends NLS {
public static String BugzillaPlanningEditorPart_Team_Planning;
- public static String BugzillaTaskEditorPage_Changes_Submitted_Bug_Line;
+ public static String BugzillaResponseDetailDialog_Titel;
- public static String BugzillaTaskEditorPage_Changes_Submitted_Action_Line;
+ public static String BugzillaResponseDetailDialog_Bug_Line;
- public static String BugzillaTaskEditorPage_Changes_Submitted_Email_Line;
+ public static String BugzillaResponseDetailDialog_Action_Line;
- public static String BugzillaTaskEditorPage_Changes_Submitted_Message;
+ public static String BugzillaResponseDetailDialog_Email_Line;
- public static String BugzillaTaskEditorPage_Changes_Submitted_Titel;
+ public static String BugzillaTaskEditorPage_Changes_Submitted_Message;
public static String BugzillaTaskEditorPage_Please_enter_a_description_before_submitting;
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 a7d20bfda..d1e7238b0 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
@@ -14,11 +14,11 @@ BugzillaPeoplePart__Select_to_remove_=(Select to remove)
BugzillaPlanningEditorPart_Current_Estimate=Current Estimate:
BugzillaPlanningEditorPart_Team_Planning=Team Planning
-BugzillaTaskEditorPage_Changes_Submitted_Bug_Line=\n{0}\n
-BugzillaTaskEditorPage_Changes_Submitted_Action_Line=\ \ \ \ \ \ \ \ {0}\n
-BugzillaTaskEditorPage_Changes_Submitted_Email_Line=\ \ \ \ \ \ \ \ \ \ \ \ {0}\n
+BugzillaResponseDetailDialog_Titel=submitted Changes Details
+BugzillaResponseDetailDialog_Bug_Line={0}\n
+BugzillaResponseDetailDialog_Action_Line=\ \ \ \ \ \ \ \ {0}\n
+BugzillaResponseDetailDialog_Email_Line=\ \ \ \ \ \ \ \ \ \ \ \ {0}\n
BugzillaTaskEditorPage_Changes_Submitted_Message=Changes submitted
-BugzillaTaskEditorPage_Changes_Submitted_Titel=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

Back to the top