use of org.eclipse.swt.layout.RowLayout in project yamcs-studio by yamcs.
the class ImportPastEventsDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
container.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout(2, false);
layout.marginHeight = 20;
layout.marginWidth = 20;
layout.verticalSpacing = 2;
container.setLayout(layout);
Label lbl = new Label(container, SWT.NONE);
lbl.setText("Start:");
Composite startComposite = new Composite(container, SWT.NONE);
RowLayout rl = new RowLayout();
rl.marginLeft = 0;
rl.marginTop = 0;
rl.marginBottom = 0;
rl.center = true;
startComposite.setLayout(rl);
startDate = new DateTime(startComposite, SWT.DATE | SWT.LONG | SWT.DROP_DOWN | SWT.BORDER);
startDate.addListener(SWT.Selection, e -> validate());
startDate.addListener(SWT.FocusOut, e -> validate());
startTime = new DateTime(startComposite, SWT.TIME | SWT.LONG | SWT.BORDER);
startTime.addListener(SWT.Selection, e -> validate());
startTime.addListener(SWT.FocusOut, e -> validate());
if (startTimeValue != null) {
startDate.setDate(startTimeValue.get(Calendar.YEAR), startTimeValue.get(Calendar.MONTH), startTimeValue.get(Calendar.DAY_OF_MONTH));
startTime.setTime(startTimeValue.get(Calendar.HOUR_OF_DAY), startTimeValue.get(Calendar.MINUTE), startTimeValue.get(Calendar.SECOND));
}
lbl = new Label(container, SWT.NONE);
lbl.setText("Stop:");
Composite stopComposite = new Composite(container, SWT.NONE);
rl = new RowLayout();
rl.marginLeft = 0;
rl.marginTop = 0;
rl.marginBottom = 0;
rl.center = true;
rl.fill = true;
stopComposite.setLayout(rl);
stopDate = new DateTime(stopComposite, SWT.DATE | SWT.LONG | SWT.DROP_DOWN | SWT.BORDER);
stopDate.addListener(SWT.Selection, e -> validate());
stopDate.addListener(SWT.FocusOut, e -> validate());
stopTime = new DateTime(stopComposite, SWT.TIME | SWT.LONG | SWT.BORDER);
stopTime.addListener(SWT.Selection, e -> validate());
stopTime.addListener(SWT.FocusOut, e -> validate());
if (stopTimeValue != null) {
stopDate.setDate(stopTimeValue.get(Calendar.YEAR), stopTimeValue.get(Calendar.MONTH), stopTimeValue.get(Calendar.DAY_OF_MONTH));
stopTime.setTime(stopTimeValue.get(Calendar.HOUR_OF_DAY), stopTimeValue.get(Calendar.MINUTE), stopTimeValue.get(Calendar.SECOND));
}
return container;
}
Aggregations