Skip to main content
summaryrefslogtreecommitdiffstats
blob: bf48948d2b878170fc2fda324cb24b432ed10a77 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*******************************************************************************
 * Copyright (c) 2010, 2012 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 org.eclipse.jface.dialogs.Dialog;
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 String titleText;

	private final String messageText;

	public BugzillaResponseDetailDialog(Shell parentShell, String titleText, String messageText) {
		super(parentShell);
		setShellStyle(getShellStyle() | SWT.RESIZE);
		this.titleText = titleText;
		this.messageText = messageText;
	}

	@Override
	protected Control createDialogArea(Composite parent) {
		getShell().setText(titleText);

		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);
		text.setText(messageText);
		parent.pack();
		applyDialogFont(composite);
		return composite;
	}
}

Back to the top