@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; } }
@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; } }