diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/DataBindingUtils.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/DataBindingUtils.java index 4e928820e9348b84135b70a110fe3c6519cfb331..e65eb3199bba89dc79a9dffa34693f99b1b70d08 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/DataBindingUtils.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/DataBindingUtils.java @@ -24,10 +24,13 @@ import org.eclipse.core.databinding.UpdateValueStrategy; import org.eclipse.core.databinding.conversion.IConverter; import org.eclipse.core.databinding.observable.value.IObservableValue; import org.eclipse.core.databinding.validation.IValidator; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.jface.databinding.swt.SWTObservables; import org.eclipse.jface.fieldassist.ControlDecoration; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Control; +import org.fortiss.tooling.kernel.ui.databinding.ObservableUtil; /** * Utility methods for data binding support. @@ -35,7 +38,7 @@ import org.eclipse.swt.widgets.Control; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: 1AA4C5FB4C31B3AEDFC4627BFCA48F02 + * @ConQAT.Rating YELLOW Hash: B9414140687CB9E7E2341B285675B61C */ public final class DataBindingUtils { @@ -43,6 +46,17 @@ public final class DataBindingUtils { public static final String DECORATION_KEY = ControlDecoration.class .getName(); + /** + * Bind the {@link Control} and the {@link EObject} together with the given + * {@link EStructuralFeature}. + */ + public static void bind(DataBindingContext dbc, Control control, + EObject modelElement, EStructuralFeature feature) { + performComplexTextBinding(dbc, control, + ObservableUtil.observeValue(modelElement, feature), null, null, + null, null); + } + /** * Performs a complex binding of a text control to a model element. The * validation is performed on modification (i.e. always), while model