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, 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, 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(Pane view)
      Get base controller from view.
      Parameters:
      view - view
      Returns:
      base controller
    • imageWithoutFileBlocking

      public static Image imageWithoutFileBlocking(Path imageFile)
      Get image.
      Parameters:
      imageFile - image file
      Returns:
      image
    • showFineWarningConfirmationDialog

      public static Optional<ButtonType> showFineWarningConfirmationDialog(BaseApp app, String question)
      Show fine confirmation dialog.
      Parameters:
      app - the application
      question - the question text, plain or HTML
      Returns:
      chosen option
    • showFineConfirmationDialog

      public static Optional<ButtonType> showFineConfirmationDialog(BaseApp app, String question)
      Show fine confirmation dialog.
      Parameters:
      app - the application
      question - the question text, plain or HTML
      Returns:
      chosen option
    • showFineInformationDialog

      public static void showFineInformationDialog(BaseApp app, String text)
      Show fine information dialog.
      Parameters:
      app - the application
      text - the information text, plain or HTML
    • showFineWarningDialog

      public static void showFineWarningDialog(BaseApp app, String text)
      Show fine warning dialog.
      Parameters:
      app - the application
      text - the warning text, plain or HTML
    • showFineErrorDialog

      public static void showFineErrorDialog(BaseApp app, String text)
      Show fine error dialog.
      Parameters:
      app - the application
      text - the error text, plain or HTML
    • showConfirmationDialog

      public static Optional<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
    • showWarningDialog

      public static void showWarningDialog(BaseApp app, String text, int width, int height)
      Show warning dialog.
      Parameters:
      app - the application
      text - the warning
      width - width
      height - height
    • 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
    • showError

      public static void showError(BaseApp app, String msg, String title)
      Show error pane.
      Parameters:
      app - the application
      msg - message
      title - title or null
    • showErrorAndWait

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

      public static void showErrorAndWait(BaseApp app, String msg, String title)
      Show error pane.
      Parameters:
      app - the application
      msg - message
      title - title or null
    • showEncoder

      public static void showEncoder(BaseApp app)
      Show encoder pane (using the internal security key for encryption).
      Parameters:
      app - the application
    • showEncoder

      public static void showEncoder(BaseApp app, boolean internalEncryption)
      Show encoder pane.
      Parameters:
      app - the application
      internalEncryption - true if you want to use the internal security key SecureApplication.getInternalSecurityKey() and not the SecureApplication.getUniqueSecurityKey()
    • showEncoder

      public static void showEncoder(BaseApp app, boolean internalEncryption, String title)
      Show encoder pane.
      Parameters:
      app - the application
      internalEncryption - true if you want to use the internal security key SecureApplication.getInternalSecurityKey() and not the SecureApplication.getUniqueSecurityKey()
      title - title or null
    • showJsonFormatter

      public static DefaultCodeEditorController showJsonFormatter(BaseApp app)
      Configuration › JSON Formatter: show the JSON formatter window.
      Parameters:
      app - the application
      Returns:
      the pane controller
    • showJsonFormatter

      public static DefaultCodeEditorController showJsonFormatter(BaseApp app, String title)
      Show the JSON formatter window. The window is set up exactly like every other pane: the view is created with its standard constructor, setup(BaseApp, String, Pane, String) loads the FXML onto it (which also binds the controller) and title, icon, footer buttons and the note text are set on the controller before the stage is shown.
      Parameters:
      app - the application
      title - the window title, or null for the translated default
      Returns:
      the pane controller
    • 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
    • showAboutWithLicense

      public static void showAboutWithLicense(BaseApp app, String iconFile)
      Show about pane with license button.
      Parameters:
      app - the application
      iconFile - icon file name (a resource in autumo-ui library) or absolute icon file name path
    • 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, 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
    • showPaneAndWait

      public static DefaultInfoController showPaneAndWait(BaseApp app, 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, 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, Stage stage, Action action, String fxmlName, String title, String iconFile)
      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
      iconFile - icon file name (a resource in autumo-ui library)
      Returns:
      controller view controller
    • showPaneAndWait

      public static DefaultInfoController showPaneAndWait(BaseApp app, Stage stage, Action action, String fxmlName, String title, String iconFile)
      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
      iconFile - icon file name (a resource in autumo-ui library)
      Returns:
      controller view controller
    • showPane

      public static DefaultInfoController showPane(BaseApp app, Stage stage, Action action, String fxmlName, String title, String iconFile, 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
      iconFile - icon file name (a resource in autumo-ui library)
      footerText - footer text or null
      Returns:
      controller view controller
    • showPaneAndWait

      public static DefaultInfoController showPaneAndWait(BaseApp app, Stage stage, Action action, String fxmlName, String title, String iconFile, 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
      iconFile - 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, Stage stage, Action action, String fxmlName, String title, String iconFile, 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
      iconFile - 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
    • showPaneAndWait

      public static DefaultInfoController showPaneAndWait(BaseApp app, Stage stage, Action action, String fxmlName, String title, String iconFile, 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
      iconFile - 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, ch.autumo.commons.application.LicensedApplication licApp, String title)
      Show registration in an own stage.
      Parameters:
      app - the application used
      licApp - the licensed application used, in most cases the same as app
      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