Package lu.kbra.modelizer_next.ui.frame
Interface MainFrameDocumentController
- All Known Implementing Classes:
MainFrame
public interface MainFrameDocumentController
Document-level actions implemented by the main frame.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanconfirmCloseWithSave(String prompt) Confirms whether the close with save should continue.default JFileChooserCreates an open file chooser.default JFileChooserCreates a save file chooser.Returns the document.Returns the session.default voidInstalls the close handling.default voidInstalls the file drop support.default voidLoads the document.default booleanloadDocumentFromFile(File selectedFile) Loads the document from file.default voidCreates and opens a new empty document.voidopenInFrame(DocumentSession session) Opens the in frame.voidRefreshes the frame title from the current state.default booleanSaves the document.default booleanSaves the document as.voidUpdates the undo redo menu items.default booleanwriteDocument(File file) Writes the document.
-
Method Details
-
confirmCloseWithSave
Confirms whether the close with save should continue.- Parameters:
prompt- text value for prompt- Returns:
truewhen the condition is met; otherwisefalse
-
createOpenFileChooser
Creates an open file chooser.- Returns:
- the created open file chooser
-
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
Loads the document from file.- Parameters:
selectedFile- file to read or write- Returns:
truewhen the condition is met; otherwisefalse
-
newDocument
default void newDocument()Creates and opens a new empty document. -
openInFrame
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:
truewhen the condition is met; otherwisefalse
-
saveDocumentAs
default boolean saveDocumentAs()Saves the document as.- Returns:
truewhen the condition is met; otherwisefalse
-
updateUndoRedoMenuItems
void updateUndoRedoMenuItems()Updates the undo redo menu items. -
writeDocument
Writes the document.- Parameters:
file- file to read or write- Returns:
truewhen the condition is met; otherwisefalse
-