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
Fields -
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.booleanReturnstrueifsetInModel(Object)can be called successfully.checkAssignment(Object value) Returnsvaluecast to the type accepted by the Editor or throws aClassCastException.Returns the absolute path of the Editor within the hierarchy.Returns theTtype.Returns the associated Editor.Returns theEditorDelegateassociated with the current Editor, which may benullforLeafValueEditors.Returns the value to be edited by the current editor.voidsetInModel(T data) Sets a new value in the data hierarchy being edited.voidTraverse 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()ReturnstrueifsetInModel(Object)can be called successfully. -
checkAssignment
Returnsvaluecast to the type accepted by the Editor or throws aClassCastException.- Parameters:
value- any value, includingnull- Returns:
valuecast to theTtype- 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 allLeafValueEditorsare guaranteed to have an associated delegate. -
getEditedType
Returns theTtype. -
getEditor
Returns the associated Editor. -
getEditorDelegate
EditorDelegate<T> getEditorDelegate()Returns theEditorDelegateassociated with the current Editor, which may benullforLeafValueEditors. -
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 aCompositeEditoreven if there are no data elements being edited by that editor.- Throws:
IllegalStateException- if the current Editor is not a CompositeEditor
-