Package ch.autumo.ui.fx.controller
Class BaseController
java.lang.Object
ch.autumo.ui.fx.controller.BaseController
- All Implemented Interfaces:
javafx.fxml.Initializable
- Direct Known Subclasses:
DefaultInfoController
FX Base Controller.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBaseController(BaseApp app, javafx.stage.Stage stage, BaseModel model, javafx.scene.layout.Pane view) Main controller. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidPrevent macOS menu detach.getApp()Get the application.javafx.scene.control.MenuBarOnly called on macOS.javafx.scene.control.MenuItemGet the 'clear all entry' menu entry.javafx.scene.control.MenuGet the 'recent' sub-menu.getModel()Get model.javafx.stage.StagegetStage()Get the stage.javafx.scene.layout.PaneOnly called on macOS.javafx.scene.layout.PanegetView()Get view.abstract voidinit(URL location, ResourceBundle resources, double toolBarShift) Delegated initialization.final voidinitialize(URL location, ResourceBundle resources) voidinitializeRecentMenu(javafx.scene.control.Menu menuRecent, javafx.scene.control.MenuItem menuItemClearAllRecent) Initialize recent menu structure.protected voidOverwrite to open a file from recent list.voidkeyPressed(javafx.scene.input.KeyEvent key) Override if you want to execute more actions on specific keyboard shortcuts for the stage/scene associated.voidRebuild recent file list.
-
Field Details
-
app
Application. -
stage
protected javafx.stage.Stage stageStage. -
model
Model. -
view
protected javafx.scene.layout.Pane viewView.
-
-
Constructor Details
-
Method Details
-
getApp
Get the application.- Returns:
- application
-
getStage
public javafx.stage.Stage getStage()Get the stage.- Returns:
- stage
-
getModel
Get model.- Returns:
- model
-
getView
public javafx.scene.layout.Pane getView()Get view.- Returns:
- model
-
keyPressed
public void keyPressed(javafx.scene.input.KeyEvent key) Override if you want to execute more actions on specific keyboard shortcuts for the stage/scene associated.- Parameters:
key- key pressed
-
initializeRecentMenu
public void initializeRecentMenu(javafx.scene.control.Menu menuRecent, javafx.scene.control.MenuItem menuItemClearAllRecent) Initialize recent menu structure.- Parameters:
menuRecent- the 'recent' sub-menumenuItemClearAllRecent- the 'clear all entry' menu entry or null (will be created)
-
getMenuRecent
public javafx.scene.control.Menu getMenuRecent()Get the 'recent' sub-menu.- Returns:
- 'recent' sub-menu
-
getMenuItemClearAllRecent
public javafx.scene.control.MenuItem getMenuItemClearAllRecent()Get the 'clear all entry' menu entry.- Returns:
- 'clear all entry' menu entry
-
rebuildRecentList
public void rebuildRecentList()Rebuild recent file list. -
disableMacOSMenuDetach
public final void disableMacOSMenuDetach()Prevent macOS menu detach. -
getMenuBar
public javafx.scene.control.MenuBar getMenuBar()Only called on macOS. Get menu bar; implement this, if you want to detach the application menu on macOS system and to add it to macOS its desktop menu. If you implement this, you might want to implement the methodgetToolBar()! Note: This is usually used for main views only! If this method returns null, the menu bar stays attached to the application andgetToolBar()is not called. Overwrite if necessary.- Returns:
- menu bar.
-
getToolBar
public javafx.scene.layout.Pane getToolBar()Only called on macOS. Returns the tool bar; seegetMenuBar(). It is only called ifgetMenuBar()returns not null! It repositions the tool bar after detaching the menu bar. The tool bar should be inside a pane with a shifted top anchor ('AnchorPane.topAnchor'); it is set to zero!- Returns:
- tool bar pane.
-
innerOpen
Overwrite to open a file from recent list.- Parameters:
file- file
-
initialize
- Specified by:
initializein interfacejavafx.fxml.Initializable
-
init
Delegated initialization. SeeInitializable.initialize(URL, ResourceBundle).- Parameters:
location- The location used to resolve relative paths for the root object, ornullif the location is not known.resources- The resources used to localize the root object, ornullif the root object was not localized.toolBarShift- if the tool bar has been shifted, this value is bigger than zero and can be used to adjust the UI layout.
-