use of org.springsource.ide.eclipse.commons.livexp.core.UIValueListener in project eclipse-integration-commons by spring-projects.
the class SwtConnect method connect.
public static void connect(Label widget, LiveExpression<String> model) {
ValueListener<String> modelListener = new UIValueListener<String>() {
@Override
protected void uiGotValue(LiveExpression<String> exp, String value) {
String newText = model.getValue();
if (newText == null) {
newText = "";
}
widget.setText(newText);
}
};
model.addListener(modelListener);
widget.addDisposeListener(xx -> model.removeListener(modelListener));
}
Aggregations