Package uibooster

Class UiBooster

java.lang.Object
uibooster.UiBooster

public class UiBooster
extends java.lang.Object
The UiBooster class it the main entry point to create a new dialog. It provides all implemented dialogs.
  • Constructor Summary

    Constructors 
    Constructor Description
    UiBooster()  
    UiBooster​(UiBoosterOptions options)  
  • Method Summary

    Modifier and Type Method Description
    Form createForm​(java.lang.String title)
    Creates an object for building a form with selections, textfields and textareas.
    void createNotification​(java.lang.String message, java.lang.String title)
    Creates a notification window with title and message.
    TrayMenu createTrayMenu​(java.lang.String title, java.lang.String iconPath)
    Creates an object for building a system tray menu.
    TrayMenu createTrayMenu​(java.lang.String title, java.lang.String iconPath, java.lang.Runnable onIconClicked)
    Creates an object for building a system tray menu.
    java.awt.Color showColorPicker​(java.lang.String message, java.lang.String title)
    Shows a simple color picker to select an RGB value.
    java.lang.Integer showColorPickerAndGetRGB​(java.lang.String message, java.lang.String title)
    Shows a simple color picker to select an RGB value.
    void showConfirmDialog​(java.lang.String message, java.lang.String title, java.lang.Runnable onConfirm, java.lang.Runnable onDecline)
    Shows a confirm dialog and blocks until a decision is selected.
    java.util.Date showDatePicker​(java.lang.String message, java.lang.String title)
    Shows a date picker dialog to choose a specific date.
    java.io.File showDirectorySelection()
    Shows a directory selection dialog.
    void showErrorDialog​(java.lang.String errorMessage, java.lang.String title)
    Shows an error dialog and blocks until the ok button was clicked.
    java.io.File showFileOrDirectorySelection()
    Shows a selection dialog for files and directories.
    java.io.File showFileSelection()
    Shows a file selection dialog.
    void showInfoDialog​(java.lang.String infoMessage)
    Shows an info dialog and blocks until the ok button was clicked.
    LoginCredentials showLogin​(java.lang.String message, java.lang.String title, java.lang.String usernameLabel, java.lang.String passwordLabel, java.lang.String loginButtonLabel, java.lang.String cancelButtonLabel)
    Shows a login dialog with username and password.
    java.lang.String showPasswordDialog​(java.lang.String message, java.lang.String title)
    Shows a dialog with a password input field.
    PictureGalleryDialog showPicture​(java.lang.String title, java.io.File image)
    Creates a resizable window whichs shows the given image.
    PictureGalleryDialog showPictures​(java.lang.String title, java.lang.String[] images)
    Creates a resizable window which shows the given images as a gallery.
    PictureGalleryDialog showPictures​(java.lang.String title, java.util.List<java.io.File> images)
    Creates a resizable window which shows the given images as a gallery.
    ProgressDialog showProgressDialog​(java.lang.String message, java.lang.String title, int min, int max)
    Shows dialog with progressbar and changeable message.
    java.lang.String showSelectionDialog​(java.lang.String message, java.lang.String title, java.lang.String... possibilities)
    Shows an info dialog and blocks until the ok button was clicked.
    java.lang.String showSelectionDialog​(java.lang.String message, java.lang.String title, java.util.List<java.lang.String> possibilities)
    Shows an info dialog and blocks until the ok button was clicked.
    java.lang.Integer showSlider​(java.lang.String message, java.lang.String title, int min, int max, int init)
    Shows a dialog with a customizable slider, to ask the user for amounts.
    java.lang.Integer showSlider​(java.lang.String message, java.lang.String title, int min, int max, int init, int majorTick, int minorTick)
    Shows a dialog with a customizable slider, to ask the user for amounts.
    Splashscreen showSplashscreen​(java.lang.String imagePath)
    Shows an undecorated window with a given image as splash screen.
    Splashscreen showSplashscreen​(java.lang.String imagePath, int lifeTimeInMillis)
    Shows an undecorated window with a given image as splash screen.
    java.lang.String[][] showTable​(java.lang.String[][] data, java.lang.String[] header, java.lang.String title)
    Shows a dialog with a table view.
    java.lang.String[][] showTable​(java.lang.String[][] data, java.util.List<java.lang.String> header, java.lang.String title)
    Shows a dialog with a table view.
    java.lang.String[][] showTableImmutable​(java.lang.String[][] data, java.lang.String[] header, java.lang.String title)
    Shows a dialog with a table view.
    java.lang.String[][] showTableImmutable​(java.lang.String[][] data, java.util.List<java.lang.String> header, java.lang.String title)
    Shows a dialog with a table view.
    java.lang.String showTextInputDialog​(java.lang.String message)
    Shows a dialog with text input field.
    WaitingDialog showWaitingDialog​(java.lang.String message, java.lang.String title)
    Shows a waiting dialog with a changeable message.
    WaitingDialog showWaitingDialog​(java.lang.String message, java.lang.String title, java.lang.String largeText)
    Shows a waiting dialog with a changeable message and a large (scrollable) message area.
    void showWarningDialog​(java.lang.String warningMessage, java.lang.String title)
    Shows a warning dialog and blocks until the ok button was clicked.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • showInfoDialog

      public void showInfoDialog​(java.lang.String infoMessage)
      Shows an info dialog and blocks until the ok button was clicked. '\n' is allowed as newline character for the info message.
      Parameters:
      infoMessage - expects the info message
    • showWarningDialog

      public void showWarningDialog​(java.lang.String warningMessage, java.lang.String title)
      Shows a warning dialog and blocks until the ok button was clicked. '\n' is allowed as newline character for the warn message.
      Parameters:
      warningMessage - expects the warn message
      title - expects the title for the window
    • showErrorDialog

      public void showErrorDialog​(java.lang.String errorMessage, java.lang.String title)
      Shows an error dialog and blocks until the ok button was clicked. '\n' is allowed as newline character for the error message.
      Parameters:
      errorMessage - expects the error message
      title - expects the title for the window
    • showTextInputDialog

      public java.lang.String showTextInputDialog​(java.lang.String message)
      Shows a dialog with text input field.
      Parameters:
      message - expects a message or question for the user.
      Returns:
      the user input or null on cancel
    • showPasswordDialog

      public java.lang.String showPasswordDialog​(java.lang.String message, java.lang.String title)
      Shows a dialog with a password input field.
      Parameters:
      message - expects a message or question for the user.
      title - expects the window title
      Returns:
      the typed password or null on cancel
    • showConfirmDialog

      public void showConfirmDialog​(java.lang.String message, java.lang.String title, java.lang.Runnable onConfirm, java.lang.Runnable onDecline)
      Shows a confirm dialog and blocks until a decision is selected. '\n' is allowed as newline character for the message.
      Parameters:
      message - expects the message
      title - expects the window title
      onConfirm - expects a behaviour for a conformation
      onDecline - expects a behaviour for a declination
    • showSelectionDialog

      public java.lang.String showSelectionDialog​(java.lang.String message, java.lang.String title, java.util.List<java.lang.String> possibilities)
      Shows an info dialog and blocks until the ok button was clicked. '\n' is allowed as newline character for the info message.
      Parameters:
      message - expects the message
      title - expects the window title
      possibilities - expects a list with possibilities
      Returns:
      the selection element form possibilities list or null on close
    • showSelectionDialog

      public java.lang.String showSelectionDialog​(java.lang.String message, java.lang.String title, java.lang.String... possibilities)
      Shows an info dialog and blocks until the ok button was clicked. '\n' is allowed as newline character for the info message.
      Parameters:
      message - expects the message
      title - expects the window title
      possibilities - expects a list with possibilities
      Returns:
      the selection element form possibilities list or null on close
    • showColorPicker

      public java.awt.Color showColorPicker​(java.lang.String message, java.lang.String title)
      Shows a simple color picker to select an RGB value.
      Parameters:
      message - optional message above the color picker
      title - expects a window title
      Returns:
      the selected color, on close it returns null.
    • showColorPickerAndGetRGB

      public java.lang.Integer showColorPickerAndGetRGB​(java.lang.String message, java.lang.String title)
      Shows a simple color picker to select an RGB value.
      Parameters:
      message - optional message above the color picker
      title - expects a window title
      Returns:
      the selected color as int value, on close it returns null.
    • showFileSelection

      public java.io.File showFileSelection()
      Shows a file selection dialog. Only files are shown and selectable
      Returns:
      returns the selection file or null on cancel
    • showDirectorySelection

      public java.io.File showDirectorySelection()
      Shows a directory selection dialog. Only directories are shown and selectable
      Returns:
      returns the selection directory or null on cancel
    • showFileOrDirectorySelection

      public java.io.File showFileOrDirectorySelection()
      Shows a selection dialog for files and directories.
      Returns:
      returns the selection or null on cancel
    • showLogin

      public LoginCredentials showLogin​(java.lang.String message, java.lang.String title, java.lang.String usernameLabel, java.lang.String passwordLabel, java.lang.String loginButtonLabel, java.lang.String cancelButtonLabel)
      Shows a login dialog with username and password.
      Returns:
      returns the login data or null on cancel.
    • showWaitingDialog

      public WaitingDialog showWaitingDialog​(java.lang.String message, java.lang.String title)
      Shows a waiting dialog with a changeable message. This dialog does not wait for any user input. Its decoupled from the rest of the application.
      Parameters:
      message - optional message to the user
      title - expects a title for the window
      Returns:
      returns the dialog object to change the message and hide the dialog as needed.
    • showWaitingDialog

      public WaitingDialog showWaitingDialog​(java.lang.String message, java.lang.String title, java.lang.String largeText)
      Shows a waiting dialog with a changeable message and a large (scrollable) message area. This dialog does not wait for any user input. Its decoupled from the rest of the application.
      Parameters:
      message - optional message to the user
      title - expects a title for the window
      largeText - optional large message
      Returns:
      returns the dialog object to change the message and hide the dialog as needed.
    • showProgressDialog

      public ProgressDialog showProgressDialog​(java.lang.String message, java.lang.String title, int min, int max)
      Shows dialog with progressbar and changeable message. The dialog does not wait for any user input. Its decoupled form the rest of the application.
      Parameters:
      message - optional message to the user
      title - expects a title for the window
      min - expects the minimal value for the progress
      max - expects the maximal value for the progress
      Returns:
      returns the dialog object to change the message and the progress and hide the dialog as needed.
    • showDatePicker

      public java.util.Date showDatePicker​(java.lang.String message, java.lang.String title)
      Shows a date picker dialog to choose a specific date.
      Parameters:
      message - expects a message
      title - expects a title for the window
      Returns:
      the selected date or null on cancel
    • showTable

      public java.lang.String[][] showTable​(java.lang.String[][] data, java.util.List<java.lang.String> header, java.lang.String title)
      Shows a dialog with a table view. It allows to change cell values, add rows and remove rows. The dialogs wait for user input.
      Parameters:
      data - expects the values in rows of columns -> [row_n][column_n]
      header - expects the labels for the columns
      title - expects a title for the window
      Returns:
      the accepted or changed data or null on cancel.
    • showTable

      public java.lang.String[][] showTable​(java.lang.String[][] data, java.lang.String[] header, java.lang.String title)
      Shows a dialog with a table view. It allows to change cell values, add rows and remove rows. The dialogs wait for user input.
      Parameters:
      data - expects the values in rows of columns -> [row_n][column_n]
      header - expects the labels for the columns
      title - expects a title for the window
      Returns:
      the accepted or changed data or null on cancel.
    • showTableImmutable

      public java.lang.String[][] showTableImmutable​(java.lang.String[][] data, java.util.List<java.lang.String> header, java.lang.String title)
      Shows a dialog with a table view. The table values are not changeable. The dialogs wait for user input.
      Parameters:
      data - expects the values in rows of columns -> [row_n][column_n]
      header - expects the labels for the columns
      title - expects a title for the window
      Returns:
      the accepted or changed data or null on cancel.
    • showTableImmutable

      public java.lang.String[][] showTableImmutable​(java.lang.String[][] data, java.lang.String[] header, java.lang.String title)
      Shows a dialog with a table view. The table values are not changeable. The dialogs wait for user input.
      Parameters:
      data - expects the values in rows of columns -> [row_n][column_n]
      header - expects the labels for the columns
      title - expects a title for the window
      Returns:
      the accepted or changed data or null on cancel.
    • showPicture

      public PictureGalleryDialog showPicture​(java.lang.String title, java.io.File image)
      Creates a resizable window whichs shows the given image. The image is scaled with the correct ratio. The dialogs blocks the process until it's closed.
      Parameters:
      title - expects a title for the window
      image - expects an image (JPG, PNG and BMP are supported).
      Returns:
      the object to control the picture gallery dialog
    • showPictures

      public PictureGalleryDialog showPictures​(java.lang.String title, java.util.List<java.io.File> images)
      Creates a resizable window which shows the given images as a gallery. The images are scaled with the correct ratio. The user can step forward and backwards thru the gallery. The dialogs blocks the process until it's closed.
      Parameters:
      title - expects a title for the window
      images - expects a list of images (JPG, PNG and BMP are supported).
      Returns:
      the object to control the picture gallery dialog
    • showPictures

      public PictureGalleryDialog showPictures​(java.lang.String title, java.lang.String[] images)
      Creates a resizable window which shows the given images as a gallery. The images are scaled with the correct ratio. The user can step forward and backwards thru the gallery. The dialogs blocks the process until it's closed.
      Parameters:
      title - expects a title for the window
      images - expects a list of images (JPG, PNG and BMP are supported).
      Returns:
      the object to control the picture gallery dialog
    • createForm

      public Form createForm​(java.lang.String title)
      Creates an object for building a form with selections, textfields and textareas. The dialogs blocks the process until it's closed.
      Parameters:
      title - expects a title for the window
      Returns:
      the object to create and control the form dialog
    • createTrayMenu

      public TrayMenu createTrayMenu​(java.lang.String title, java.lang.String iconPath)
      Creates an object for building a system tray menu.
      Parameters:
      title - expects a title for the tray symbole
      iconPath - expects a path for the tray icon
      Returns:
      the object to create and control the system tray
    • createTrayMenu

      public TrayMenu createTrayMenu​(java.lang.String title, java.lang.String iconPath, java.lang.Runnable onIconClicked)
      Creates an object for building a system tray menu.
      Parameters:
      title - expects a title for the tray symbole
      iconPath - expects a path for the tray icon
      onIconClicked - expects an action which starts on clicking the tray icon
      Returns:
      the object to create and control the system tray
    • createNotification

      public void createNotification​(java.lang.String message, java.lang.String title)
      Creates a notification window with title and message. The appearance and the support depends on the used OS.
      Parameters:
      message - expects a message for the notificaiton
      title - expects a title for the notification
    • showSlider

      public java.lang.Integer showSlider​(java.lang.String message, java.lang.String title, int min, int max, int init)
      Shows a dialog with a customizable slider, to ask the user for amounts. The dialogs blocks the process until it's closed.
      Parameters:
      message - expects a message for the meaning of this selection
      title - expects a title for the window
      min - expects the lowest allowed value
      max - expects the highest allowed value
      init - expects the number to start with
      Returns:
      the selected value or null if the dialog was closed
    • showSlider

      public java.lang.Integer showSlider​(java.lang.String message, java.lang.String title, int min, int max, int init, int majorTick, int minorTick)
      Shows a dialog with a customizable slider, to ask the user for amounts. The dialogs blocks the process until it's closed.
      Parameters:
      message - expects a message for the meaning of this selection
      title - expects a title for the window
      min - expects the lowest allowed value
      max - expects the highest allowed value
      init - expects the number to start with
      majorTick - expects the number of steps for the labeled ticks
      minorTick - expects the number of steps for each tick
      Returns:
      the selected value or null if the dialog was closed
    • showSplashscreen

      public Splashscreen showSplashscreen​(java.lang.String imagePath)
      Shows an undecorated window with a given image as splash screen. PNG files with transparency are supported.
      Parameters:
      imagePath - expects the path to splash screen image
      Returns:
      a splash screen object to hide or show the screen.
    • showSplashscreen

      public Splashscreen showSplashscreen​(java.lang.String imagePath, int lifeTimeInMillis)
      Shows an undecorated window with a given image as splash screen. PNG files with transparency are supported.
      Parameters:
      imagePath - expects the path to splash screen image
      lifeTimeInMillis - defines the time for showing the splash screen in milli seconds, after that the screen closes automatically
      Returns:
      a splash screen object to hide or show the screen.