Search in sources :

Example 1 with IEMFValueProperty

use of org.eclipse.emf.databinding.IEMFValueProperty in project statecharts by Yakindu.

the class ChoicePropertySection method bindChoiceKind.

protected void bindChoiceKind(EMFDataBindingContext context) {
    IEMFValueProperty property = EMFEditProperties.value(TransactionUtil.getEditingDomain(eObject), SGraphPackage.Literals.CHOICE__KIND);
    context.bindValue(ViewerProperties.singleSelection().observe(choiceKindViewer), property.observe(eObject));
}
Also used : IEMFValueProperty(org.eclipse.emf.databinding.IEMFValueProperty)

Example 2 with IEMFValueProperty

use of org.eclipse.emf.databinding.IEMFValueProperty in project statecharts by Yakindu.

the class StatePropertySection method bindSpecificationControl.

protected void bindSpecificationControl(EMFDataBindingContext context) {
    IEMFValueProperty specificationProperty = EMFEditProperties.value(TransactionUtil.getEditingDomain(eObject), SGraphPackage.Literals.SPECIFICATION_ELEMENT__SPECIFICATION);
    ISWTObservableValue specificationTextProperty = WidgetProperties.text(SWT.FocusOut).observe(txtSpecification);
    context.bindValue(specificationTextProperty, specificationProperty.observe(eObject), null, new UpdateValueStrategy() {

        @Override
        protected IStatus doSet(IObservableValue observableValue, Object value) {
            if (getCompletionProposalAdapter() == null) {
                return super.doSet(observableValue, value);
            } else if (!getCompletionProposalAdapter().isProposalPopupOpen())
                return super.doSet(observableValue, value);
            return Status.OK_STATUS;
        }
    });
}
Also used : UpdateValueStrategy(org.eclipse.core.databinding.UpdateValueStrategy) IStatus(org.eclipse.core.runtime.IStatus) ISWTObservableValue(org.eclipse.jface.databinding.swt.ISWTObservableValue) EObject(org.eclipse.emf.ecore.EObject) IObservableValue(org.eclipse.core.databinding.observable.value.IObservableValue) IEMFValueProperty(org.eclipse.emf.databinding.IEMFValueProperty)

Example 3 with IEMFValueProperty

use of org.eclipse.emf.databinding.IEMFValueProperty in project statecharts by Yakindu.

the class StatePropertySection method bindDocumentationControl.

protected void bindDocumentationControl(EMFDataBindingContext context) {
    IEMFValueProperty property = EMFEditProperties.value(TransactionUtil.getEditingDomain(eObject), BasePackage.Literals.DOCUMENTED_ELEMENT__DOCUMENTATION);
    ISWTObservableValue observe = WidgetProperties.text(new int[] { SWT.FocusOut, SWT.DefaultSelection }).observe(documentation);
    context.bindValue(observe, property.observe(eObject));
}
Also used : ISWTObservableValue(org.eclipse.jface.databinding.swt.ISWTObservableValue) IEMFValueProperty(org.eclipse.emf.databinding.IEMFValueProperty)

Example 4 with IEMFValueProperty

use of org.eclipse.emf.databinding.IEMFValueProperty in project statecharts by Yakindu.

the class TransitionPropertySection method bindModel.

@Override
public void bindModel(EMFDataBindingContext context) {
    IEMFValueProperty modelProperty = EMFEditProperties.value(TransactionUtil.getEditingDomain(eObject), SGraphPackage.Literals.SPECIFICATION_ELEMENT__SPECIFICATION);
    ISWTObservableValue uiProperty = WidgetProperties.text(SWT.FocusOut).observe(textControl);
    context.bindValue(uiProperty, modelProperty.observe(eObject), null, new UpdateValueStrategy() {

        @Override
        protected IStatus doSet(IObservableValue observableValue, Object value) {
            if (getCompletionProposalAdapter() != null && !getCompletionProposalAdapter().isProposalPopupOpen())
                return super.doSet(observableValue, value);
            return Status.OK_STATUS;
        }
    });
    IEMFValueProperty property = EMFEditProperties.value(TransactionUtil.getEditingDomain(eObject), BasePackage.Literals.DOCUMENTED_ELEMENT__DOCUMENTATION);
    ISWTObservableValue observe = WidgetProperties.text(new int[] { SWT.FocusOut, SWT.DefaultSelection }).observe(documentation);
    context.bindValue(observe, property.observe(eObject));
}
Also used : UpdateValueStrategy(org.eclipse.core.databinding.UpdateValueStrategy) IStatus(org.eclipse.core.runtime.IStatus) ISWTObservableValue(org.eclipse.jface.databinding.swt.ISWTObservableValue) IObservableValue(org.eclipse.core.databinding.observable.value.IObservableValue) IEMFValueProperty(org.eclipse.emf.databinding.IEMFValueProperty)

Example 5 with IEMFValueProperty

use of org.eclipse.emf.databinding.IEMFValueProperty in project statecharts by Yakindu.

the class StatechartPropertySection method bindDocumentationControl.

protected void bindDocumentationControl(EMFDataBindingContext context) {
    IEMFValueProperty property = EMFEditProperties.value(TransactionUtil.getEditingDomain(eObject), BasePackage.Literals.DOCUMENTED_ELEMENT__DOCUMENTATION);
    ISWTObservableValue observe = WidgetProperties.text(new int[] { SWT.FocusOut, SWT.DefaultSelection }).observe(documentation);
    context.bindValue(observe, property.observe(eObject));
}
Also used : ISWTObservableValue(org.eclipse.jface.databinding.swt.ISWTObservableValue) IEMFValueProperty(org.eclipse.emf.databinding.IEMFValueProperty)

Aggregations

IEMFValueProperty (org.eclipse.emf.databinding.IEMFValueProperty)14 ISWTObservableValue (org.eclipse.jface.databinding.swt.ISWTObservableValue)11 UpdateValueStrategy (org.eclipse.core.databinding.UpdateValueStrategy)4 IObservableValue (org.eclipse.core.databinding.observable.value.IObservableValue)4 IStatus (org.eclipse.core.runtime.IStatus)3 EObject (org.eclipse.emf.ecore.EObject)3 IViewerObservableValue (org.eclipse.jface.databinding.viewers.IViewerObservableValue)1 IDomain (org.yakindu.sct.domain.extension.IDomain)1 ValidatingEMFDatabindingContext (org.yakindu.sct.ui.editor.propertysheets.ValidatingEMFDatabindingContext)1