@Override public <Q> boolean visit(EditorContext<Q> ctx) { // Create a new "domain" for each error-aware editor HasEditorErrors<Q> asErrors = ctx.asHasEditorErrors(); if (asErrors != null) { /* * Aliased editors (like ValueBoxEditorDecorator) will see the errors for * an editor at the same path that it occupies. If the editor that we're * currently looking at has the same path as the last thing we just saw, * recycle the previous errors. */ if (ctx.getAbsolutePath().equals(lastAddedPath)) { errorStack.peek().removeAll(lastAdded); errorStack.push(lastAdded); } else { errorStack.push(new ArrayList<EditorError>()); } } return true; } }
@Override public <T> boolean visit(EditorContext<T> ctx) { String path = ctx.getAbsolutePath(); if (path.length() > 0) { if (ValueCodex.canDecode(ctx.getEditedType())) { /* * 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; } }
lastAddedPath = ctx.getAbsolutePath(); errorStack.peek().addAll(errors); errors.clear(); int prefixLength = ctx.getAbsolutePath().length(); for (EditorError error : tryConsume) { if ((prefixLength > 0) && (prefixLength < error.getAbsolutePath().length())) { assert prefixLength == 0 || error.getAbsolutePath().equals(ctx.getAbsolutePath()); ((SimpleError) error).setPathPrefixLength(prefixLength);
@Override public <T> void endVisit(EditorContext<T> ctx) { toReturn.put(ctx.getAbsolutePath(), ctx.getEditor()); @SuppressWarnings("unchecked") AbstractEditorDelegate<T, ?> delegate = (AbstractEditorDelegate<T, ?>) ctx.getEditorDelegate(); if (delegate != null) { toReturn.put(delegate.getObject(), delegate); } } });
@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++; return true; }
@Override public <Q> boolean visit(EditorContext<Q> ctx) { // Create a new "domain" for each error-aware editor HasEditorErrors<Q> asErrors = ctx.asHasEditorErrors(); if (asErrors != null) { /* * Aliased editors (like ValueBoxEditorDecorator) will see the errors for * an editor at the same path that it occupies. If the editor that we're * currently looking at has the same path as the last thing we just saw, * recycle the previous errors. */ if (ctx.getAbsolutePath().equals(lastAddedPath)) { errorStack.peek().removeAll(lastAdded); errorStack.push(lastAdded); } else { errorStack.push(new ArrayList<EditorError>()); } } return true; } }
@Override public <Q> boolean visit(EditorContext<Q> ctx) { // Create a new "domain" for each error-aware editor HasEditorErrors<Q> asErrors = ctx.asHasEditorErrors(); if (asErrors != null) { /* * Aliased editors (like ValueBoxEditorDecorator) will see the errors for * an editor at the same path that it occupies. If the editor that we're * currently looking at has the same path as the last thing we just saw, * recycle the previous errors. */ if (ctx.getAbsolutePath().equals(lastAddedPath)) { errorStack.peek().removeAll(lastAdded); errorStack.push(lastAdded); } else { errorStack.push(new ArrayList<EditorError>()); } } return true; } }
@Override public <T> boolean visit(EditorContext<T> ctx) { String path = ctx.getAbsolutePath(); if (path.length() > 0) { if (ValueCodex.canDecode(ctx.getEditedType())) { /* * 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; } }
@Override public <T> boolean visit(EditorContext<T> ctx) { String path = ctx.getAbsolutePath(); if (path.length() > 0) { if (ValueCodex.canDecode(ctx.getEditedType())) { /* * 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; } }
lastAddedPath = ctx.getAbsolutePath(); errorStack.peek().addAll(errors); errors.clear(); int prefixLength = ctx.getAbsolutePath().length(); for (EditorError error : tryConsume) { if ((prefixLength > 0) && (prefixLength < error.getAbsolutePath().length())) { assert prefixLength == 0 || error.getAbsolutePath().equals(ctx.getAbsolutePath()); ((SimpleError) error).setPathPrefixLength(prefixLength);
lastAddedPath = ctx.getAbsolutePath(); errorStack.peek().addAll(errors); errors.clear(); int prefixLength = ctx.getAbsolutePath().length(); for (EditorError error : tryConsume) { if ((prefixLength > 0) && (prefixLength < error.getAbsolutePath().length())) { assert prefixLength == 0 || error.getAbsolutePath().equals(ctx.getAbsolutePath()); ((SimpleError) error).setPathPrefixLength(prefixLength);
@Override public <T> void endVisit(EditorContext<T> ctx) { toReturn.put(ctx.getAbsolutePath(), ctx.getEditor()); @SuppressWarnings("unchecked") AbstractEditorDelegate<T, ?> delegate = (AbstractEditorDelegate<T, ?>) ctx.getEditorDelegate(); if (delegate != null) { toReturn.put(delegate.getObject(), delegate); } } });
@Override public <T> void endVisit(EditorContext<T> ctx) { toReturn.put(ctx.getAbsolutePath(), ctx.getEditor()); @SuppressWarnings("unchecked") AbstractEditorDelegate<T, ?> delegate = (AbstractEditorDelegate<T, ?>) ctx.getEditorDelegate(); if (delegate != null) { toReturn.put(delegate.getObject(), delegate); } } });
@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++; return true; }
@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++; return true; }
@SuppressWarnings("unchecked") @Override public <T> boolean visit(final EditorContext<T> ctx) { final String absolutePath = ctx.getAbsolutePath(); LeafValueEditor<T> currentLeafEditor = ctx.asLeafValueEditor();