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

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

Introduction

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

Prototype

String getAbsolutePath();

Source Link

Document

Returns the absolute path of the Editor within the hierarchy.

Usage

From source file:com.google.gwt.editor.client.testing.EditorHierarchyPrinter.java

License:Apache License

@Override
public <T> boolean visit(EditorContext<T> ctx) {
    println(ctx.getAbsolutePath());
    data(ctx.getEditedType().getName());
    data(ctx.getEditor().getClass().getName());
    data("Implements: " //
            + ctx.asCompositeEditor() == null ? ""
                    : "CompositeEditor " //
                            + ctx.asHasEditorDelegate() == null ? ""
                                    : "HasEditorDelegate " //
                                            + ctx.asHasEditorErrors() == null ? ""
                                                    : "HasEditorErrors " //
                                                            + ctx.asLeafValueEditor() == null
                                                                    ? ""
                                                                    : "LeafValueEditor " //
                                                                            + ctx.asValueAwareEditor() == null
                                                                                    ? ""
                                                                                    : "ValueAwareEditor ");
    level++;//from ww w .  j a  va 2s .c o  m
    return true;
}

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())) {
            /*/*from  w  w w.j av  a 2s.  c o  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;
}

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

License:Apache License

/**
 * {@inheritDoc}/*from   ww w.  j  av  a 2 s . c om*/
 */
@Override
public <T> boolean visit(EditorContext<T> ctx) {
    if (!path.equals(ctx.getAbsolutePath()))
        return true; //TODO Optimize here by checking if it is necessary to descent further ...

    flush(ctx);
    return true;
}