Example usage for com.google.gwt.editor.client ValueAwareEditor flush

List of usage examples for com.google.gwt.editor.client ValueAwareEditor flush

Introduction

In this page you can find the example usage for com.google.gwt.editor.client ValueAwareEditor flush.

Prototype

void flush();

Source Link

Document

Indicates that the Editor cycle is finished.

Usage

From source file:de.csenk.gwt.commons.editor.client.AutoFlushInitializer.java

License:Apache License

/**
 * @see com.google.gwt.editor.client.impl.Flusher.endVisit(EditorContext<Q> ctx)
 * @param ctx/*from  www. ja v a2s  . c  o m*/
 */
protected <Q> void flush(EditorContext<Q> ctx) {
    // Flush ValueAware editors
    final ValueAwareEditor<Q> asValue = ctx.asValueAwareEditor();
    if (asValue != null) {
        asValue.flush();
    }

    // Pull value from LeafValueEditors and update edited object
    final LeafValueEditor<Q> asLeaf = ctx.asLeafValueEditor();
    if (asLeaf != null && ctx.canSetInModel()) {
        ctx.setInModel(asLeaf.getValue());
    }
}

From source file:de.csenk.gwt.commons.editor.client.PathFlusher.java

License:Apache License

/**
 * @see com.google.gwt.editor.client.impl.Flusher.endVisit(EditorContext<Q> ctx)
 * @param ctx// w  ww . j a v  a2 s. c om
 */
private <Q> void flush(EditorContext<Q> ctx) {
    // Flush ValueAware editors
    final ValueAwareEditor<Q> asValue = ctx.asValueAwareEditor();
    if (asValue != null) {
        asValue.flush();
    }

    // Pull value from LeafValueEditors and update edited object
    final LeafValueEditor<Q> asLeaf = ctx.asLeafValueEditor();
    if (asLeaf != null && ctx.canSetInModel()) {
        ctx.setInModel(asLeaf.getValue());
    }
}