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
    • Method Detail

      • canSetInModel

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

        T checkAssignment​(java.lang.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:
        java.lang.ClassCastException - if value is not assignable to the type T
      • getAbsolutePath

        java.lang.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

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

        Editor<T> getEditor()
        Returns the associated Editor.
      • 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:
        java.lang.IllegalStateException - if the current Editor is not a CompositeEditor