protected void createMiscellaneousGroup(Composite parent) { Group content = new Group(parent, SWT.NONE); content.setText(Messages.OrderDialog_MiscLabel); content.setLayout(new GridLayout(2, false)); content.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); Label label = new Label(content, SWT.NONE); label.setText(Messages.OrderDialog_TimeInForceLabel); validityCombo = new ComboViewer(content, SWT.BORDER | SWT.READ_ONLY | SWT.DROP_DOWN); validityCombo.getControl().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); validityCombo.setContentProvider(new ArrayContentProvider()); validityCombo.setLabelProvider(new LabelProvider()); label = new Label(content, SWT.NONE); label.setText(Messages.OrderDialog_ExpireLabel); expireDate = new CDateTime(content, CDT.BORDER | CDT.DATE_SHORT | CDT.DROP_DOWN | CDT.TAB_FIELDS); expireDate.setPattern(Util.getDateFormatPattern()); expireDate.setSelection(new Date()); expireDate.setEnabled(false); label = new Label(content, SWT.NONE); label.setText(Messages.OrderDialog_ReferenceLabel); orderReference = new Text(content, SWT.BORDER); orderReference.setLayoutData(new GridData(convertWidthInCharsToPixels(40), SWT.DEFAULT)); }
/** * Sets control enabled or not. * * @param enabled If control is enabled or not. */ private void setEnabled(boolean enabled) { fromDateTime.setEnabled(enabled); toDateTime.setEnabled(enabled); }