T
- the type of data being editedpublic class RootEditorContext<T> extends AbstractEditorContext<T>
EditorContext
that is used as a starting point
by EditorDrivers.ROOT_PATH
Constructor and Description |
---|
RootEditorContext(AbstractEditorDelegate<T,?> editorDelegate,
Class<T> editedType,
T value) |
Modifier and Type | Method and Description |
---|---|
boolean |
canSetInModel()
Returns
true if EditorContext.setInModel(Object) can be called
successfully. |
T |
checkAssignment(Object value)
Returns
value . |
Class<T> |
getEditedType()
Returns the
T type. |
T |
getFromModel()
Returns the value to be edited by the current editor.
|
void |
setInModel(T data)
Sets a new value in the data hierarchy being edited.
|
asCompositeEditor, asHasEditorDelegate, asHasEditorErrors, asLeafValueEditor, asValueAwareEditor, doTraverseSyntheticCompositeEditor, getAbsolutePath, getEditor, getEditorDelegate, halt, isHalted, setEditorDelegate, traverse, traverseSyntheticCompositeEditor
public RootEditorContext(AbstractEditorDelegate<T,?> editorDelegate, Class<T> editedType, T value)
public boolean canSetInModel()
EditorContext
true
if EditorContext.setInModel(Object)
can be called
successfully.canSetInModel
in interface EditorContext<T>
canSetInModel
in class AbstractEditorContext<T>
public T checkAssignment(Object value)
value
. There's no way to actually implement this check in
GWT client-side code. In order to prevent users from having to check for
the root context in a visitor to avoid a special case, we'll just return
the object. If the value really isn't assignable to T, a call to
setInModel(Object)
will fail in the generated code, which has an
explicit cast.checkAssignment
in interface EditorContext<T>
checkAssignment
in class AbstractEditorContext<T>
value
- any value, including null
value
cast to the T
typepublic Class<T> getEditedType()
EditorContext
T
type.getEditedType
in interface EditorContext<T>
getEditedType
in class AbstractEditorContext<T>
public T getFromModel()
EditorContext
getFromModel
in interface EditorContext<T>
getFromModel
in class AbstractEditorContext<T>
public void setInModel(T data)
EditorContext
EditorContext.checkAssignment(Object)
method may be used to avoid an unsafe
generic cast.setInModel
in interface EditorContext<T>
setInModel
in class AbstractEditorContext<T>
Copyright © 2016. All rights reserved.