Interface IEditor<T>

  • All Superinterfaces:
    org.apache.wicket.util.io.IClusterable, Serializable
    All Known Implementing Classes:
    AbstractCmsEditor

    public interface IEditor<T>
    extends org.apache.wicket.util.io.IClusterable
    Interface that represents an editor for a particular document. Can be used by e.g. workflow plugins to change the visual representation of a "document". This can be achieved by using the edit mode or setting a different (node) model.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  IEditor.Mode  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String MODE  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Requests that the editor be closed.
      void discard()
      Discards all changes to the document and switches the editor to VIEW mode.
      void done()
      Saves the document, and switches the editor to VIEW mode.
      void focus()
      Requests focus on the editor.
      org.apache.wicket.markup.html.form.Form getForm()
      The Form that wraps the editor.
      IEditor.Mode getMode()  
      org.apache.wicket.model.IModel<T> getModel()
      Model of the Editor.
      boolean isModified()  
      boolean isTransferable()
      If a document has been saved as draft the document is marked as "transferable".
      boolean isValid()  
      void revert()
      Reverts the current document to last saved state and should keep the editor in its current mode (EDIT).
      void save()
      Saves the document, and keeps the editor in its current mode (EDIT).
      void saveDraft()  
      void setMode​(IEditor.Mode mode)  
    • Method Detail

      • focus

        void focus()
        Requests focus on the editor.
      • getModel

        org.apache.wicket.model.IModel<T> getModel()
        Model of the Editor.
        Returns:
        The model that can be used to identify the editor. For publishable documents, this is the parent handle.
      • isTransferable

        boolean isTransferable()
                        throws EditorException
        If a document has been saved as draft the document is marked as "transferable".
        Returns:
        true if the document has been saved as draft, otherwise false
        Throws:
        EditorException
      • getForm

        org.apache.wicket.markup.html.form.Form getForm()
        The Form that wraps the editor.
      • save

        void save()
           throws EditorException
        Saves the document, and keeps the editor in its current mode (EDIT).
        Throws:
        EditorException - should be thrown in case of the editor is unable to save the document or the document is not in Edit mode.
      • done

        void done()
           throws EditorException
        Saves the document, and switches the editor to VIEW mode.
        Throws:
        EditorException - should be thrown in case of the editor is unable to save the document or the document is not in Edit mode.
      • revert

        void revert()
             throws EditorException
        Reverts the current document to last saved state and should keep the editor in its current mode (EDIT).
        Throws:
        EditorException - should be thrown in case of the editor is unable to revert the document or the document is not in Edit mode.
      • discard

        void discard()
              throws EditorException
        Discards all changes to the document and switches the editor to VIEW mode.
        Throws:
        EditorException - should be thrown in case of the editor is unable to revert the document or the document is not in Edit mode.
      • close

        void close()
            throws EditorException
        Requests that the editor be closed. In case the editor contains modified document, the implementation should ask the user what to be done with the changes to the document.
        Throws:
        EditorException - when the editor is in a state where it cannot be closed.