Search in sources :

Example 1 with ValidatingEMFDatabindingContext

use of org.yakindu.sct.ui.editor.propertysheets.ValidatingEMFDatabindingContext in project statecharts by Yakindu.

the class StatechartDefinitionSection method initBinding.

@SuppressWarnings({ "unchecked", "rawtypes" })
protected void initBinding(StyledText embeddedEditorWidget) {
    IEMFValueProperty modelProperty = EMFEditProperties.value(getTransactionalEditingDomain(), SGraphPackage.Literals.SPECIFICATION_ELEMENT__SPECIFICATION);
    ISWTObservableValue uiProperty = WidgetProperties.text(new int[] { SWT.FocusOut, SWT.Modify }).observe(embeddedEditorWidget);
    IObservableValue modelPropertyObservable = modelProperty.observe(getContextObject());
    ValidatingEMFDatabindingContext context = new ValidatingEMFDatabindingContext((IContextElementProvider) editorPart, editorPart.getSite().getShell());
    context.bindValue(uiProperty, modelPropertyObservable, null, null);
}
Also used : ValidatingEMFDatabindingContext(org.yakindu.sct.ui.editor.propertysheets.ValidatingEMFDatabindingContext) ISWTObservableValue(org.eclipse.jface.databinding.swt.ISWTObservableValue) IObservableValue(org.eclipse.core.databinding.observable.value.IObservableValue) IEMFValueProperty(org.eclipse.emf.databinding.IEMFValueProperty)

Aggregations

IObservableValue (org.eclipse.core.databinding.observable.value.IObservableValue)1 IEMFValueProperty (org.eclipse.emf.databinding.IEMFValueProperty)1 ISWTObservableValue (org.eclipse.jface.databinding.swt.ISWTObservableValue)1 ValidatingEMFDatabindingContext (org.yakindu.sct.ui.editor.propertysheets.ValidatingEMFDatabindingContext)1