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()
EditorContext
EditorContext.getEditor()
implements CompositeEditor
.asCompositeEditor
in interface EditorContext<T>
public HasEditorDelegate<T> asHasEditorDelegate()
EditorContext
EditorContext.getEditor()
implements HasEditorDelegate
.asHasEditorDelegate
in interface EditorContext<T>
public HasEditorErrors<T> asHasEditorErrors()
EditorContext
EditorContext.getEditor()
implements HasEditorErrors
.asHasEditorErrors
in interface EditorContext<T>
public LeafValueEditor<T> asLeafValueEditor()
EditorContext
EditorContext.getEditor()
implements LeafValueEditor
.asLeafValueEditor
in interface EditorContext<T>
public ValueAwareEditor<T> asValueAwareEditor()
EditorContext
EditorContext.getEditor()
implements ValueAwareEditor
.asValueAwareEditor
in interface EditorContext<T>
public abstract boolean canSetInModel()
EditorContext
true
if EditorContext.setInModel(Object)
can be called
successfully.canSetInModel
in interface EditorContext<T>
public abstract T checkAssignment(Object value)
EditorContext
value
cast to the type accepted by the Editor or throws a
ClassCastException
.checkAssignment
in interface EditorContext<T>
value
- any value, including null
value
cast to the T
typepublic void doTraverseSyntheticCompositeEditor(EditorVisitor visitor)
public String getAbsolutePath()
EditorContext
getEditorDelegate().getPath()
becasue not all LeafValueEditors
are guaranteed to
have an associated delegate.getAbsolutePath
in interface EditorContext<T>
public abstract Class<T> getEditedType()
EditorContext
T
type.getEditedType
in interface EditorContext<T>
public Editor<T> getEditor()
EditorContext
getEditor
in interface EditorContext<T>
public EditorDelegate<T> getEditorDelegate()
EditorContext
EditorDelegate
associated with the current Editor,
which may be null
for LeafValueEditors
.getEditorDelegate
in interface EditorContext<T>
public abstract T getFromModel()
EditorContext
getFromModel
in interface EditorContext<T>
public void halt()
public boolean isHalted()
public void setEditorDelegate(AbstractEditorDelegate<T,?> delegate)
public abstract void setInModel(T data)
EditorContext
EditorContext.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)
EditorContext
CompositeEditor.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.