public void initGUI() { final DateRangeSearchWidget dateRangeWidget = new DateRangeSearchWidget( composite, "Acquisition Date Range: ", ViewWidgetId.LIVESTOCK_FILTER_STARTDATE, ViewWidgetId.LIVESTOCK_FILTER_ENDDATE, ViewWidgetId.LIVESTOCK_FILTER_STARTDATE_BUTTON, ViewWidgetId.LIVESTOCK_FILTER_ENDDATE_BUTTON); GridDataFactory.swtDefaults() .align(SWT.BEGINNING, SWT.FILL) .grab(false, false) .applyTo(dateRangeWidget.getComposite()); final Composite filterPanel2 = UIControlsFactory.createComposite(composite, SWT.NULL); filterPanel2.setLayout(new GridLayout(3, false)); GridDataFactory.swtDefaults() .align(SWT.BEGINNING, SWT.FILL) .grab(true, false) .applyTo(filterPanel2); if (filterFarm) { final CCombo farmCombo = UIControlsFactory.createCCombo(filterPanel2, ViewWidgetId.LIVESTOCK_FarmFilterCombo); GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(farmCombo); } final CCombo speciesText = UIControlsFactory.createCCombo(filterPanel2, ViewWidgetId.LIVESTOCK_ContainerSpeciesFilter); GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(speciesText); final CCombo statusText = UIControlsFactory.createCCombo(filterPanel2, ViewWidgetId.LIVESTOCK_ContainerStatusFilter); GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(statusText); // // search cancel button // final Composite searchPanel = UIControlsFactory.createComposite(composite); // GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).span(3, // 1).applyTo(searchPanel); // GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(false).applyTo(searchPanel); // // final Button searchButton = UIControlsFactory.createButton(searchPanel, "Search", // BaseListView.BIND_ID_FILTER_SEARCH); // GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).grab(false, // false).applyTo(searchButton); // // final Button cancelButton = UIControlsFactory.createButton(searchPanel, "Clear", // BaseListView.BIND_ID_FILTER_RESET); // GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).grab(false, // false).applyTo(cancelButton); }
@Override protected void basicCreatePartControl(final Composite parent) { parent.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE)); parent.setLayout(new GridLayout(1, false)); final GridDataFactory fillFactory = GridDataFactory.fillDefaults(); UIControlsFactory.createLabel(parent, "Want to go home?"); // $NON-NLS-1$ final Button jumpBack = UIControlsFactory.createButton(parent); jumpBack.setText("Jump Back"); // $NON-NLS-1$ fillFactory.applyTo(jumpBack); addUIControl(jumpBack, DemoTargetSubModuleController.JUMP_BACK_RIDGET_ID); }
public LiveStockFilterWidget(Composite parent, boolean filterFarm) { composite = UIControlsFactory.createComposite(parent); this.filterFarm = filterFarm; final GridLayout layout = new GridLayout(2, false); composite.setLayout(layout); initGUI(); }
@Override protected void basicCreatePartControl(final Composite parent) { parent.setBackground(LnfManager.getLnf().getColor(LnfKeyConstants.SUB_MODULE_BACKGROUND)); // parent.setLayout(new GridLayout(1, false)); final FillLayout layout = new FillLayout(); layout.marginHeight = 5; layout.marginWidth = 5; parent.setLayout(layout); final Group group = UIControlsFactory.createGroup(parent, "Blocking Demo:"); // $NON-NLS-1$ GridLayoutFactory.fillDefaults().margins(20, 20).numColumns(1).applyTo(group); final GridDataFactory fillFactory = GridDataFactory.fillDefaults(); final Button button1 = UIControlsFactory.createButton( group, "", BlockingSubModuleController.RIDGET_BLOCK_SUB_MODULE); // $NON-NLS-1$ fillFactory.applyTo(button1); final Button button2 = UIControlsFactory.createButton( group, "", BlockingSubModuleController.RIDGET_BLOCK_MODULE); // $NON-NLS-1$ fillFactory.applyTo(button2); final Button button3 = UIControlsFactory.createButton( group, "", BlockingSubModuleController.RIDGET_BLOCK_SUB_APP); // $NON-NLS-1$ fillFactory.applyTo(button3); final Button button4 = UIControlsFactory.createButton( group, "", BlockingSubModuleController.RIDGET_DISABLE_MODULE); // $NON-NLS-1$ fillFactory.applyTo(button4); final Button button5 = UIControlsFactory.createButton( group, "", BlockingSubModuleController.RIDGET_BLOCK_APPLICATION); // $NON-NLS-1$ fillFactory.applyTo(button5); final Button button6 = UIControlsFactory.createButton( group, "", BlockingSubModuleController.RIDGET_BLOCK_DIALOG); // $NON-NLS-1$ fillFactory.applyTo(button6); final Label label = UIControlsFactory.createLabel( group, "", SWT.CENTER, //$NON-NLS-1$ BlockingSubModuleController.RIDGET_STATUS); fillFactory.applyTo(label); }
@Override protected void createDetails(final Composite parent) { GridLayoutFactory.fillDefaults() .numColumns(2) .margins(20, 20) .spacing(10, 10) .equalWidth(false) .applyTo(parent); final GridDataFactory hFill = GridDataFactory.fillDefaults().grab(true, false); UIControlsFactory.createLabel(parent, "Last Name:"); // $NON-NLS-1$ final Text txtLast = UIControlsFactory.createText(parent); hFill.applyTo(txtLast); addUIControl(txtLast, "txtLast"); // $NON-NLS-1$ UIControlsFactory.createLabel(parent, "First Name:"); // $NON-NLS-1$ final Text txtFirst = UIControlsFactory.createText(parent); hFill.applyTo(txtFirst); addUIControl(txtFirst, "txtFirst"); // $NON-NLS-1$ }
private Group createMasterDetails(final Composite parent) { final Group result = UIControlsFactory.createGroup( parent, "Master/Details that hides Mandatory-/Error-Markers on New"); // $NON-NLS-1$ final FillLayout layout = new FillLayout(SWT.HORIZONTAL); layout.marginHeight = 20; layout.marginWidth = 20; result.setLayout(layout); final MasterDetailsComposite mdComposite = new MasterDetailsComposite(result, SWT.NONE, SWT.BOTTOM); final Composite details = mdComposite.getDetails(); final GridLayout layout2 = new GridLayout(2, false); details.setLayout(layout2); UIControlsFactory.createLabel(details, "First Name:"); // $NON-NLS-1$ final Text txtFirst = UIControlsFactory.createText(details, SWT.BORDER, "first"); // $NON-NLS-1$ txtFirst.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); UIControlsFactory.createLabel(details, "Last Name:"); // $NON-NLS-1$ final Text txtLast = UIControlsFactory.createText(details, SWT.BORDER, "last"); // $NON-NLS-1$ txtLast.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); UIControlsFactory.createLabel(details, "Gender:"); // $NON-NLS-1$ final ChoiceComposite ccGender = new ChoiceComposite(details, SWT.NONE, false); ccGender.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1)); ccGender.setOrientation(SWT.HORIZONTAL); mdComposite.addUIControl(ccGender, "gender"); // $NON-NLS-1$ UIControlsFactory.createLabel(details, "Pets:"); // $NON-NLS-1$ final ChoiceComposite ccPets = new ChoiceComposite(details, SWT.NONE, true); ccPets.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1)); ccPets.setOrientation(SWT.HORIZONTAL); mdComposite.addUIControl(ccPets, "pets"); // $NON-NLS-1$ final Label lblNote = UIControlsFactory.createLabel( details, "Note: a global marker is still shown if there are less than 5 entries!", SWT.CENTER); //$NON-NLS-1$ GridDataFactory.fillDefaults().span(2, 1).applyTo(lblNote); this.addUIControl(mdComposite, "master"); // $NON-NLS-1$ return result; }
@Override protected void basicCreatePartControl(final Composite parent) { parent.setBackground(LnfManager.getLnf().getColor(LnfKeyConstants.SUB_MODULE_BACKGROUND)); parent.setLayout(new GridLayout(1, false)); final Composite composite = UIControlsFactory.createComposite(parent); final GridData data = new GridData(); data.grabExcessHorizontalSpace = true; data.horizontalAlignment = SWT.FILL; composite.setLayoutData(data); final FillLayout layout = new FillLayout(SWT.HORIZONTAL); layout.marginHeight = 5; layout.marginWidth = 5; composite.setLayout(layout); createMasterDetails(composite); }
private Group createUIProcessGroup(final Composite parent) { final Group group = UIControlsFactory.createGroup(parent, "&UIProcess visualization:"); // $NON-NLS-1$ group.setLayout(new GridLayout(1, true)); final Button startUIProcess = UIControlsFactory.createButton(group); int xHint = UIControlsFactory.getWidthHint(startUIProcess) + 10; GridDataFactory.fillDefaults().hint(xHint, SWT.DEFAULT).applyTo(startUIProcess); addUIControl(startUIProcess, "actionRidget"); // $NON-NLS-1$ final Button startJob = UIControlsFactory.createButton(group); xHint = UIControlsFactory.getWidthHint(startJob); GridDataFactory.fillDefaults().hint(xHint, SWT.DEFAULT).applyTo(startJob); addUIControl(startJob, "actionRidgetJob"); // $NON-NLS-1$ final Button startWithListener = UIControlsFactory.createButton(group); xHint = UIControlsFactory.getWidthHint(startWithListener); GridDataFactory.fillDefaults().hint(xHint, SWT.DEFAULT).applyTo(startWithListener); addUIControl(startWithListener, "actionRidgetListener"); // $NON-NLS-1$ return group; }