Class UI

java.lang.Object
ch.autumo.ui.utils.UI

public class UI extends Object
GUI/MVC Utility class.
  • 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 application
      baseResourcePath - base resource path
      view - view
      fxmlName - 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 application
      baseResourcePath - base resource path
      controller - controller
      view - view
      fxmlName - FXML file name
      Returns:
      controller
    • getBaseController

      public static BaseController getBaseController(javafx.scene.layout.Pane view)
      Get base controller from view.
      Parameters:
      view - view
      Returns:
      base controller
    • imageWithoutFileBlocking

      public static javafx.scene.image.Image imageWithoutFileBlocking(Path imageFile)
      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 application
      question - the question
      Returns:
      chosen option
    • showInformationDialog

      public static void showInformationDialog(BaseApp app, String text)
      Show information dialog.
      Parameters:
      app - the application
      text - the information
    • showWarningDialog

      public static void showWarningDialog(BaseApp app, String text)
      Show warning dialog.
      Parameters:
      app - the application
      text - the warning
    • showExceptionDialog

      public static void showExceptionDialog(Thread thread, Throwable ex)
      Show exception dialog.
      Parameters:
      thread - thread
      ex - exception
    • showExceptionDialog

      public static void showExceptionDialog(Throwable ex)
      Show exception dialog.
      Parameters:
      ex - exception
    • showExceptionDialogExtended

      public static void showExceptionDialogExtended(Throwable ex, String reason)
      Show exception dialog.
      Parameters:
      ex - exception
      reason - reason
    • showError

      public static void showError(BaseApp app, Throwable ex)
      Show error pane.
      Parameters:
      app - the application
      ex - exception
    • showError

      public static void showError(BaseApp app, Throwable ex, String title)
      Show error pane.
      Parameters:
      app - the application
      ex - exception
      title - title or null
    • showAbout

      public static void showAbout(BaseApp app)
      Show about pane.
      Parameters:
      app - the application
    • showAbout

      public static void showAbout(BaseApp app, String template)
      Show about pane.
      Parameters:
      app - the application
      template - template name (HTML file name without extension)
    • showAbout

      public static void showAbout(BaseApp app, String template, String title)
      Show about pane.
      Parameters:
      app - the application
      template - template name (HTML file name without extension)
      title - title or null
    • showAboutWithLicense

      public static void showAboutWithLicense(BaseApp app)
      Show about pane with license button.
      Parameters:
      app - the application
    • showHTML

      public static void showHTML(BaseApp app, String template, String title)
      Show HTML pane.
      Parameters:
      app - the application
      template - template name (HTML file name without extension)
      title - translated title (must)
    • showLicense

      public static void showLicense(BaseApp app)
      Show License.
      Parameters:
      app - the application
    • showPane

      public static DefaultInfoController showPane(BaseApp app, Action action, String title)
      Show a default pane in an own stage.
      Parameters:
      app - the application used, if not already set by the action itself
      action - the action to execute on the pane
      title - 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 itself
      stage - the stage or null (an new one will be created)
      action - the action to execute on the pane
      title - 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 itself
      stage - the stage or null (an new one will be created)
      action - the action to execute on the pane
      fxmlName - FXML view file name
      title - 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 itself
      stage - the stage or null (an new one will be created)
      action - the action to execute on the pane
      fxmlName - FXML view file name
      title - title
      inconFile - 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 itself
      stage - the stage or null (an new one will be created)
      action - the action to execute on the pane
      fxmlName - FXML view file name
      title - title
      inconFile - 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 itself
      stage - the stage or null (an new one will be created)
      action - the action to execute on the pane
      fxmlName - FXML view file name
      title - title
      inconFile - icon file name (a resource in autumo-ui library) or absolute icon file name path to resource
      footerText - footer text or null
      styleResourcePath - relative style ('style/style.css') file name or fully qualified resource path
      Returns:
      controller view controller
    • showRegistrationPane

      public static RegistrationController showRegistrationPane(BaseApp app)
      Show registration in an own stage.
      Parameters:
      app - the application used, if not already set by the action itself
      Returns:
      controller view controller
    • showRegistrationPane

      public static RegistrationController showRegistrationPane(BaseApp app, String title)
      Show registration in an own stage.
      Parameters:
      app - the application used
      title - title
      Returns:
      controller view controller
    • showRemovePane

      public static DefaultInfoController showRemovePane(BaseApp app)
      Show remove pane in an own stage.
      Parameters:
      app - the application used
      Returns:
      controller view controller
    • showRemovePane

      public static DefaultInfoController showRemovePane(BaseApp app, String title)
      Show remove pane in an own stage.
      Parameters:
      app - the application used
      title - title
      Returns:
      controller view controller
    • showUpdatePane

      public static DefaultInfoController showUpdatePane(BaseApp app)
      Show update pane in an own stage.
      Parameters:
      app - the application used
      Returns:
      controller view controller
    • showUpdatePane

      public static DefaultInfoController showUpdatePane(BaseApp app, String title)
      Show update pane in an own stage.
      Parameters:
      app - the application used
      title - title
      Returns:
      controller view controller