Package com.google.gwt.editor.client
Interface EditorContext<T>
- Type Parameters:
T
- The type of data edited by the Editor
- All Known Implementing Classes:
FakeEditorContext
public interface EditorContext<T>
Describes an Editor within an Editor hierarchy.
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionCompositeEditor
<T, ?, ?> Returns a non-null value if the editor returned bygetEditor()
implementsCompositeEditor
.Returns a non-null value if the editor returned bygetEditor()
implementsHasEditorDelegate
.Returns a non-null value if the editor returned bygetEditor()
implementsHasEditorErrors
.Returns a non-null value if the editor returned bygetEditor()
implementsLeafValueEditor
.Returns a non-null value if the editor returned bygetEditor()
implementsValueAwareEditor
.boolean
Returnstrue
ifsetInModel(Object)
can be called successfully.checkAssignment
(Object value) Returnsvalue
cast to the type accepted by the Editor or throws aClassCastException
.Returns the absolute path of the Editor within the hierarchy.Returns theT
type.Returns the associated Editor.Returns theEditorDelegate
associated with the current Editor, which may benull
forLeafValueEditors
.Returns the value to be edited by the current editor.void
setInModel
(T data) Sets a new value in the data hierarchy being edited.void
Traverse an editor created byCompositeEditor.createEditorForTraversal()
that reflects an uninitialized instance of a composite sub-editor.
-
Field Details
-
ROOT_PATH
- See Also:
-
-
Method Details
-
asCompositeEditor
CompositeEditor<T,?, asCompositeEditor()?> Returns a non-null value if the editor returned bygetEditor()
implementsCompositeEditor
. -
asHasEditorDelegate
HasEditorDelegate<T> asHasEditorDelegate()Returns a non-null value if the editor returned bygetEditor()
implementsHasEditorDelegate
. -
asHasEditorErrors
HasEditorErrors<T> asHasEditorErrors()Returns a non-null value if the editor returned bygetEditor()
implementsHasEditorErrors
. -
asLeafValueEditor
LeafValueEditor<T> asLeafValueEditor()Returns a non-null value if the editor returned bygetEditor()
implementsLeafValueEditor
. -
asValueAwareEditor
ValueAwareEditor<T> asValueAwareEditor()Returns a non-null value if the editor returned bygetEditor()
implementsValueAwareEditor
. -
canSetInModel
boolean canSetInModel()Returnstrue
ifsetInModel(Object)
can be called successfully. -
checkAssignment
Returnsvalue
cast to the type accepted by the Editor or throws aClassCastException
.- Parameters:
value
- any value, includingnull
- Returns:
value
cast to theT
type- Throws:
ClassCastException
- if value is not assignable to the typeT
-
getAbsolutePath
String getAbsolutePath()Returns the absolute path of the Editor within the hierarchy. This method should be preferred to callinggetEditorDelegate().getPath()
becasue not allLeafValueEditors
are guaranteed to have an associated delegate. -
getEditedType
Returns theT
type. -
getEditor
Returns the associated Editor. -
getEditorDelegate
EditorDelegate<T> getEditorDelegate()Returns theEditorDelegate
associated with the current Editor, which may benull
forLeafValueEditors
. -
getFromModel
T getFromModel()Returns the value to be edited by the current editor. -
setInModel
Sets a new value in the data hierarchy being edited. ThecheckAssignment(Object)
method may be used to avoid an unsafe generic cast. -
traverseSyntheticCompositeEditor
Traverse an editor created byCompositeEditor.createEditorForTraversal()
that reflects an uninitialized instance of a composite sub-editor. This can be used to examine the internal structure of aCompositeEditor
even if there are no data elements being edited by that editor.- Throws:
IllegalStateException
- if the current Editor is not a CompositeEditor
-