Package ch.autumo.ui.utils
Class UI
java.lang.Object
ch.autumo.ui.utils.UI
GUI/MVC Utility class.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHyperlink listener for HTML dialog views. -
Method Summary
Modifier and TypeMethodDescriptionstatic BaseControllergetBaseController(javafx.scene.layout.Pane view) Get base controller from view.static javafx.scene.image.ImageimageWithoutFileBlocking(Path imageFile) Get image.static BaseControllersetup(BaseApp app, String baseResourcePath, Object controller, javafx.scene.layout.Pane view, String fxmlName) Setup a view with a controller.static BaseControllerSetup a view with a controller.static voidShow about pane.static voidShow about pane.static voidShow about pane.static voidShow about pane with license button.static Optional<javafx.scene.control.ButtonType> showConfirmationDialog(BaseApp app, String question) Show confirmation dialog.static voidShow error pane.static voidShow error pane.static voidshowExceptionDialog(Thread thread, Throwable ex) Show exception dialog.static voidShow exception dialog.static voidshowExceptionDialogExtended(Throwable ex, String reason) Show exception dialog.static voidShow HTML pane.static voidshowInformationDialog(BaseApp app, String text) Show information dialog.static voidshowLicense(BaseApp app) Show License.static DefaultInfoControllerShow a default pane in an own stage.static DefaultInfoControllerShow a default pane in an own stage.static DefaultInfoControllerShow a default pane in an own stage.static DefaultInfoControllershowPane(BaseApp app, javafx.stage.Stage stage, Action action, String fxmlName, String title, String inconFile) Show a default pane in an own stage.static DefaultInfoControllershowPane(BaseApp app, javafx.stage.Stage stage, Action action, String fxmlName, String title, String inconFile, String footerText) Show a default pane in an own stage.static DefaultInfoControllershowPane(BaseApp app, javafx.stage.Stage stage, Action action, String fxmlName, String title, String inconFile, String footerText, String styleResourcePath) Show a default pane in an own stage.static RegistrationControllerShow registration in an own stage.static RegistrationControllershowRegistrationPane(BaseApp app, String title) Show registration in an own stage.static DefaultInfoControllershowRemovePane(BaseApp app) Show remove pane in an own stage.static DefaultInfoControllershowRemovePane(BaseApp app, String title) Show remove pane in an own stage.static DefaultInfoControllershowUpdatePane(BaseApp app) Show update pane in an own stage.static DefaultInfoControllershowUpdatePane(BaseApp app, String title) Show update pane in an own stage.static voidshowWarningDialog(BaseApp app, String text) Show warning dialog.
-
Method Details
-
setup
public static BaseController setup(BaseApp app, String baseResourcePath, javafx.scene.layout.Pane view, String fxmlName) Setup a view with a controller. Tries to fetch the controller from the view!- Parameters:
app- the applicationbaseResourcePath- base resource pathview- viewfxmlName- FXML file name- Returns:
- controller
-
setup
public static BaseController setup(BaseApp app, String baseResourcePath, Object controller, javafx.scene.layout.Pane view, String fxmlName) Setup a view with a controller.- Parameters:
app- the applicationbaseResourcePath- base resource pathcontroller- controllerview- viewfxmlName- FXML file name- Returns:
- controller
-
getBaseController
Get base controller from view.- Parameters:
view- view- Returns:
- base controller
-
imageWithoutFileBlocking
Get image.- Parameters:
imageFile- image file- Returns:
- image
-
showConfirmationDialog
public static Optional<javafx.scene.control.ButtonType> showConfirmationDialog(BaseApp app, String question) Show confirmation dialog.- Parameters:
app- the applicationquestion- the question- Returns:
- chosen option
-
showInformationDialog
Show information dialog.- Parameters:
app- the applicationtext- the information
-
showWarningDialog
Show warning dialog.- Parameters:
app- the applicationtext- the warning
-
showExceptionDialog
Show exception dialog.- Parameters:
thread- threadex- exception
-
showExceptionDialog
Show exception dialog.- Parameters:
ex- exception
-
showExceptionDialogExtended
Show exception dialog.- Parameters:
ex- exceptionreason- reason
-
showError
Show error pane.- Parameters:
app- the applicationex- exception
-
showError
Show error pane.- Parameters:
app- the applicationex- exceptiontitle- title or null
-
showAbout
Show about pane.- Parameters:
app- the application
-
showAbout
Show about pane.- Parameters:
app- the applicationtemplate- template name (HTML file name without extension)
-
showAbout
Show about pane.- Parameters:
app- the applicationtemplate- template name (HTML file name without extension)title- title or null
-
showAboutWithLicense
Show about pane with license button.- Parameters:
app- the application
-
showHTML
Show HTML pane.- Parameters:
app- the applicationtemplate- template name (HTML file name without extension)title- translated title (must)
-
showLicense
Show License.- Parameters:
app- the application
-
showPane
Show a default pane in an own stage.- Parameters:
app- the application used, if not already set by the action itselfaction- the action to execute on the panetitle- title- Returns:
- controller view controller
-
showPane
public static DefaultInfoController showPane(BaseApp app, javafx.stage.Stage stage, Action action, String title) Show a default pane in an own stage.- Parameters:
app- the application used, if not already set by the action itselfstage- the stage or null (an new one will be created)action- the action to execute on the panetitle- title- Returns:
- controller view controller
-
showPane
public static DefaultInfoController showPane(BaseApp app, javafx.stage.Stage stage, Action action, String fxmlName, String title) Show a default pane in an own stage.- Parameters:
app- the application used, if not already set by the action itselfstage- the stage or null (an new one will be created)action- the action to execute on the panefxmlName- FXML view file nametitle- title- Returns:
- controller view controller
-
showPane
public static DefaultInfoController showPane(BaseApp app, javafx.stage.Stage stage, Action action, String fxmlName, String title, String inconFile) Show a default pane in an own stage.- Parameters:
app- the application used, if not already set by the action itselfstage- the stage or null (an new one will be created)action- the action to execute on the panefxmlName- FXML view file nametitle- titleinconFile- icon file name (a resource in autumo-ui library)- Returns:
- controller view controller
-
showPane
public static DefaultInfoController showPane(BaseApp app, javafx.stage.Stage stage, Action action, String fxmlName, String title, String inconFile, String footerText) Show a default pane in an own stage.- Parameters:
app- the application used, if not already set by the action itselfstage- the stage or null (an new one will be created)action- the action to execute on the panefxmlName- FXML view file nametitle- titleinconFile- icon file name (a resource in autumo-ui library)footerText- footer text or null- Returns:
- controller view controller
-
showPane
public static DefaultInfoController showPane(BaseApp app, javafx.stage.Stage stage, Action action, String fxmlName, String title, String inconFile, String footerText, String styleResourcePath) Show a default pane in an own stage.- Parameters:
app- the application used, if not already set by the action itselfstage- the stage or null (an new one will be created)action- the action to execute on the panefxmlName- FXML view file nametitle- titleinconFile- icon file name (a resource in autumo-ui library) or absolute icon file name path to resourcefooterText- footer text or nullstyleResourcePath- relative style ('style/style.css') file name or fully qualified resource path- Returns:
- controller view controller
-
showRegistrationPane
Show registration in an own stage.- Parameters:
app- the application used, if not already set by the action itself- Returns:
- controller view controller
-
showRegistrationPane
Show registration in an own stage.- Parameters:
app- the application usedtitle- title- Returns:
- controller view controller
-
showRemovePane
Show remove pane in an own stage.- Parameters:
app- the application used- Returns:
- controller view controller
-
showRemovePane
Show remove pane in an own stage.- Parameters:
app- the application usedtitle- title- Returns:
- controller view controller
-
showUpdatePane
Show update pane in an own stage.- Parameters:
app- the application used- Returns:
- controller view controller
-
showUpdatePane
Show update pane in an own stage.- Parameters:
app- the application usedtitle- title- Returns:
- controller view controller
-