Package org.opends.quicksetup.ui
Class Utilities
- java.lang.Object
-
- org.opends.quicksetup.ui.Utilities
-
public class Utilities extends Object
A set of utilities specific to GUI QuickSetup applications.
-
-
Constructor Summary
Constructors Constructor Description Utilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcenterOnComponent(Window comp, Component ref)Center the component location of the ref component.static voidcenterOnScreen(Component comp)Center the component location based on its preferred size.static JPanelcreateBrowseButtonPanel(JLabel lbl, JTextComponent tf, JButton but)Creates a panel with a field and a browse button.static booleandisplayConfirmation(Component parent, org.forgerock.i18n.LocalizableMessage msg, org.forgerock.i18n.LocalizableMessage title)Displays a confirmation message dialog.static voiddisplayError(Component parent, org.forgerock.i18n.LocalizableMessage msg, org.forgerock.i18n.LocalizableMessage title)Displays an error message dialog.static voiddisplayInformationMessage(JFrame parent, org.forgerock.i18n.LocalizableMessage msg, org.forgerock.i18n.LocalizableMessage title)Displays an information message dialog.static voidsetFrameIcon(JFrame frame)Sets a frames image icon to the standard OpenDS icon appropriate for the running platform.
-
-
-
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 fieldtf- JTextField for holding the browsed databut- 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:
trueif the user confirms the message, orfalseif 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.
-
-