@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) { 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) { @SuppressWarnings("unchecked") AbstractEditorDelegate<Q, ?> delegate = (AbstractEditorDelegate<Q, ?>) ctx.getEditorDelegate(); // Pass in the EditorDelegate HasEditorDelegate<Q> asHasDelegate = ctx.asHasEditorDelegate(); if (asHasDelegate != null) { asHasDelegate.setDelegate(delegate); } // Set the EditorChain CompositeEditor<Q, ?, ?> asComposite = ctx.asCompositeEditor(); if (asComposite != null) { // Various javac generics compilation problems here @SuppressWarnings("rawtypes") EditorChain chain = delegate.getEditorChain(); asComposite.setEditorChain(chain); } return super.visit(ctx); } }
@Override public <Q> boolean visit(EditorContext<Q> ctx) { Q toSet = ctx.getFromModel(); @SuppressWarnings("unchecked") AbstractEditorDelegate<Q, ?> delegate = (AbstractEditorDelegate<Q, ?>) ctx.getEditorDelegate(); if (delegate != null) { delegate.setObject(delegate.ensureMutable(toSet)); delegate.setDirty(false); } ValueAwareEditor<Q> asValue = ctx.asValueAwareEditor(); if (asValue != null) { // Call setValue for ValueAware, non-leaf editors asValue.setValue(toSet); } else { LeafValueEditor<Q> asLeaf = ctx.asLeafValueEditor(); if (asLeaf != null) { // Call setvalue for LeafValueEditors. asLeaf.setValue(toSet); } } // CompositeEditor's setValue should create sub-editors and attach them to // the EditorChain, which will traverse them. Returning true here for a // CompositeEditor would then traverse it twice. See issue 7038. return ctx.asCompositeEditor() == null; } }
@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; } }
@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; }
@Override public <Q> boolean visit(EditorContext<Q> ctx) { @SuppressWarnings("unchecked") AbstractEditorDelegate<Q, ?> delegate = (AbstractEditorDelegate<Q, ?>) ctx.getEditorDelegate(); // Pass in the EditorDelegate HasEditorDelegate<Q> asHasDelegate = ctx.asHasEditorDelegate(); if (asHasDelegate != null) { asHasDelegate.setDelegate(delegate); } // Set the EditorChain CompositeEditor<Q, ?, ?> asComposite = ctx.asCompositeEditor(); if (asComposite != null) { // Various javac generics compilation problems here @SuppressWarnings("rawtypes") EditorChain chain = delegate.getEditorChain(); asComposite.setEditorChain(chain); } return super.visit(ctx); } }
@Override public <Q> boolean visit(EditorContext<Q> ctx) { @SuppressWarnings("unchecked") AbstractEditorDelegate<Q, ?> delegate = (AbstractEditorDelegate<Q, ?>) ctx.getEditorDelegate(); // Pass in the EditorDelegate HasEditorDelegate<Q> asHasDelegate = ctx.asHasEditorDelegate(); if (asHasDelegate != null) { asHasDelegate.setDelegate(delegate); } // Set the EditorChain CompositeEditor<Q, ?, ?> asComposite = ctx.asCompositeEditor(); if (asComposite != null) { // Various javac generics compilation problems here @SuppressWarnings("rawtypes") EditorChain chain = delegate.getEditorChain(); asComposite.setEditorChain(chain); } return super.visit(ctx); } }
@Override public <Q> boolean visit(EditorContext<Q> ctx) { Q toSet = ctx.getFromModel(); @SuppressWarnings("unchecked") AbstractEditorDelegate<Q, ?> delegate = (AbstractEditorDelegate<Q, ?>) ctx.getEditorDelegate(); if (delegate != null) { delegate.setObject(delegate.ensureMutable(toSet)); delegate.setDirty(false); } ValueAwareEditor<Q> asValue = ctx.asValueAwareEditor(); if (asValue != null) { // Call setValue for ValueAware, non-leaf editors asValue.setValue(toSet); } else { LeafValueEditor<Q> asLeaf = ctx.asLeafValueEditor(); if (asLeaf != null) { // Call setvalue for LeafValueEditors. asLeaf.setValue(toSet); } } // CompositeEditor's setValue should create sub-editors and attach them to // the EditorChain, which will traverse them. Returning true here for a // CompositeEditor would then traverse it twice. See issue 7038. return ctx.asCompositeEditor() == null; } }
@Override public <Q> boolean visit(EditorContext<Q> ctx) { Q toSet = ctx.getFromModel(); @SuppressWarnings("unchecked") AbstractEditorDelegate<Q, ?> delegate = (AbstractEditorDelegate<Q, ?>) ctx.getEditorDelegate(); if (delegate != null) { delegate.setObject(delegate.ensureMutable(toSet)); delegate.setDirty(false); } ValueAwareEditor<Q> asValue = ctx.asValueAwareEditor(); if (asValue != null) { // Call setValue for ValueAware, non-leaf editors asValue.setValue(toSet); } else { LeafValueEditor<Q> asLeaf = ctx.asLeafValueEditor(); if (asLeaf != null) { // Call setvalue for LeafValueEditors. asLeaf.setValue(toSet); } } // CompositeEditor's setValue should create sub-editors and attach them to // the EditorChain, which will traverse them. Returning true here for a // CompositeEditor would then traverse it twice. See issue 7038. return ctx.asCompositeEditor() == null; } }