public abstract class StageController
extends java.lang.Object
| Constructor and Description |
|---|
StageController() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canClose()
Called every time the stage receives a close request to check whether the
stage can be closed or not.
|
protected java.util.ResourceBundle |
getBundle()
Get the controller's resource bundle.
|
protected java.util.concurrent.ScheduledExecutorService |
getExecutorService()
Get the ScheduledExecutorService to use for background
processing.
|
protected javafx.stage.Modality |
getModality()
Called during stage setup to get the stage's modality.
|
protected java.util.prefs.Preferences |
getPreferences()
Get the controller's optional preferences object.
|
protected boolean |
getResizable()
Called during stage setup to get the stage's resizable flag.
|
javafx.stage.Stage |
getStage()
Get the controller's stage.
|
protected javafx.stage.StageStyle |
getStyle()
Called during stage setup to get the stage's style.
|
protected javafx.scene.control.MenuBar |
getSystemMenuBar()
Get the controller's optional system menu bar.
|
<T extends StageController> |
openRootStage(java.lang.Class<T> controllerClass)
Create a new root stage and set it up with the JFX scene of the submitted
controller class.
|
<T extends StageController> |
openStage(java.lang.Class<T> controllerClass)
Create a new stage owned by this controller's stage and set it up with
the JFX scene of the submitted controller class.
|
void |
reportUnexpectedException(java.lang.Throwable unexpected)
Report an unexpected exception to the user.
|
static <T extends StageController> |
setupPrimaryStage(javafx.stage.Stage controllerStage,
java.lang.Class<T> controllerClass)
Setup a an existing stage with the JFX scene of the submitted controller
class.
|
protected void |
setupStage(javafx.stage.Stage controllerStage)
Called during stage setup to perform the actual controller specific setup
steps.
|
MessageBoxResult |
showMessageBox(java.lang.String message,
java.lang.Throwable details,
MessageBoxStyle... styles)
Show a message box.
|
protected void |
syncPreferences()
Synchronize the controller's preferences.
|
protected java.util.ResourceBundle getBundle()
protected java.util.concurrent.ScheduledExecutorService getExecutorService()
protected javafx.scene.control.MenuBar getSystemMenuBar()
Override this function to define the application's system menu bar MenuBar.setUseSystemMenuBar(boolean)).
null if the
controller doesn't have one.protected java.util.prefs.Preferences getPreferences()
null if the
controller doesn't have one.protected void syncPreferences()
protected javafx.stage.StageStyle getStyle()
Derived classes can override this to change it's style.
protected javafx.stage.Modality getModality()
Derived classes can override this to change it's modality.
protected boolean getResizable()
Derived classes can override this to change it's resizable behavior.
protected boolean canClose()
true if the stage can be closed. Returning false
rejects the close request.protected void setupStage(javafx.stage.Stage controllerStage)
throws java.io.IOException
Derived classes overriding this function have to make sure to invoke the super's version prior to performing their setup steps.
controllerStage - The stage to setup.java.io.IOException - If an I/O error occurs during setup.setupPrimaryStage(Stage, Class)public static <T extends StageController> T setupPrimaryStage(javafx.stage.Stage controllerStage, java.lang.Class<T> controllerClass) throws java.io.IOException
T - The controller class.controllerStage - The primary stage to setup.controllerClass - The controller class to derive the FXML resource
from.Scene's controller instance.java.io.IOException - if an I/O error occurs while loading the FXML
resource.public <T extends StageController> T openRootStage(java.lang.Class<T> controllerClass) throws java.io.IOException
T - The controller class.controllerClass - The controller class to derive the FXML resource
from.Scene's controller instance.java.io.IOException - if an I/O error occurs while loading the FXML
resource.public <T extends StageController> T openStage(java.lang.Class<T> controllerClass) throws java.io.IOException
T - The controller class.controllerClass - The controller class to derive the FXML resource
from.Scene's controller instance.java.io.IOException - if an I/O error occurs while loading the FXML
resource.public javafx.stage.Stage getStage()
public MessageBoxResult showMessageBox(java.lang.String message, java.lang.Throwable details, MessageBoxStyle... styles)
message - The message to display.details - The (optional) exception causing the message.styles - The message box style.public void reportUnexpectedException(java.lang.Throwable unexpected)
unexpected - The exception to report.