use of org.eclipse.emf.databinding.IEMFValueProperty in project statecharts by Yakindu.
the class StatechartPropertySection method bindDomainCombo.
protected void bindDomainCombo(EMFDataBindingContext context) {
IEMFValueProperty property = EMFEditProperties.value(TransactionUtil.getEditingDomain(eObject), BasePackage.Literals.DOMAIN_ELEMENT__DOMAIN_ID);
IViewerObservableValue observeSingleSelection = ViewersObservables.observeSingleSelection(domainCombo);
UpdateValueStrategy modelToTarget = new UpdateValueStrategy() {
@Override
public Object convert(Object value) {
return ((IDomain) value).getDomainID();
}
};
UpdateValueStrategy targetToModel = new UpdateValueStrategy() {
@Override
public Object convert(Object value) {
return DomainRegistry.getDomain((String) value);
}
};
context.bindValue(observeSingleSelection, property.observe(eObject), modelToTarget, targetToModel);
}
use of org.eclipse.emf.databinding.IEMFValueProperty in project statecharts by Yakindu.
the class StatechartPropertySection method bindSpecificationControl.
protected void bindSpecificationControl(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;
}
});
}
use of org.eclipse.emf.databinding.IEMFValueProperty in project statecharts by Yakindu.
the class EntryPropertySection method bindNameControl.
private void bindNameControl(EMFDataBindingContext context) {
IEMFValueProperty property = EMFEditProperties.value(TransactionUtil.getEditingDomain(eObject), BasePackage.Literals.NAMED_ELEMENT__NAME);
ISWTObservableValue observe = WidgetProperties.text(new int[] { SWT.FocusOut, SWT.DefaultSelection }).observe(nameText);
context.bindValue(observe, property.observe(eObject));
}
use of org.eclipse.emf.databinding.IEMFValueProperty in project statecharts by Yakindu.
the class EntryPropertySection method bindEntryKindControl.
private void bindEntryKindControl(EMFDataBindingContext context) {
IEMFValueProperty property = EMFEditProperties.value(TransactionUtil.getEditingDomain(eObject), SGraphPackage.Literals.ENTRY__KIND);
context.bindValue(ViewerProperties.singleSelection().observe(entryKindViewer), property.observe(eObject));
}
use of org.eclipse.emf.databinding.IEMFValueProperty in project statecharts by Yakindu.
the class StatechartPropertySection method bindNameControl.
protected void bindNameControl(EMFDataBindingContext context) {
IEMFValueProperty property = EMFEditProperties.value(TransactionUtil.getEditingDomain(eObject), BasePackage.Literals.NAMED_ELEMENT__NAME);
ISWTObservableValue observe = WidgetProperties.text(new int[] { SWT.FocusOut, SWT.DefaultSelection }).observe(txtName);
context.bindValue(observe, property.observe(eObject));
}
Aggregations