Source:
private void createProjectControl(Composite parent, DataBindingContext dbc) { Label lblProject = new Label(parent, SWT.NONE); lblProject.setText("OpenShift Project: "); GridDataFactory.fillDefaults() .align(SWT.FILL, SWT.CENTER) .applyTo(lblProject); StructuredViewer cmboProject = new ComboViewer(parent); GridDataFactory.fillDefaults() .align(SWT.FILL, SWT.CENTER) .grab(true, false) .hint(SWT.DEFAULT, 30) .span(NUM_COLUMS - 2, 1) .applyTo(cmboProject.getControl()); final OpenShiftExplorerLabelProvider labelProvider = new OpenShiftExplorerLabelProvider(); cmboProject.setContentProvider(new ObservableListContentProvider()); cmboProject.setLabelProvider(labelProvider); cmboProject.setInput( BeanProperties.list(IDeployImagePageModel.PROPERTY_PROJECTS).observe(model)); cmboProject.setComparator(new ProjectViewerComparator(labelProvider)); IObservableValue projectObservable = BeanProperties.value(IDeployImagePageModel.PROPERTY_PROJECT) .observe(model); ProjectStatusProvider validator = new ProjectStatusProvider(projectObservable); IObservableValue selectedProjectObservable = ViewerProperties.singleSelection().observe(cmboProject); Binding selectedProjectBinding = ValueBindingBuilder.bind(selectedProjectObservable) .converting(new ObservableTreeItem2ModelConverter(IProject.class)) .validatingAfterConvert(validator) .to(projectObservable) .in(dbc); ControlDecorationSupport.create( selectedProjectBinding, SWT.LEFT | SWT.TOP, null, new RequiredControlDecorationUpdater(true)); Button newProjectButton = new Button(parent, SWT.PUSH); newProjectButton.setText("New..."); GridDataFactory.fillDefaults() .align(SWT.LEFT, SWT.CENTER) .applyTo(newProjectButton); UIUtils.setDefaultButtonWidth(newProjectButton); dbc.addValidationStatusProvider(validator); cmboProject.getControl().forceFocus(); }

Target:
private void createProjectControl(Composite parent, DataBindingContext dbc) { Label lblProject = new Label(parent, SWT.NONE); lblProject.setText("OpenShift Project: "); GridDataFactory.fillDefaults() .align(SWT.FILL, SWT.CENTER) .applyTo(lblProject); StructuredViewer cmboProject = new ComboViewer(parent); GridDataFactory.fillDefaults() .align(SWT.FILL, SWT.CENTER) .grab(true, false) .hint(SWT.DEFAULT, 30) .span(NUM_COLUMS - 2, 1) .applyTo(cmboProject.getControl()); final OpenShiftExplorerLabelProvider labelProvider = new OpenShiftExplorerLabelProvider(); cmboProject.setContentProvider(new ObservableListContentProvider()); cmboProject.setLabelProvider(labelProvider); cmboProject.setInput( BeanProperties.list(IDeployImagePageModel.PROPERTY_PROJECTS).observe(model)); cmboProject.setComparator(new ProjectViewerComparator(labelProvider)); IObservableValue projectObservable = BeanProperties.value(IDeployImagePageModel.PROPERTY_PROJECT) .observe(model); ProjectStatusProvider validator = new ProjectStatusProvider(projectObservable); IObservableValue selectedProjectObservable = ViewerProperties.singleSelection().observe(cmboProject); Binding selectedProjectBinding = ValueBindingBuilder.bind(selectedProjectObservable) .converting(new ObservableTreeItem2ModelConverter(IProject.class)) .validatingAfterConvert(validator) .to(projectObservable) .in(dbc); ControlDecorationSupport.create( selectedProjectBinding, SWT.LEFT | SWT.TOP, null, new RequiredControlDecorationUpdater(true)); Button newProjectButton = new Button(parent, SWT.PUSH); newProjectButton.setText("New..."); GridDataFactory.fillDefaults() .align(SWT.LEFT, SWT.CENTER) .applyTo(newProjectButton); UIUtils.setDefaultButtonWidth(newProjectButton); newProjectButton.addSelectionListener(onNewProjectClicked()); dbc.addValidationStatusProvider(validator); cmboProject.getControl().forceFocus(); }