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 class
Hyperlink listener for HTML dialog views. -
Method Summary
Modifier and TypeMethodDescriptionstatic BaseController
getBaseController
(javafx.scene.layout.Pane view) Get base controller from view.static javafx.scene.image.Image
imageWithoutFileBlocking
(Path imageFile) Get image.static BaseController
setup
(BaseApp app, String baseResourcePath, Object controller, javafx.scene.layout.Pane view, String fxmlName) Setup a view with a controller.static BaseController
Setup a view with a controller.static void
Show about pane.static void
Show about pane.static void
Show about pane.static void
Show about pane with license button.static Optional
<javafx.scene.control.ButtonType> showConfirmationDialog
(BaseApp app, String question) Show confirmation dialog.static void
Show error pane.static void
Show error pane.static void
showExceptionDialog
(Thread thread, Throwable ex) Show exception dialog.static void
Show exception dialog.static void
showExceptionDialogExtended
(Throwable ex, String reason) Show exception dialog.static void
Show HTML pane.static void
showInformationDialog
(BaseApp app, String text) Show information dialog.static void
showLicense
(BaseApp app) Show License.static DefaultInfoController
Show a default pane in an own stage.static DefaultInfoController
Show a default pane in an own stage.static DefaultInfoController
Show a default pane in an own stage.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.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.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.static RegistrationController
Show registration in an own stage.static RegistrationController
showRegistrationPane
(BaseApp app, String title) Show registration in an own stage.static DefaultInfoController
showRemovePane
(BaseApp app) Show remove pane in an own stage.static DefaultInfoController
showRemovePane
(BaseApp app, String title) Show remove pane in an own stage.static DefaultInfoController
showUpdatePane
(BaseApp app) Show update pane in an own stage.static DefaultInfoController
showUpdatePane
(BaseApp app, String title) Show update pane in an own stage.static void
showWarningDialog
(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
-