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 Details

  • Method Details

    • asCompositeEditor

      CompositeEditor<T,?,?> asCompositeEditor()
      Returns a non-null value if the editor returned by getEditor() implements CompositeEditor.
    • asHasEditorDelegate

      HasEditorDelegate<T> asHasEditorDelegate()
      Returns a non-null value if the editor returned by getEditor() implements HasEditorDelegate.
    • asHasEditorErrors

      HasEditorErrors<T> asHasEditorErrors()
      Returns a non-null value if the editor returned by getEditor() implements HasEditorErrors.
    • asLeafValueEditor

      LeafValueEditor<T> asLeafValueEditor()
      Returns a non-null value if the editor returned by getEditor() implements LeafValueEditor.
    • asValueAwareEditor

      ValueAwareEditor<T> asValueAwareEditor()
      Returns a non-null value if the editor returned by getEditor() implements ValueAwareEditor.
    • canSetInModel

      boolean canSetInModel()
      Returns true if setInModel(Object) can be called successfully.
    • checkAssignment

      T checkAssignment(Object value)
      Returns value cast to the type accepted by the Editor or throws a ClassCastException.
      Parameters:
      value - any value, including null
      Returns:
      value cast to the T type
      Throws:
      ClassCastException - if value is not assignable to the type T
    • getAbsolutePath

      String getAbsolutePath()
      Returns the absolute path of the Editor within the hierarchy. This method should be preferred to calling getEditorDelegate().getPath() becasue not all LeafValueEditors are guaranteed to have an associated delegate.
    • getEditedType

      Class<T> getEditedType()
      Returns the T type.
    • getEditor

      Editor<T> getEditor()
      Returns the associated Editor.
    • getEditorDelegate

      EditorDelegate<T> getEditorDelegate()
      Returns the EditorDelegate associated with the current Editor, which may be null for LeafValueEditors.
    • 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. The checkAssignment(Object) method may be used to avoid an unsafe generic cast.
    • traverseSyntheticCompositeEditor

      void traverseSyntheticCompositeEditor(EditorVisitor visitor)
      Traverse an editor created by CompositeEditor.createEditorForTraversal() that reflects an uninitialized instance of a composite sub-editor. This can be used to examine the internal structure of a CompositeEditor even if there are no data elements being edited by that editor.
      Throws:
      IllegalStateException - if the current Editor is not a CompositeEditor