]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.team.ui/src/org/simantics/team/ui/StageInitDialog.java
Removed contact application support prints
[simantics/platform.git] / bundles / org.simantics.team.ui / src / org / simantics / team / ui / StageInitDialog.java
1 package org.simantics.team.ui;
2
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;
12
13 /**
14  * Dialog for chart properties:
15  * 
16  * Comment: 
17  */
18 public class StageInitDialog extends Dialog {
19     public static class Data {
20         public String comment;
21     }
22     Label lName;
23     Text tName;
24     Data data;
25     public StageInitDialog(Shell parentShell, Data data) {
26         super(parentShell);
27         this.data = data;
28         setShellStyle(SWT.RESIZE | SWT.TITLE | SWT.CLOSE | SWT.BORDER);
29     }
30     @Override
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);
36         // Comment:
37         lName = new Label(c, 0);
38         lName.setText("Comment:");
39         gd1.applyTo(lName);
40         tName = new Text(c, SWT.BORDER);
41         tName.setEnabled(true);
42         if (null != data.comment)
43             tName.setText(data.comment);
44         gd2.applyTo(tName);
45         return c;
46     }
47     @Override
48     protected void okPressed() {
49         data.comment = tName.getText();
50         super.okPressed();
51     }
52     @Override
53     protected void configureShell(Shell newShell) {
54         super.configureShell(newShell);
55         newShell.setText("Comment");
56     }
57 }