Example usage for com.google.gwt.editor.client EditorContext traverseSyntheticCompositeEditor

List of usage examples for com.google.gwt.editor.client EditorContext traverseSyntheticCompositeEditor

Introduction

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

Prototype

void traverseSyntheticCompositeEditor(EditorVisitor visitor);

Source Link

Document

Traverse an editor created by CompositeEditor#createEditorForTraversal() that reflects an uninitialized instance of a composite sub-editor.

Usage

From source file:com.google.web.bindery.requestfactory.gwt.client.impl.PathCollector.java

License:Apache License

@Override
public <T> boolean visit(EditorContext<T> ctx) {
    String path = ctx.getAbsolutePath();
    if (path.length() > 0) {
        if (ValueCodex.canDecode(ctx.getEditedType())) {
            /*/*  w  w  w  .j a v  a  2s . co  m*/
             * If there's an @Path("foo.bar.valueField") annotation, we want to
             * collect the containing "foo.bar" path.
             */
            int dotPosition = path.lastIndexOf('.');
            if (dotPosition > 0) {
                String parentPath = path.substring(0, dotPosition);
                paths.add(parentPath);
            }
        } else {
            // Always collect @Path("foo.bar.baz") field, when baz isn't a value
            paths.add(path);
        }
    }
    if (ctx.asCompositeEditor() != null) {
        ctx.traverseSyntheticCompositeEditor(this);
    }
    return true;
}