Skip to content
Snippets Groups Projects
Commit 10931867 authored by Dongyue Mou's avatar Dongyue Mou
Browse files

added simple wrap method in data binding utility

refs 301
parent ca297ae7
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment