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