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

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

Introduction

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

Prototype

Class<T> getEditedType();

Source Link

Document

Returns the T type.

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());//from w  ww .j a v a  2s. com
    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++;
    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   www. ja v  a 2 s  .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;
}