Example usage for org.eclipse.jface.databinding.swt ISWTObservableValue getWidget

List of usage examples for org.eclipse.jface.databinding.swt ISWTObservableValue getWidget

Introduction

In this page you can find the example usage for org.eclipse.jface.databinding.swt ISWTObservableValue getWidget.

Prototype

public Widget getWidget();

Source Link

Document

Returns the widget of this observable

Usage

From source file:com.rcpcompany.uibindings.internal.ValueBindingImpl.java

License:Open Source License

@Override
public IValueBinding ui(ISWTObservableValue observable) {
    return ui(new SimpleUIAttribute(observable.getWidget(), null, observable));
}

From source file:org.fornax.cartridges.sculptor.framework.richclient.controller.AbstractDetailsController.java

License:Apache License

@SuppressWarnings("unchecked")
protected void setupBindingValidations() {
    Iterator<Binding> iter = getBindingContext().getBindings().iterator();
    while (iter.hasNext()) {
        Binding binding = iter.next();
        if (binding.getTarget() instanceof ISWTObservableValue) {
            ISWTObservableValue observableValue = (ISWTObservableValue) binding.getTarget();
            if (observableValue.getWidget() instanceof Control) {
                binding.getValidationStatus()
                        .addValueChangeListener(new ValueChangeListener((Control) observableValue.getWidget()));
            } else if (binding.getTarget() != null) {
                String msg = "Unknown target: " + binding.getTarget().getClass().getName();
                Status status = new Status(IStatus.WARNING, SculptorFrameworkPlugin.PLUGIN_ID, msg);
                Policy.getLog().log(status);
            }// w  w  w.  java2s. c o m
        }
    }
}