Example usage for org.eclipse.jface.databinding.fieldassist ControlDecorationSupport dispose

List of usage examples for org.eclipse.jface.databinding.fieldassist ControlDecorationSupport dispose

Introduction

In this page you can find the example usage for org.eclipse.jface.databinding.fieldassist ControlDecorationSupport dispose.

Prototype

public void dispose() 

Source Link

Document

Disposes this ControlDecorationSupport, including all control decorations managed by it.

Usage

From source file:com.nextep.designer.vcs.ui.editors.base.AbstractFormEditor.java

License:Open Source License

/**
 * This method initialize properly the {@link DataBindingContext} and delegates the binding
 * setup to the implementations.//from www .  j  a v a  2 s .  co  m
 */
@SuppressWarnings("unchecked")
protected final void bindModel() {
    if (context == null) {
        context = new DataBindingContext();
    } else {
        if (!detailPart) {
            // Disposing every binding, not sure whether this is needed, but otherwise we would
            // need
            // to dispose the ControlDecorationSupport so it seems safer to dispose the whole
            // binding
            for (Object b : new ArrayList<Object>(context.getBindings())) {
                ((Binding) b).dispose();
            }
            for (ControlDecorationSupport s : fieldDecorators) {
                s.dispose();
            }
            // Disposing our data binding context on current element
            context.getValidationRealm().exec(new Runnable() {

                @Override
                public void run() {
                    context.dispose();
                }
            });
            context = new DataBindingContext();
        }
    }
    doBindModel(context);
}