
T - the type of data being editedpublic abstract class AbstractEditorContext<T> extends Object implements EditorContext<T>
ROOT_PATH| Constructor and Description |
|---|
AbstractEditorContext(Editor<T> editor,
String path) |
| Modifier and Type | Method and Description |
|---|---|
CompositeEditor<T,?,?> |
asCompositeEditor()
Returns a non-null value if the editor returned by
EditorContext.getEditor()
implements CompositeEditor. |
HasEditorDelegate<T> |
asHasEditorDelegate()
Returns a non-null value if the editor returned by
EditorContext.getEditor()
implements HasEditorDelegate. |
HasEditorErrors<T> |
asHasEditorErrors()
Returns a non-null value if the editor returned by
EditorContext.getEditor()
implements HasEditorErrors. |
LeafValueEditor<T> |
asLeafValueEditor()
Returns a non-null value if the editor returned by
EditorContext.getEditor()
implements LeafValueEditor. |
ValueAwareEditor<T> |
asValueAwareEditor()
Returns a non-null value if the editor returned by
EditorContext.getEditor()
implements ValueAwareEditor. |
abstract boolean |
canSetInModel()
Returns
true if EditorContext.setInModel(Object) can be called
successfully. |
abstract T |
checkAssignment(Object value)
Returns
value cast to the type accepted by the Editor or throws a
ClassCastException. |
void |
doTraverseSyntheticCompositeEditor(EditorVisitor visitor) |
String |
getAbsolutePath()
Returns the absolute path of the Editor within the hierarchy.
|
abstract Class<T> |
getEditedType()
Returns the
T type. |
Editor<T> |
getEditor()
Returns the associated Editor.
|
EditorDelegate<T> |
getEditorDelegate()
Returns the
EditorDelegate associated with the current Editor,
which may be null for LeafValueEditors. |
abstract T |
getFromModel()
Returns the value to be edited by the current editor.
|
void |
halt() |
boolean |
isHalted() |
void |
setEditorDelegate(AbstractEditorDelegate<T,?> delegate) |
abstract void |
setInModel(T data)
Sets a new value in the data hierarchy being edited.
|
void |
traverse(EditorVisitor visitor,
AbstractEditorDelegate<?,?> next) |
void |
traverseSyntheticCompositeEditor(EditorVisitor visitor)
Traverse an editor created by
CompositeEditor.createEditorForTraversal() that reflects an
uninitialized instance of a composite sub-editor. |
public CompositeEditor<T,?,?> asCompositeEditor()
EditorContextEditorContext.getEditor()
implements CompositeEditor.asCompositeEditor in interface EditorContext<T>public HasEditorDelegate<T> asHasEditorDelegate()
EditorContextEditorContext.getEditor()
implements HasEditorDelegate.asHasEditorDelegate in interface EditorContext<T>public HasEditorErrors<T> asHasEditorErrors()
EditorContextEditorContext.getEditor()
implements HasEditorErrors.asHasEditorErrors in interface EditorContext<T>public LeafValueEditor<T> asLeafValueEditor()
EditorContextEditorContext.getEditor()
implements LeafValueEditor.asLeafValueEditor in interface EditorContext<T>public ValueAwareEditor<T> asValueAwareEditor()
EditorContextEditorContext.getEditor()
implements ValueAwareEditor.asValueAwareEditor in interface EditorContext<T>public abstract boolean canSetInModel()
EditorContexttrue if EditorContext.setInModel(Object) can be called
successfully.canSetInModel in interface EditorContext<T>public abstract T checkAssignment(Object value)
EditorContextvalue cast to the type accepted by the Editor or throws a
ClassCastException.checkAssignment in interface EditorContext<T>value - any value, including nullvalue cast to the T typepublic void doTraverseSyntheticCompositeEditor(EditorVisitor visitor)
public String getAbsolutePath()
EditorContextgetEditorDelegate().getPath()
becasue not all LeafValueEditors are guaranteed to
have an associated delegate.getAbsolutePath in interface EditorContext<T>public abstract Class<T> getEditedType()
EditorContextT type.getEditedType in interface EditorContext<T>public Editor<T> getEditor()
EditorContextgetEditor in interface EditorContext<T>public EditorDelegate<T> getEditorDelegate()
EditorContextEditorDelegate associated with the current Editor,
which may be null for LeafValueEditors.getEditorDelegate in interface EditorContext<T>public abstract T getFromModel()
EditorContextgetFromModel in interface EditorContext<T>public void halt()
public boolean isHalted()
public void setEditorDelegate(AbstractEditorDelegate<T,?> delegate)
public abstract void setInModel(T data)
EditorContextEditorContext.checkAssignment(Object) method may be used to avoid an unsafe
generic cast.setInModel in interface EditorContext<T>public void traverse(EditorVisitor visitor, AbstractEditorDelegate<?,?> next)
public void traverseSyntheticCompositeEditor(EditorVisitor visitor)
EditorContextCompositeEditor.createEditorForTraversal() that reflects an
uninitialized instance of a composite sub-editor. This can be used to
examine the internal structure of a CompositeEditor even if there
are no data elements being edited by that editor.traverseSyntheticCompositeEditor in interface EditorContext<T>Copyright © 2018. All rights reserved.