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:
FakeEditorContext
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ROOT_PATH
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompositeEditor<T,?,?>
asCompositeEditor()
Returns a non-null value if the editor returned bygetEditor()
implementsCompositeEditor
.HasEditorDelegate<T>
asHasEditorDelegate()
Returns a non-null value if the editor returned bygetEditor()
implementsHasEditorDelegate
.HasEditorErrors<T>
asHasEditorErrors()
Returns a non-null value if the editor returned bygetEditor()
implementsHasEditorErrors
.LeafValueEditor<T>
asLeafValueEditor()
Returns a non-null value if the editor returned bygetEditor()
implementsLeafValueEditor
.ValueAwareEditor<T>
asValueAwareEditor()
Returns a non-null value if the editor returned bygetEditor()
implementsValueAwareEditor
.boolean
canSetInModel()
Returnstrue
ifsetInModel(Object)
can be called successfully.T
checkAssignment(java.lang.Object value)
Returnsvalue
cast to the type accepted by the Editor or throws aClassCastException
.java.lang.String
getAbsolutePath()
Returns the absolute path of the Editor within the hierarchy.java.lang.Class<T>
getEditedType()
Returns theT
type.Editor<T>
getEditor()
Returns the associated Editor.EditorDelegate<T>
getEditorDelegate()
Returns theEditorDelegate
associated with the current Editor, which may benull
forLeafValueEditors
.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.void
traverseSyntheticCompositeEditor(EditorVisitor visitor)
Traverse an editor created byCompositeEditor.createEditorForTraversal()
that reflects an uninitialized instance of a composite sub-editor.
-
-
-
Field Detail
-
ROOT_PATH
static final java.lang.String ROOT_PATH
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
T checkAssignment(java.lang.Object value)
Returnsvalue
cast to the type accepted by the Editor or throws aClassCastException
.- Parameters:
value
- any value, includingnull
- Returns:
value
cast to theT
type- Throws:
java.lang.ClassCastException
- if value is not assignable to the typeT
-
getAbsolutePath
java.lang.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
java.lang.Class<T> getEditedType()
Returns theT
type.
-
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
void setInModel(T data)
Sets a new value in the data hierarchy being edited. ThecheckAssignment(Object)
method may be used to avoid an unsafe generic cast.
-
traverseSyntheticCompositeEditor
void traverseSyntheticCompositeEditor(EditorVisitor visitor)
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:
java.lang.IllegalStateException
- if the current Editor is not a CompositeEditor
-
-