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