Interface MainFrameDocumentController

All Known Implementing Classes:
MainFrame

public interface MainFrameDocumentController
Document-level actions implemented by the main frame.
  • Method Details

    • confirmCloseWithSave

      default boolean confirmCloseWithSave(String prompt)
      Confirms whether the close with save should continue.
      Parameters:
      prompt - text value for prompt
      Returns:
      true when the condition is met; otherwise false
    • createOpenFileChooser

      default JFileChooser createOpenFileChooser()
      Creates an open file chooser.
      Returns:
      the created open file chooser
    • createSaveFileChooser

      default JFileChooser createSaveFileChooser()
      Creates a save file chooser.
      Returns:
      the created save file chooser
    • getDocument

      ModelDocument getDocument()
      Returns the document.
      Returns:
      the document
    • getSession

      DocumentSession getSession()
      Returns the session.
      Returns:
      the session
    • installCloseHandling

      default void installCloseHandling()
      Installs the close handling.
    • installFileDropSupport

      default void installFileDropSupport()
      Installs the file drop support.
    • loadDocument

      default void loadDocument()
      Loads the document.
    • loadDocumentFromFile

      default boolean loadDocumentFromFile(File selectedFile)
      Loads the document from file.
      Parameters:
      selectedFile - file to read or write
      Returns:
      true when the condition is met; otherwise false
    • newDocument

      default void newDocument()
      Creates and opens a new empty document.
    • openInFrame

      void openInFrame(DocumentSession session)
      Opens the in frame.
      Parameters:
      session - document session to read or modify
    • refreshFrameTitle

      void refreshFrameTitle()
      Refreshes the frame title from the current state.
    • saveDocument

      default boolean saveDocument()
      Saves the document.
      Returns:
      true when the condition is met; otherwise false
    • saveDocumentAs

      default boolean saveDocumentAs()
      Saves the document as.
      Returns:
      true when the condition is met; otherwise false
    • updateUndoRedoMenuItems

      void updateUndoRedoMenuItems()
      Updates the undo redo menu items.
    • writeDocument

      default boolean writeDocument(File file)
      Writes the document.
      Parameters:
      file - file to read or write
      Returns:
      true when the condition is met; otherwise false