X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.team.ui%2Fsrc%2Forg%2Fsimantics%2Fteam%2Fui%2FStageInitDialog.java;fp=bundles%2Forg.simantics.team.ui%2Fsrc%2Forg%2Fsimantics%2Fteam%2Fui%2FStageInitDialog.java;h=e59875227369d1f71c907c1c83915fa7fb2ba33a;hp=0000000000000000000000000000000000000000;hb=969bd23cab98a79ca9101af33334000879fb60c5;hpb=866dba5cd5a3929bbeae85991796acb212338a08 diff --git a/bundles/org.simantics.team.ui/src/org/simantics/team/ui/StageInitDialog.java b/bundles/org.simantics.team.ui/src/org/simantics/team/ui/StageInitDialog.java new file mode 100644 index 000000000..e59875227 --- /dev/null +++ b/bundles/org.simantics.team.ui/src/org/simantics/team/ui/StageInitDialog.java @@ -0,0 +1,57 @@ +package org.simantics.team.ui; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.layout.GridLayoutFactory; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; + +/** + * Dialog for chart properties: + * + * Comment: + */ +public class StageInitDialog extends Dialog { + public static class Data { + public String comment; + } + Label lName; + Text tName; + Data data; + public StageInitDialog(Shell parentShell, Data data) { + super(parentShell); + this.data = data; + setShellStyle(SWT.RESIZE | SWT.TITLE | SWT.CLOSE | SWT.BORDER); + } + @Override + protected Control createDialogArea(Composite parent) { + Composite c = (Composite) super.createDialogArea(parent); + GridLayoutFactory.fillDefaults().margins(8, 8).numColumns(9).applyTo(c); + GridDataFactory gd1 = GridDataFactory.fillDefaults().span(1, 1); + GridDataFactory gd2 = GridDataFactory.fillDefaults().grab(true, false).span(8, 1); + // Comment: + lName = new Label(c, 0); + lName.setText("Comment:"); + gd1.applyTo(lName); + tName = new Text(c, SWT.BORDER); + tName.setEnabled(true); + if (null != data.comment) + tName.setText(data.comment); + gd2.applyTo(tName); + return c; + } + @Override + protected void okPressed() { + data.comment = tName.getText(); + super.okPressed(); + } + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText("Comment"); + } +}