1 package org.simantics.team.ui;
\r
3 import org.eclipse.jface.dialogs.Dialog;
\r
4 import org.eclipse.jface.layout.GridDataFactory;
\r
5 import org.eclipse.jface.layout.GridLayoutFactory;
\r
6 import org.eclipse.swt.SWT;
\r
7 import org.eclipse.swt.widgets.Composite;
\r
8 import org.eclipse.swt.widgets.Control;
\r
9 import org.eclipse.swt.widgets.Label;
\r
10 import org.eclipse.swt.widgets.Shell;
\r
11 import org.eclipse.swt.widgets.Text;
\r
14 * Dialog for chart properties:
\r
18 public class StageInitDialog extends Dialog {
\r
19 public static class Data {
\r
20 public String comment;
\r
25 public StageInitDialog(Shell parentShell, Data data) {
\r
28 setShellStyle(SWT.RESIZE | SWT.TITLE | SWT.CLOSE | SWT.BORDER);
\r
31 protected Control createDialogArea(Composite parent) {
\r
32 Composite c = (Composite) super.createDialogArea(parent);
\r
33 GridLayoutFactory.fillDefaults().margins(8, 8).numColumns(9).applyTo(c);
\r
34 GridDataFactory gd1 = GridDataFactory.fillDefaults().span(1, 1);
\r
35 GridDataFactory gd2 = GridDataFactory.fillDefaults().grab(true, false).span(8, 1);
\r
37 lName = new Label(c, 0);
\r
38 lName.setText("Comment:");
\r
40 tName = new Text(c, SWT.BORDER);
\r
41 tName.setEnabled(true);
\r
42 if (null != data.comment)
\r
43 tName.setText(data.comment);
\r
48 protected void okPressed() {
\r
49 data.comment = tName.getText();
\r
53 protected void configureShell(Shell newShell) {
\r
54 super.configureShell(newShell);
\r
55 newShell.setText("Comment");
\r