List of usage examples for org.eclipse.jface.databinding.swt WidgetProperties selection
public static IWidgetValueProperty selection()
From source file:org.eclipse.rcptt.verifications.log.ui.ErrorLogVerificationEditor.java
License:Open Source License
@Override public Control create(Composite parent, FormToolkit toolkit, IWorkbenchSite site, EditorHeader header) { int style = ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED; Button includeContextsCheckbox = toolkit.createButton(parent, "Take into account Context events", SWT.CHECK);//w w w.j av a2s. co m GridDataFactory.swtDefaults().hint(SWT.DEFAULT, 50).applyTo(includeContextsCheckbox); dbc.bindValue(WidgetProperties.selection().observe(includeContextsCheckbox), EMFObservables .observeValue(getVerification(), LogPackage.Literals.ERROR_LOG_VERIFICATION__INCLUDE_CONTEXTS)); requiredTable = new PredicateTable(LogPackage.Literals.ERROR_LOG_VERIFICATION__REQUIRED, "Require"); new SectionWithToolbar(requiredTable, style).create(parent, toolkit) .setToolTipText("Every pattern should match at least one log entry for verification to succeed"); allowedTable = new PredicateTable(LogPackage.Literals.ERROR_LOG_VERIFICATION__ALLOWED, "Allow"); new SectionWithToolbar(allowedTable, style).create(parent, toolkit) .setToolTipText("These patterns are not denied by next section"); deniedTable = new PredicateTable(LogPackage.Literals.ERROR_LOG_VERIFICATION__DENIED, "Deny"); new SectionWithToolbar(deniedTable, style).create(parent, toolkit).setToolTipText( "A log entry matching any of these patterns causes verification to fail if it is not allowed by the previous section"); return null; }
From source file:org.eclipse.reddeer.swt.test.impl.button.DataBindingRadioButtonTest.java
License:Open Source License
@Override protected void createControls(Shell shell) { shell.setLayout(new GridLayout(DataBindingRadioButtonTest.NUM_BUTTONS, true)); // DBC & Model this.dbc = new DataBindingContext(); this.model = new TestPageModel(); // group/*from ww w. j a v a2 s . c o m*/ org.eclipse.swt.widgets.Group group = new org.eclipse.swt.widgets.Group(shell, SWT.NONE); group.setText("Radio Group with Names"); GridLayoutFactory.fillDefaults().applyTo(group); GridDataFactory.fillDefaults().grab(true, true).applyTo(group); SelectObservableValue selectedRadioButtonObservable = new SelectObservableValue(); // buttonA + labelA + textA org.eclipse.swt.widgets.Button buttonA = new org.eclipse.swt.widgets.Button(group, SWT.RADIO); buttonA.setText(RADIO_BUTTON_LABEL_PREFIX + "A"); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(COLUMNS, 1).applyTo(buttonA); selectedRadioButtonObservable.addOption("Selected: " + "A", WidgetProperties.selection().observe(buttonA)); org.eclipse.swt.widgets.Label labelA = new org.eclipse.swt.widgets.Label(group, SWT.NONE); labelA.setText("Label " + "A"); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).indent(INDENT, 0).applyTo(labelA); final org.eclipse.swt.widgets.Text textA = new org.eclipse.swt.widgets.Text(group, SWT.BORDER); textA.setText("Text " + "A"); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(textA); // buttonB + labelB + textB org.eclipse.swt.widgets.Button buttonB = new org.eclipse.swt.widgets.Button(group, SWT.RADIO); buttonB.setText(RADIO_BUTTON_LABEL_PREFIX + "B"); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(COLUMNS, 1).applyTo(buttonB); selectedRadioButtonObservable.addOption("Selected: " + "B", WidgetProperties.selection().observe(buttonB)); org.eclipse.swt.widgets.Label labelB = new org.eclipse.swt.widgets.Label(group, SWT.NONE); labelB.setText("Label " + "B"); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).indent(INDENT, 0).applyTo(labelB); org.eclipse.swt.widgets.Text textB = new org.eclipse.swt.widgets.Text(group, SWT.BORDER); textB.setText("Text " + "B"); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(textB); // buttonC + labelC + textC org.eclipse.swt.widgets.Button buttonC = new org.eclipse.swt.widgets.Button(group, SWT.RADIO); buttonC.setText(RADIO_BUTTON_LABEL_PREFIX + "C"); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(COLUMNS, 1).applyTo(buttonC); selectedRadioButtonObservable.addOption("Selected: " + "C", WidgetProperties.selection().observe(buttonC)); org.eclipse.swt.widgets.Label labelC = new org.eclipse.swt.widgets.Label(group, SWT.NONE); labelC.setText("Label " + "C"); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).indent(INDENT, 0).applyTo(labelC); org.eclipse.swt.widgets.Text textC = new org.eclipse.swt.widgets.Text(group, SWT.BORDER); textC.setText("Text " + "C"); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(textC); // label shows selected button org.eclipse.swt.widgets.Label label = new org.eclipse.swt.widgets.Label(shell, SWT.NONE); GridDataFactory.fillDefaults().applyTo(label); ISWTObservableValue labelTextObservable = WidgetProperties.text().observe(label); // Observe final IObservableValue buttonAModeModelObservable = BeanProperties .value(TestPageModel.class, TestPageModel.BUTTON_A_BINDING_MODE).observe(model); final IObservableValue buttonATextModelObservable = BeanProperties .value(TestPageModel.class, TestPageModel.BUTTON_A_TEXT).observe(model); final IObservableValue buttonBModeModelObservable = BeanProperties .value(TestPageModel.class, TestPageModel.BUTTON_B_BINDING_MODE).observe(model); final IObservableValue buttonBTextModelObservable = BeanProperties .value(TestPageModel.class, TestPageModel.BUTTON_B_TEXT).observe(model); final IObservableValue buttonCModeModelObservable = BeanProperties .value(TestPageModel.class, TestPageModel.BUTTON_C_BINDING_MODE).observe(model); final IObservableValue buttonCTextModelObservable = BeanProperties .value(TestPageModel.class, TestPageModel.BUTTON_C_TEXT).observe(model); // group controls final Control[] buttonAControls = new Control[] { textA, labelA }; final Control[] buttonBControls = new Control[] { textB, labelB }; final Control[] buttonCControls = new Control[] { textC, labelC }; buttonAModeModelObservable.addChangeListener(onButtonASelection(buttonAControls)); buttonBModeModelObservable.addChangeListener(onButtonBSelection(buttonBControls)); buttonCModeModelObservable.addChangeListener(onButtonCSelection(buttonCControls)); // bindings dbc.bindValue(WidgetProperties.selection().observe(buttonA), buttonAModeModelObservable); dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(textA), buttonATextModelObservable); dbc.bindValue(WidgetProperties.selection().observe(buttonB), buttonBModeModelObservable); dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(textB), buttonBTextModelObservable); dbc.bindValue(WidgetProperties.selection().observe(buttonC), buttonCModeModelObservable); dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(textC), buttonCTextModelObservable); //shows selected radio button dbc.bindValue(selectedRadioButtonObservable, labelTextObservable); // default settings and widgets update setDefaultSettings(); updateWidgetsState(buttonAControls, buttonBControls, buttonCControls); }
From source file:org.eclipse.reqcycle.repository.connector.rmf.ui.RMFSettingPage.java
License:Open Source License
protected DataBindingContext initDataBindings() { DataBindingContext bindingContext = new DataBindingContext(); //// w ww. j a va 2s . c om IObservableValue observeTextFileURITextObserveWidget = WidgetProperties.text(SWT.Modify) .observe(fileURIText); IObservableValue uriBeanObserveValue = PojoProperties.value("uri").observe(bean); bindingContext.bindValue(observeTextFileURITextObserveWidget, uriBeanObserveValue, null, null); // IObservableValue observeSelectionBtnCopyImportObserveWidget = WidgetProperties.selection() .observe(btnCopyImport); IObservableValue isCopyBeanObserveValue = PojoProperties.value("isCopy").observe(bean); bindingContext.bindValue(observeSelectionBtnCopyImportObserveWidget, isCopyBeanObserveValue, null, null); // IObservableValue observeSelectionBtnSkipMappingObserveWidget = WidgetProperties.selection() .observe(btnSkipMapping); IObservableValue skipMappingBeanObserveValue = PojoProperties.value("skipMapping").observe(bean); bindingContext.bindValue(observeSelectionBtnSkipMappingObserveWidget, skipMappingBeanObserveValue, null, null); // IObservableValue observeSingleSelectionCvDataModel = ViewerProperties.singleSelection() .observe(cvDataModel); IObservableValue dataPackageBeanObserveValue = PojoProperties.value("dataPackage").observe(bean); bindingContext.bindValue(observeSingleSelectionCvDataModel, dataPackageBeanObserveValue, null, null); // IObservableValue observeSingleSelectionCvScope = ViewerProperties.singleSelection().observe(cvScope); IObservableValue scopeBeanObserveValue = PojoProperties.value("scope").observe(bean); bindingContext.bindValue(observeSingleSelectionCvScope, scopeBeanObserveValue, null, null); // IObservableValue observeTextTxtFileObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtFile); IObservableValue modelPathBeanObserveValue = PojoProperties.value("destinationPath").observe(bean); bindingContext.bindValue(observeTextTxtFileObserveWidget, modelPathBeanObserveValue, null, null); // return bindingContext; }
From source file:org.eclipse.richbeans.generator.TwoWayDataBindingProcessor.java
License:LGPL
@Override public Control processWidget(Control control, String elementName, Map<String, String> attributes, SwtMetawidget metawidget) {//ww w .ja v a2 s.c o m if (ACTION.equals(elementName)) { return control; } // Nested Metawidgets are not bound, only remembered if (control instanceof SwtMetawidget) { State state = getState(metawidget); if (state.nestedMetawidgets == null) { state.nestedMetawidgets = CollectionUtils.newHashSet(); } state.nestedMetawidgets.add((SwtMetawidget) control); return control; } String controlProperty = metawidget.getValueProperty(control); if (controlProperty == null) { return control; } // Observe the control State state = getState(metawidget); Realm realm = state.bindingContext.getValidationRealm(); IObservableValue observeTarget = null; if (controlProperty.equalsIgnoreCase("selection")) { observeTarget = WidgetProperties.selection().observe(realm, control); } else if (controlProperty.equalsIgnoreCase("text")) { try { // Use SWT.Modify if possible to catch all changes on Text or StyledText widgets observeTarget = WidgetProperties.text(SWT.Modify).observe(realm, control); } catch (Exception e) { // Fall back to trying normal text observation for other widgets (e.g. Label, Button etc) observeTarget = WidgetProperties.text().observe(realm, control); } } else { // Not sure how to do the binding, so act as if controlProperty is null return control; } UpdateValueStrategy targetToModel; // (NO_SETTER model values are one-way only) if (TRUE.equals(attributes.get(NO_SETTER))) { targetToModel = new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER); } else { targetToModel = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE); } // Observe the model Object toInspect = metawidget.getToInspect(); String propertyName = PathUtils.parsePath(metawidget.getInspectionPath()).getNames() .replace(StringUtils.SEPARATOR_FORWARD_SLASH_CHAR, StringUtils.SEPARATOR_DOT_CHAR); if (PROPERTY.equals(elementName)) { if (propertyName.length() > 0) { propertyName += StringUtils.SEPARATOR_DOT_CHAR; } propertyName += attributes.get(NAME); } // Setup the bean to UI binding. If the bean had property change support use it else to on request binding IObservableValue observeModel = null; UpdateValueStrategy modelToTarget = null; // Check if the bean has an addPropertyChangeListener method try { // calling getMethod will throw the NoSuchMethodException if its not available i.e. bean has no // property change support toInspect.getClass().getMethod("addPropertyChangeListener", PropertyChangeListener.class); // If the addPropertyChangeListener method exists add dynamic 2 way binding observeModel = BeanProperties.value(toInspect.getClass(), propertyName).observe(realm, toInspect); modelToTarget = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE); } catch (NoSuchMethodException | SecurityException e) { // No PropertyChangeListener or can't access observeModel = PojoProperties.value(toInspect.getClass(), propertyName).observe(realm, toInspect); modelToTarget = new UpdateValueStrategy(UpdateValueStrategy.POLICY_ON_REQUEST); } // Check for enums and if they exist make a converter on the fly // (Note: this logic seems to work but is potentially incomplete - see comments inside Metawidget's PropertyTypeInspector) final Class<?> elementType = (Class<?>) observeModel.getValueType(); if (elementType != null && elementType.isEnum()) { Converter converter = new Converter(String.class, elementType) { @Override public Object convert(Object fromObject) { // Try to compare results of toString() first for (Object value : elementType.getEnumConstants()) { if (value.toString().equals(fromObject.toString())) { return value; } } // Otherwise compare declared enum names for (Object value : elementType.getEnumConstants()) { if (((Enum<?>) value).name().equalsIgnoreCase(fromObject.toString())) { return value; } } return null; } }; mConverters.put(new ConvertFromTo(String.class, elementType), converter); } // Add converters targetToModel.setConverter( getConverter((Class<?>) observeTarget.getValueType(), (Class<?>) observeModel.getValueType())); modelToTarget.setConverter( getConverter((Class<?>) observeModel.getValueType(), (Class<?>) observeTarget.getValueType())); // Bind it state.bindingContext.bindValue(observeTarget, observeModel, targetToModel, modelToTarget); return control; }
From source file:org.eclipse.riena.internal.ui.ridgets.swt.DateTimeRidget.java
License:Open Source License
@Override protected void bindUIControl() { final DateTime control = getUIControl(); if (control != null) { dbc = new DataBindingContext(); final IObservableValue timeObservable; final IObservableValue dateObservable; final Date nonNullDate = getNonNullDate(getDate()); if (isTimeControl(control)) { // it is a time widget timeObservable = WidgetProperties.selection().observe(control); timeObservable.setValue(nonNullDate); dateObservable = new WritableValue(timeObservable.getRealm(), nonNullDate, Date.class); } else {//from w w w . ja v a 2 s . co m // it is date/calendar widget dateObservable = WidgetProperties.selection().observe(control); dateObservable.setValue(nonNullDate); timeObservable = new WritableValue(dateObservable.getRealm(), nonNullDate, Date.class); } controlBinding = dbc.bindValue( new DateAndTimeObservableWithNullConversion(dateObservable, timeObservable), getRidgetObservable(), new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE) .setAfterGetValidator(new EditRulesValidator()), new UpdateValueStrategy(UpdateValueStrategy.POLICY_ON_REQUEST)); } }
From source file:org.eclipse.rmf.reqif10.search.ui.masterdetails.CriteriaDetailsPage.java
License:Open Source License
private Binding bindButton(Button button, EStructuralFeature feature) { ///* w ww . j a va2 s . c om*/ IObservableValue target = WidgetProperties.selection().observe(button); IObservableValue model = EMFEditObservables.observeDetailValue(Realm.getDefault(), editingDomain, writableValue, feature); return bindingContext.bindValue(target, model, null, null); }
From source file:org.eclipse.scada.ca.ui.editor.forms.common.ConfigurationFormToolkit.java
License:Open Source License
public void createStandardCheckbox(final Composite parent, final String attributeName, final String label, final IObservableMap data, final Object valueType) { final Button button = this.toolkit.createButton(parent, label, SWT.CHECK); {//from ww w. ja va2 s . co m final GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 3; button.setLayoutData(gd); final IObservableValue value = Observables.observeMapEntry(data, attributeName, valueType); this.dbc.bindValue(WidgetProperties.selection().observe(button), value); } }
From source file:org.fusesource.ide.camel.editor.globalconfiguration.beans.wizards.pages.GlobalBeanEditWizardPage.java
License:Open Source License
@Override protected Binding createBeanRefBinding(UpdateValueStrategy strategy) { ComputedValue<String> refIdValue = new ComputedValue<String>() { @Override/*w w w. j a v a 2 s .c o m*/ protected String calculate() { final String beanTag = beanConfigUtil.getFactoryBeanTag(selectedElement); final Object value = beanConfigUtil.getAttributeValue(selectedElement, beanTag); if (value instanceof String) { return (String) value; } return null; } @Override protected void doSetValue(String value) { final String beanTag = beanConfigUtil.getFactoryBeanTag(selectedElement); final String strValue = value; final String oldValue = (String) beanConfigUtil.getAttributeValue(selectedElement, beanTag); if ((strValue != null && oldValue == null) || (oldValue != null && !oldValue.contentEquals(strValue))) { beanConfigUtil.setAttributeValue(selectedElement, beanTag, strValue); } getValue(); } }; IObservableValue<?> observable = WidgetProperties.selection().observe(beanRefIdCombo); setRefUiObservable((ISWTObservableValue) observable); Binding binding = dbc.bindValue(observable, refIdValue, strategy, null); ControlDecorationSupport.create(binding, SWT.LEFT | SWT.TOP); return binding; }
From source file:org.fusesource.ide.camel.editor.globalconfiguration.beans.wizards.pages.GlobalBeanWizardPage.java
License:Open Source License
@Override protected Binding createBeanRefBinding(UpdateValueStrategy strategy) { final IObservableValue<?> refObservable = PojoProperties .value(GlobalBeanBaseWizardPage.class, "beanRefId", String.class).observe(this); //$NON-NLS-1$ final IObservableValue<?> selectedBeanRef = WidgetProperties.selection().observe(beanRefIdCombo); setRefUiObservable((ISWTObservableValue) selectedBeanRef); Binding binding = dbc.bindValue(selectedBeanRef, refObservable, strategy, null); ControlDecorationSupport.create(binding, SWT.LEFT | SWT.TOP); return binding; }
From source file:org.fusesource.ide.camel.editor.properties.AdvancedEndpointPropertiesSection.java
License:Open Source License
/** * // w w w. j a v a 2 s . c om * @param props * @param page * @param ignorePathProperties * @param group */ protected void generateTabContents(List<Parameter> props, final Composite page, boolean ignorePathProperties, String group) { props.sort(new ParameterPriorityComparator()); for (Parameter p : props) { final Parameter prop = p; if (!shouldBeDisplayed(prop, group, ignorePathProperties)) { continue; } ISWTObservableValue uiObservable = null; IObservableValue<Object> modelObservable; IValidator validator = null; createPropertyLabel(toolkit, page, p); Control c = null; // BOOLEAN PROPERTIES if (CamelComponentUtils.isBooleanProperty(prop)) { new BooleanParameterPropertyUICreatorForAdvanced(dbc, modelMap, eip, selectedEP, p, page, getWidgetFactory()).create(); // TEXT PROPERTIES } else if (CamelComponentUtils.isTextProperty(prop) || CamelComponentUtils.isCharProperty(prop)) { new TextParameterPropertyUICreatorForAdvanced(dbc, modelMap, eip, selectedEP, p, page, getWidgetFactory()).create(); // NUMBER PROPERTIES } else if (CamelComponentUtils.isNumberProperty(prop)) { new NumberParameterPropertyUICreatorForAdvanced(dbc, modelMap, eip, selectedEP, prop, page, getWidgetFactory()).create(); // CHOICE PROPERTIES } else if (CamelComponentUtils.isChoiceProperty(prop)) { CCombo choiceCombo = new CCombo(page, SWT.BORDER | SWT.FLAT | SWT.READ_ONLY | SWT.SINGLE); toolkit.adapt(choiceCombo, true, true); choiceCombo.setEditable(false); choiceCombo.setItems(CamelComponentUtils.getChoices(prop)); String selectedValue = PropertiesUtils.getPropertyFromUri(selectedEP, prop, component); for (int i = 0; i < choiceCombo.getItems().length; i++) { if (selectedValue != null && choiceCombo.getItem(i).equalsIgnoreCase(selectedValue)) { choiceCombo.select(i); break; } else if (selectedValue == null && p.getDefaultValue() != null && choiceCombo.getItem(i).equalsIgnoreCase(p.getDefaultValue())) { choiceCombo.select(i); break; } } choiceCombo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { CCombo choice = (CCombo) e.getSource(); String newValue = choice.getText(); PropertiesUtils.updateURIParams(selectedEP, prop, newValue, component, modelMap); if (AbstractCamelModelElement.PARAMETER_LANGUAGENAME.equalsIgnoreCase(p.getName())) { updateDependenciesForLanguage(selectedEP, newValue); } } }); choiceCombo.setLayoutData(createPropertyFieldLayoutData()); c = choiceCombo; //initialize the map entry modelMap.put(p.getName(), choiceCombo.getText()); // create observables for the control uiObservable = WidgetProperties.selection().observe(choiceCombo); if (PropertiesUtils.isRequired(p)) { validator = new IValidator() { @Override public IStatus validate(Object value) { if (value != null && value instanceof String && value.toString().trim().length() > 0) { return ValidationStatus.ok(); } return ValidationStatus.error( "Parameter " + prop.getName() + " is a mandatory field and cannot be empty."); } }; } // FILE PROPERTIES } else if (CamelComponentUtils.isFileProperty(prop)) { new FileParameterPropertyUICreatorForAdvanced(dbc, modelMap, eip, selectedEP, p, page, getWidgetFactory()).create(); // EXPRESSION PROPERTIES } else if (CamelComponentUtils.isExpressionProperty(prop)) { Text txtField = toolkit.createText(page, PropertiesUtils.getPropertyFromUri(selectedEP, prop, component), SWT.SINGLE | SWT.BORDER | SWT.LEFT); txtField.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { Text txt = (Text) e.getSource(); PropertiesUtils.updateURIParams(selectedEP, prop, txt.getText(), component, modelMap); } }); txtField.setLayoutData(createPropertyFieldLayoutData()); c = txtField; if (PropertiesUtils.isRequired(p)) { validator = new IValidator() { /* * (non-Javadoc) * @see org.eclipse.core.databinding.validation.IValidator#validate(java.lang.Object) */ @Override public IStatus validate(Object value) { if (value != null && value instanceof String && value.toString().trim().length() > 0) { return ValidationStatus.ok(); } return ValidationStatus.error( "Parameter " + prop.getName() + " is a mandatory field and cannot be empty."); } }; } //initialize the map entry modelMap.put(p.getName(), txtField.getText()); // create observables for the control uiObservable = WidgetProperties.text(SWT.Modify).observe(txtField); // DATAFORMAT PROPERTIES } else if (CamelComponentUtils.isDataFormatProperty(prop)) { Text txtField = toolkit.createText(page, PropertiesUtils.getPropertyFromUri(selectedEP, prop, component), SWT.SINGLE | SWT.BORDER | SWT.LEFT); txtField.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { Text txt = (Text) e.getSource(); String newValue = txt.getText(); PropertiesUtils.updateURIParams(selectedEP, prop, newValue, component, modelMap); updateDependenciesForDataFormat(selectedEP, newValue); } }); txtField.setLayoutData(createPropertyFieldLayoutData()); c = txtField; if (PropertiesUtils.isRequired(p)) { validator = new IValidator() { /* * (non-Javadoc) * @see org.eclipse.core.databinding.validation.IValidator#validate(java.lang.Object) */ @Override public IStatus validate(Object value) { if (value != null && value instanceof String && value.toString().trim().length() > 0) { return ValidationStatus.ok(); } return ValidationStatus.error( "Parameter " + prop.getName() + " is a mandatory field and cannot be empty."); } }; } //initialize the map entry modelMap.put(p.getName(), txtField.getText()); // create observables for the control uiObservable = WidgetProperties.text(SWT.Modify).observe(txtField); // UNSUPPORTED PROPERTIES / REFS } else if (CamelComponentUtils.isUnsupportedProperty(prop)) { // TODO: check how to handle lists and maps - for now we treat // them as string field only --> in DetailsSection seems that // there is something to handle that new UnsupportedParameterPropertyUICreatorForAdvanced(dbc, modelMap, eip, selectedEP, p, page, getWidgetFactory()).create(); // CLASS BASED PROPERTIES - REF OR CLASSNAMES AS STRINGS } else { new TextParameterPropertyUICreatorForAdvanced(dbc, modelMap, eip, selectedEP, p, page, getWidgetFactory()).create(); } if (uiObservable != null) { // create UpdateValueStrategy and assign to the binding UpdateValueStrategy strategy = new UpdateValueStrategy(); strategy.setBeforeSetValidator(validator); // create observables for the Map entries modelObservable = Observables.observeMapEntry(modelMap, p.getName()); // bind the observables Binding bindValue = dbc.bindValue(uiObservable, modelObservable, strategy, null); ControlDecorationSupport.create(bindValue, SWT.TOP | SWT.LEFT); if (p.getDescription() != null) c.setToolTipText(p.getDescription()); } } }