Class Utilities


  • public class Utilities
    extends Object
    A set of utilities specific to GUI QuickSetup applications.
    • Constructor Detail

      • Utilities

        public Utilities()
    • Method Detail

      • createBrowseButtonPanel

        public static JPanel createBrowseButtonPanel​(JLabel lbl,
                                                     JTextComponent tf,
                                                     JButton but)
        Creates a panel with a field and a browse button.
        Parameters:
        lbl - JLabel for the field
        tf - JTextField for holding the browsed data
        but - JButton for invoking browse action
        Returns:
        the created panel.
      • setFrameIcon

        public static void setFrameIcon​(JFrame frame)
        Sets a frames image icon to the standard OpenDS icon appropriate for the running platform.
        Parameters:
        frame - for which the icon will be set
      • centerOnScreen

        public static void centerOnScreen​(Component comp)
        Center the component location based on its preferred size. The code considers the particular case of 2 screens and puts the component on the center of the left screen
        Parameters:
        comp - the component to be centered.
      • centerOnComponent

        public static void centerOnComponent​(Window comp,
                                             Component ref)
        Center the component location of the ref component.
        Parameters:
        comp - the component to be centered.
        ref - the component to be used as reference.
      • displayConfirmation

        public static boolean displayConfirmation​(Component parent,
                                                  org.forgerock.i18n.LocalizableMessage msg,
                                                  org.forgerock.i18n.LocalizableMessage title)
        Displays a confirmation message dialog.
        Parameters:
        parent - the parent frame of the confirmation dialog.
        msg - the confirmation message.
        title - the title of the dialog.
        Returns:
        true if the user confirms the message, or false if not.
      • displayError

        public static void displayError​(Component parent,
                                        org.forgerock.i18n.LocalizableMessage msg,
                                        org.forgerock.i18n.LocalizableMessage title)
        Displays an error message dialog.
        Parameters:
        parent - the parent component of the error dialog.
        msg - the error message.
        title - the title for the dialog.
      • displayInformationMessage

        public static void displayInformationMessage​(JFrame parent,
                                                     org.forgerock.i18n.LocalizableMessage msg,
                                                     org.forgerock.i18n.LocalizableMessage title)
        Displays an information message dialog.
        Parameters:
        parent - the parent frame of the information dialog.
        msg - the error message.
        title - the title for the dialog.