Package org.opends.quicksetup.ui
Class UIFactory
- java.lang.Object
-
- org.opends.quicksetup.ui.UIFactory
-
public class UIFactory extends Object
This class provides constants an methods to create Swing objects and to generate UI elements with a common look and feel.When we want to change a color, a background or a font this is the class that should be modified.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUIFactory.IconTypeThe following enumeration contains the different icons that we can have.static classUIFactory.TextStyleThe following enumeration contains the different text styles that we can have.
-
Field Summary
Fields Modifier and Type Field Description static intBOTTOM_INSET_BACKGROUNDSpecifies the bottom inset for the background image.static intBOTTOM_INSET_PROGRESS_BARSpecifies the left inset for the progress bar.static intBOTTOM_INSET_SECONDARY_FIELDSpecifies the top inset for a secondary field.static ColorCHECKBOX_COLORSpecifies the check box text color.static FontCHECKBOX_FONTSpecifies the font for the check box text.static FontCURRENT_STEP_FONTSpecifies the font for the step which is the current one in the steps panel.static ColorCURRENT_STEP_PANEL_BACKGROUNDSpecifies the current step background color.static BorderCURRENT_STEP_PANEL_BORDERSpecifies the current step panel border.static ColorDEFAULT_BACKGROUNDSpecifies the default background color.static ColorDEFAULT_LABEL_COLORSpecifies the default label color.static BorderDIALOG_PANEL_BORDERSpecifies the dialog border.static intDN_FIELD_SIZESpecifies the number of columns of a text field for a dn.static FontERROR_DIALOG_FONTSpecifies the font for the text in the WebBrowserErrorDialog.static intEXTRA_DIALOG_HEIGHTSpecifies the number of extra points that we add to the minimum size of the dialog.static ColorFIELD_INVALID_COLORSpecifies the invalid field color.static ColorFIELD_VALID_COLORSpecifies the valid field color.static intHORIZONTAL_INSET_BETWEEN_BUTTONSSpecifies the horizontal insets between buttons.static intHOST_FIELD_SIZESpecifies the number of columns of a text field for a host name.static StringHTML_SEPARATORAn HTML separator text that can be used in the progress panel.static ColorINLINE_HELP_COLORSpecifies the in-line help text color.static FontINLINE_HELP_FONTSpecifies the font for the text in the in-line help.static ColorINSTRUCTIONS_COLORSpecifies the instructions text color.static FontINSTRUCTIONS_FONTSpecifies the font for the instructions of the current panel.static FontINSTRUCTIONS_MONOSPACE_FONTSpecifies the font for the instructions of the current panel.static intLEFT_INSET_BACKGROUNDSpecifies the left inset for the background image.static intLEFT_INSET_BROWSESpecifies the left inset for the browse button.static intLEFT_INSET_COPY_BUTTONSpecifies the left inset for the copy url button.static intLEFT_INSET_PRIMARY_FIELDSpecifies the left inset for the primary field.static intLEFT_INSET_RADIO_SUBORDINATESpecifies the left inset for radio subordinate panel.static intLEFT_INSET_SECONDARY_FIELDSpecifies the left inset for the secondary field.static intLEFT_INSET_STEPSpecifies the left inset for the steps.static intLEFT_INSET_SUBPANEL_SUBORDINATESpecifies the left inset for a subordinate subpanel.static intLEFT_INSET_SUBSTEPSpecifies the extra left inset for the sub-steps.static FontNOT_CURRENT_STEP_FONTSpecifies the font for the step which is not the current one in the steps panel.static intNUMBER_ENTRIES_FIELD_SIZESpecifies the number of columns of a text field for the number of entries.static ColorPANEL_BORDER_COLORSpecifies the panel border color.static FontPASSWORD_FIELD_FONTSpecifies the font for the password field text.static intPASSWORD_FIELD_SIZESpecifies the number of columns of a text field for a password.static ColorPASSWORDFIELD_COLORSpecifies the password field text color.static intPATH_FIELD_SIZESpecifies the number of columns of a text field for a path.static intPORT_FIELD_SIZESpecifies the number of columns of a text field for a port.static FontPRIMARY_FIELD_INVALID_FONTSpecifies the font for the primary invalid field.static FontPRIMARY_FIELD_VALID_FONTSpecifies the font for the primary valid field.static intPROGRESS_BAR_SIZESpecifies the number of points for the width of the progress bar.static ColorPROGRESS_COLORSpecifies the progress text color.static FontPROGRESS_DONE_FONTSpecifies the font for the done text 'Done' in the progress panel.static FontPROGRESS_ERROR_FONTSpecifies the font for the error messages in the progress panel.static FontPROGRESS_FONTSpecifies the font for the progress text.static FontPROGRESS_LOG_ERROR_FONTSpecifies the font for the error log messages in the progress panel.static FontPROGRESS_LOG_FONTSpecifies the font for the log messages in the progress panel.static FontPROGRESS_POINTS_FONTSpecifies the font for the points '....' in the progress panel.static FontPROGRESS_WARNING_FONTSpecifies the font for the warning messages in the progress panel.static ColorREAD_ONLY_COLORSpecifies the read only text color.static FontREAD_ONLY_FONTSpecifies the font for read only text.static intRELATIVE_PATH_FIELD_SIZESpecifies the number of columns of a text field for a relative path.static intRIGHT_INSET_BACKGROUNDSpecifies the right inset for background image.static FontSECONDARY_FIELD_INVALID_FONTSpecifies the font for the secondary invalid field.static FontSECONDARY_FIELD_VALID_FONTSpecifies the font for the secondary valid field.static FontSECONDARY_STATUS_FONTSpecifies the font for the secondary status field.static FontSTACK_FONTSpecifies the font for the stack trace in the progress panel.static BorderTEXT_AREA_BORDERSpecifies the text area border.static ColorTEXTFIELD_COLORSpecifies the text field text color.static FontTEXTFIELD_FONTSpecifies the font for the text field text.static FontTITLE_FONTSpecifies the font for the title of the current panel.static intTOP_INSET_BACKGROUNDSpecifies the top inset for the background image.static intTOP_INSET_BROWSESpecifies the top inset for the browse button.static intTOP_INSET_ERROR_MESSAGESpecifies the top inset for the error message.static intTOP_INSET_INPUT_SUBPANELSpecifies the top inset for input subpanel.static intTOP_INSET_INSTRUCTIONS_SUBPANELSpecifies the top inset for the instructions sub panel.static intTOP_INSET_PRIMARY_FIELDSpecifies the top inset for a primary field.static intTOP_INSET_PROGRESS_BARSpecifies the top inset for the progress bar.static intTOP_INSET_PROGRESS_TEXTAREASpecifies the top inset for the progress text area.static intTOP_INSET_RADIO_SUBORDINATESpecifies the top inset for a radio button subordinate panel.static intTOP_INSET_RADIOBUTTONSpecifies the top inset for a radio button.static intTOP_INSET_SECONDARY_FIELDSpecifies the top inset for a secondary field.static intTOP_INSET_STEPSpecifies the top inset for the steps.static intUID_FIELD_SIZESpecifies the number of columns of a text field for a UID.
-
Constructor Summary
Constructors Constructor Description UIFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringapplyErrorBackgroundToHtml(String html)Returns the html text passed as parameter with the error background applied to it.static StringapplyFontToHtml(String html, Font font)Returns a String that contains the html passed as parameter with a span applied.static StringapplyMargin(String html, int top, int right, int bottom, int left)Returns the html text passed as parameter with some added margin.static StringapplySuccessfulBackgroundToHtml(String html)Returns the html text passed as parameter with the success background applied to it.static StringapplyWarningBackgroundToHtml(String html)Returns the html text passed as parameter with the warning background applied to it.static JScrollPanecreateBorderLessScrollBar(Component comp)Returns a JScrollPane that contains the provided component.static InsetsgetButtonsPanelInsets()Returns the insets to be used for the button panel.static InsetsgetCurrentStepPanelInsets()Returns the insets to be used for the current step panel.static InsetsgetEmptyInsets()Return empty insets.static StringgetIconHtml(UIFactory.IconType iconType)Returns the HTML string representing the provided IconType.static ImageIcongetImageIcon(UIFactory.IconType iconType)Returns an ImageIcon object for the provided IconType.static InsetsgetStepsPanelInsets()Returns the insets to be used for the steps panel.static voidinitialize()This method initialize the look and feel and UI settings specific to quick setup.static voidinitializeLookAndFeel()This method initialize the look and feel.static JEditorPanemakeHtmlPane(org.forgerock.i18n.LocalizableMessage text, Font font)Returns a read only JEditorPane containing the provided text with the provided font.static JButtonmakeJButton(org.forgerock.i18n.LocalizableMessage label, org.forgerock.i18n.LocalizableMessage tooltip)Creates a JButton with the given label and tooltip.static JCheckBoxmakeJCheckBox(org.forgerock.i18n.LocalizableMessage text, org.forgerock.i18n.LocalizableMessage tooltip, UIFactory.TextStyle style)Creates a JCheckBox with the given text, tooltip text and text style.static JLabelmakeJLabel(LabelFieldDescriptor desc)Commodity method that returns a JLabel based on a LabelFieldDescriptor.static JLabelmakeJLabel(UIFactory.IconType iconName, org.forgerock.i18n.LocalizableMessage text, UIFactory.TextStyle style)Creates a JLabel with the given icon, text and text style.static <T> JList<T>makeJList(UIFactory.TextStyle textStyle)Creates a JList.static JPanelmakeJPanel()Creates a new JPanel.static JPasswordFieldmakeJPasswordField(org.forgerock.i18n.LocalizableMessage text, org.forgerock.i18n.LocalizableMessage tooltip, int size, UIFactory.TextStyle style)Creates a JPasswordField with the given icon, tooltip text, size and text style.static JRadioButtonmakeJRadioButton(org.forgerock.i18n.LocalizableMessage text, org.forgerock.i18n.LocalizableMessage tooltip, UIFactory.TextStyle style)Creates a JRadioButton with the given text, tooltip text and text style.static JTextComponentmakeJTextComponent(LabelFieldDescriptor desc, String defaultValue)Commodity method that returns a JTextComponent based on a LabelFieldDescriptor.static JTextFieldmakeJTextField(org.forgerock.i18n.LocalizableMessage text, org.forgerock.i18n.LocalizableMessage tooltip, int size, UIFactory.TextStyle style)Creates a JTextField with the given icon, tooltip text, size and text style.static JEditorPanemakeProgressPane(JScrollPane scroll)Returns a JEditorPane that works with the provided scroll.static JEditorPanemakeTextPane(org.forgerock.i18n.LocalizableMessage text, UIFactory.TextStyle style)Returns a read only JEditorPane containing the provided text with the provided TextStyle.static voidsetScrollIncrementUnit(JScrollPane scroll)Sets the scroll increment unit for the scroll.static voidsetTextStyle(JComponent l, UIFactory.TextStyle style)Sets the specified text style to the component passed as parameter.
-
-
-
Field Detail
-
HORIZONTAL_INSET_BETWEEN_BUTTONS
public static final int HORIZONTAL_INSET_BETWEEN_BUTTONS
Specifies the horizontal insets between buttons.- See Also:
- Constant Field Values
-
TOP_INSET_STEP
public static final int TOP_INSET_STEP
Specifies the top inset for the steps.- See Also:
- Constant Field Values
-
LEFT_INSET_STEP
public static final int LEFT_INSET_STEP
Specifies the left inset for the steps.- See Also:
- Constant Field Values
-
LEFT_INSET_SUBSTEP
public static final int LEFT_INSET_SUBSTEP
Specifies the extra left inset for the sub-steps.- See Also:
- Constant Field Values
-
TOP_INSET_INSTRUCTIONS_SUBPANEL
public static final int TOP_INSET_INSTRUCTIONS_SUBPANEL
Specifies the top inset for the instructions sub panel.- See Also:
- Constant Field Values
-
TOP_INSET_INPUT_SUBPANEL
public static final int TOP_INSET_INPUT_SUBPANEL
Specifies the top inset for input subpanel.- See Also:
- Constant Field Values
-
TOP_INSET_PRIMARY_FIELD
public static final int TOP_INSET_PRIMARY_FIELD
Specifies the top inset for a primary field.- See Also:
- Constant Field Values
-
TOP_INSET_SECONDARY_FIELD
public static final int TOP_INSET_SECONDARY_FIELD
Specifies the top inset for a secondary field.- See Also:
- Constant Field Values
-
TOP_INSET_RADIOBUTTON
public static final int TOP_INSET_RADIOBUTTON
Specifies the top inset for a radio button.- See Also:
- Constant Field Values
-
TOP_INSET_RADIO_SUBORDINATE
public static final int TOP_INSET_RADIO_SUBORDINATE
Specifies the top inset for a radio button subordinate panel.- See Also:
- Constant Field Values
-
TOP_INSET_PROGRESS_BAR
public static final int TOP_INSET_PROGRESS_BAR
Specifies the top inset for the progress bar.- See Also:
- Constant Field Values
-
TOP_INSET_PROGRESS_TEXTAREA
public static final int TOP_INSET_PROGRESS_TEXTAREA
Specifies the top inset for the progress text area.- See Also:
- Constant Field Values
-
TOP_INSET_BACKGROUND
public static final int TOP_INSET_BACKGROUND
Specifies the top inset for the background image.- See Also:
- Constant Field Values
-
TOP_INSET_ERROR_MESSAGE
public static final int TOP_INSET_ERROR_MESSAGE
Specifies the top inset for the error message.- See Also:
- Constant Field Values
-
TOP_INSET_BROWSE
public static final int TOP_INSET_BROWSE
Specifies the top inset for the browse button.- See Also:
- Constant Field Values
-
RIGHT_INSET_BACKGROUND
public static final int RIGHT_INSET_BACKGROUND
Specifies the right inset for background image.- See Also:
- Constant Field Values
-
LEFT_INSET_PRIMARY_FIELD
public static final int LEFT_INSET_PRIMARY_FIELD
Specifies the left inset for the primary field.- See Also:
- Constant Field Values
-
LEFT_INSET_BROWSE
public static final int LEFT_INSET_BROWSE
Specifies the left inset for the browse button.- See Also:
- Constant Field Values
-
LEFT_INSET_RADIO_SUBORDINATE
public static final int LEFT_INSET_RADIO_SUBORDINATE
Specifies the left inset for radio subordinate panel.- See Also:
- Constant Field Values
-
LEFT_INSET_SECONDARY_FIELD
public static final int LEFT_INSET_SECONDARY_FIELD
Specifies the left inset for the secondary field.- See Also:
- Constant Field Values
-
LEFT_INSET_BACKGROUND
public static final int LEFT_INSET_BACKGROUND
Specifies the left inset for the background image.- See Also:
- Constant Field Values
-
LEFT_INSET_COPY_BUTTON
public static final int LEFT_INSET_COPY_BUTTON
Specifies the left inset for the copy url button.- See Also:
- Constant Field Values
-
LEFT_INSET_SUBPANEL_SUBORDINATE
public static final int LEFT_INSET_SUBPANEL_SUBORDINATE
Specifies the left inset for a subordinate subpanel.- See Also:
- Constant Field Values
-
BOTTOM_INSET_PROGRESS_BAR
public static final int BOTTOM_INSET_PROGRESS_BAR
Specifies the left inset for the progress bar.- See Also:
- Constant Field Values
-
BOTTOM_INSET_BACKGROUND
public static final int BOTTOM_INSET_BACKGROUND
Specifies the bottom inset for the background image.- See Also:
- Constant Field Values
-
BOTTOM_INSET_SECONDARY_FIELD
public static final int BOTTOM_INSET_SECONDARY_FIELD
Specifies the top inset for a secondary field.- See Also:
- Constant Field Values
-
PATH_FIELD_SIZE
public static final int PATH_FIELD_SIZE
Specifies the number of columns of a text field for a path.- See Also:
- Constant Field Values
-
RELATIVE_PATH_FIELD_SIZE
public static final int RELATIVE_PATH_FIELD_SIZE
Specifies the number of columns of a text field for a relative path.- See Also:
- Constant Field Values
-
HOST_FIELD_SIZE
public static final int HOST_FIELD_SIZE
Specifies the number of columns of a text field for a host name.- See Also:
- Constant Field Values
-
UID_FIELD_SIZE
public static final int UID_FIELD_SIZE
Specifies the number of columns of a text field for a UID.- See Also:
- Constant Field Values
-
PORT_FIELD_SIZE
public static final int PORT_FIELD_SIZE
Specifies the number of columns of a text field for a port.- See Also:
- Constant Field Values
-
DN_FIELD_SIZE
public static final int DN_FIELD_SIZE
Specifies the number of columns of a text field for a dn.- See Also:
- Constant Field Values
-
PASSWORD_FIELD_SIZE
public static final int PASSWORD_FIELD_SIZE
Specifies the number of columns of a text field for a password.- See Also:
- Constant Field Values
-
NUMBER_ENTRIES_FIELD_SIZE
public static final int NUMBER_ENTRIES_FIELD_SIZE
Specifies the number of columns of a text field for the number of entries.- See Also:
- Constant Field Values
-
PROGRESS_BAR_SIZE
public static final int PROGRESS_BAR_SIZE
Specifies the number of points for the width of the progress bar.- See Also:
- Constant Field Values
-
EXTRA_DIALOG_HEIGHT
public static final int EXTRA_DIALOG_HEIGHT
Specifies the number of extra points that we add to the minimum size of the dialog.- See Also:
- Constant Field Values
-
DEFAULT_BACKGROUND
public static final Color DEFAULT_BACKGROUND
Specifies the default background color.
-
CURRENT_STEP_PANEL_BACKGROUND
public static final Color CURRENT_STEP_PANEL_BACKGROUND
Specifies the current step background color.
-
DEFAULT_LABEL_COLOR
public static final Color DEFAULT_LABEL_COLOR
Specifies the default label color.
-
FIELD_VALID_COLOR
public static final Color FIELD_VALID_COLOR
Specifies the valid field color.
-
FIELD_INVALID_COLOR
public static final Color FIELD_INVALID_COLOR
Specifies the invalid field color.
-
READ_ONLY_COLOR
public static final Color READ_ONLY_COLOR
Specifies the read only text color.
-
CHECKBOX_COLOR
public static final Color CHECKBOX_COLOR
Specifies the check box text color.
-
PROGRESS_COLOR
public static final Color PROGRESS_COLOR
Specifies the progress text color.
-
INSTRUCTIONS_COLOR
public static final Color INSTRUCTIONS_COLOR
Specifies the instructions text color.
-
TEXTFIELD_COLOR
public static final Color TEXTFIELD_COLOR
Specifies the text field text color.
-
PASSWORDFIELD_COLOR
public static final Color PASSWORDFIELD_COLOR
Specifies the password field text color.
-
INLINE_HELP_COLOR
public static final Color INLINE_HELP_COLOR
Specifies the in-line help text color.
-
PANEL_BORDER_COLOR
public static final Color PANEL_BORDER_COLOR
Specifies the panel border color.
-
CURRENT_STEP_PANEL_BORDER
public static final Border CURRENT_STEP_PANEL_BORDER
Specifies the current step panel border.
-
TEXT_AREA_BORDER
public static final Border TEXT_AREA_BORDER
Specifies the text area border.
-
DIALOG_PANEL_BORDER
public static final Border DIALOG_PANEL_BORDER
Specifies the dialog border.
-
NOT_CURRENT_STEP_FONT
public static final Font NOT_CURRENT_STEP_FONT
Specifies the font for the step which is not the current one in the steps panel.
-
CURRENT_STEP_FONT
public static final Font CURRENT_STEP_FONT
Specifies the font for the step which is the current one in the steps panel.
-
TITLE_FONT
public static final Font TITLE_FONT
Specifies the font for the title of the current panel.
-
INSTRUCTIONS_FONT
public static final Font INSTRUCTIONS_FONT
Specifies the font for the instructions of the current panel.
-
INSTRUCTIONS_MONOSPACE_FONT
public static final Font INSTRUCTIONS_MONOSPACE_FONT
Specifies the font for the instructions of the current panel.
-
PRIMARY_FIELD_VALID_FONT
public static final Font PRIMARY_FIELD_VALID_FONT
Specifies the font for the primary valid field.
-
SECONDARY_FIELD_VALID_FONT
public static final Font SECONDARY_FIELD_VALID_FONT
Specifies the font for the secondary valid field.
-
PRIMARY_FIELD_INVALID_FONT
public static final Font PRIMARY_FIELD_INVALID_FONT
Specifies the font for the primary invalid field.
-
SECONDARY_FIELD_INVALID_FONT
public static final Font SECONDARY_FIELD_INVALID_FONT
Specifies the font for the secondary invalid field.
-
SECONDARY_STATUS_FONT
public static final Font SECONDARY_STATUS_FONT
Specifies the font for the secondary status field.
-
READ_ONLY_FONT
public static final Font READ_ONLY_FONT
Specifies the font for read only text.
-
CHECKBOX_FONT
public static final Font CHECKBOX_FONT
Specifies the font for the check box text.
-
PROGRESS_FONT
public static final Font PROGRESS_FONT
Specifies the font for the progress text.
-
TEXTFIELD_FONT
public static final Font TEXTFIELD_FONT
Specifies the font for the text field text.
-
PASSWORD_FIELD_FONT
public static final Font PASSWORD_FIELD_FONT
Specifies the font for the password field text.
-
PROGRESS_POINTS_FONT
public static final Font PROGRESS_POINTS_FONT
Specifies the font for the points '....' in the progress panel.
-
PROGRESS_DONE_FONT
public static final Font PROGRESS_DONE_FONT
Specifies the font for the done text 'Done' in the progress panel.
-
PROGRESS_LOG_FONT
public static final Font PROGRESS_LOG_FONT
Specifies the font for the log messages in the progress panel.
-
PROGRESS_LOG_ERROR_FONT
public static final Font PROGRESS_LOG_ERROR_FONT
Specifies the font for the error log messages in the progress panel.
-
PROGRESS_ERROR_FONT
public static final Font PROGRESS_ERROR_FONT
Specifies the font for the error messages in the progress panel.
-
PROGRESS_WARNING_FONT
public static final Font PROGRESS_WARNING_FONT
Specifies the font for the warning messages in the progress panel.
-
STACK_FONT
public static final Font STACK_FONT
Specifies the font for the stack trace in the progress panel.
-
ERROR_DIALOG_FONT
public static final Font ERROR_DIALOG_FONT
Specifies the font for the text in the WebBrowserErrorDialog.
-
INLINE_HELP_FONT
public static final Font INLINE_HELP_FONT
Specifies the font for the text in the in-line help.
-
HTML_SEPARATOR
public static final String HTML_SEPARATOR
An HTML separator text that can be used in the progress panel.
-
-
Method Detail
-
initializeLookAndFeel
public static void initializeLookAndFeel() throws ThrowableThis method initialize the look and feel.- Throws:
Throwable- if there is a problem initializing the look and feel.
-
initialize
public static void initialize() throws ThrowableThis method initialize the look and feel and UI settings specific to quick setup.- Throws:
Throwable- if there is a problem initializing the look and feel.
-
makeJPanel
public static JPanel makeJPanel()
Creates a new JPanel.- Returns:
- JPanel newly created
-
makeJButton
public static JButton makeJButton(org.forgerock.i18n.LocalizableMessage label, org.forgerock.i18n.LocalizableMessage tooltip)
Creates a JButton with the given label and tooltip.- Parameters:
label- the text of the button.tooltip- the tooltip of the button.- Returns:
- a JButton with the given label and tooltip.
-
makeJLabel
public static JLabel makeJLabel(LabelFieldDescriptor desc)
Commodity method that returns a JLabel based on a LabelFieldDescriptor.- Parameters:
desc- the LabelFieldDescriptor describing the JLabel.- Returns:
- a JLabel based on a LabelFieldDescriptor.
-
makeJLabel
public static JLabel makeJLabel(UIFactory.IconType iconName, org.forgerock.i18n.LocalizableMessage text, UIFactory.TextStyle style)
Creates a JLabel with the given icon, text and text style.- Parameters:
iconName- the icon.text- the label text.style- the text style.- Returns:
- a JLabel with the given icon, text and text style.
-
makeJTextComponent
public static JTextComponent makeJTextComponent(LabelFieldDescriptor desc, String defaultValue)
Commodity method that returns a JTextComponent based on a LabelFieldDescriptor.- Parameters:
desc- the LabelFieldDescriptor describing the JTextField.defaultValue- the default value used to initialize the JTextComponent.- Returns:
- a JTextComponent based on a LabelFieldDescriptor.
-
makeJTextField
public static JTextField makeJTextField(org.forgerock.i18n.LocalizableMessage text, org.forgerock.i18n.LocalizableMessage tooltip, int size, UIFactory.TextStyle style)
Creates a JTextField with the given icon, tooltip text, size and text style.- Parameters:
text- the text.tooltip- the tooltip text.size- the number of columns of the JTextField.style- the text style.- Returns:
- a JTextField with the given icon, tooltip text, size and text style.
-
makeJPasswordField
public static JPasswordField makeJPasswordField(org.forgerock.i18n.LocalizableMessage text, org.forgerock.i18n.LocalizableMessage tooltip, int size, UIFactory.TextStyle style)
Creates a JPasswordField with the given icon, tooltip text, size and text style.- Parameters:
text- the text.tooltip- the tooltip text.size- the number of columns of the JPasswordField.style- the text style.- Returns:
- a JPasswordField with the given icon, tooltip text, size and text style.
-
makeJRadioButton
public static JRadioButton makeJRadioButton(org.forgerock.i18n.LocalizableMessage text, org.forgerock.i18n.LocalizableMessage tooltip, UIFactory.TextStyle style)
Creates a JRadioButton with the given text, tooltip text and text style.- Parameters:
text- the text of the radio button.tooltip- the tooltip text.style- the text style.- Returns:
- a JRadioButton with the given text, tooltip text and text style.
-
makeJCheckBox
public static JCheckBox makeJCheckBox(org.forgerock.i18n.LocalizableMessage text, org.forgerock.i18n.LocalizableMessage tooltip, UIFactory.TextStyle style)
Creates a JCheckBox with the given text, tooltip text and text style.- Parameters:
text- the text of the radio button.tooltip- the tooltip text.style- the text style.- Returns:
- a JCheckBox with the given text, tooltip text and text style.
-
makeJList
public static <T> JList<T> makeJList(UIFactory.TextStyle textStyle)
Creates a JList.- Type Parameters:
T- The type of the JList elements- Parameters:
textStyle- the style to be used for the renderer.- Returns:
- a JList.
-
setTextStyle
public static void setTextStyle(JComponent l, UIFactory.TextStyle style)
Sets the specified text style to the component passed as parameter.- Parameters:
l- the component to update.style- the text style to use.
-
getIconHtml
public static String getIconHtml(UIFactory.IconType iconType)
Returns the HTML string representing the provided IconType.- Parameters:
iconType- the IconType for which we want the HTML representation.- Returns:
- the HTML string representing the provided IconType.
-
getImageIcon
public static ImageIcon getImageIcon(UIFactory.IconType iconType)
Returns an ImageIcon object for the provided IconType.- Parameters:
iconType- the IconType for which we want to obtain the ImageIcon.- Returns:
- the ImageIcon.
-
makeProgressPane
public static JEditorPane makeProgressPane(JScrollPane scroll)
Returns a JEditorPane that works with the provided scroll.- Parameters:
scroll- the scroll that will contain the JEditorPane.- Returns:
- a JEditorPane that works with the provided scroll.
- See Also:
ProgressJEditorPane
-
makeHtmlPane
public static JEditorPane makeHtmlPane(org.forgerock.i18n.LocalizableMessage text, Font font)
Returns a read only JEditorPane containing the provided text with the provided font. The JEditorPane will assume that the text is HTML text.- Parameters:
text- the text to be used to initialize the JEditorPane contents.font- the font to be used.- Returns:
- a read only JEditorPane containing the provided text with the provided font.
-
makeTextPane
public static JEditorPane makeTextPane(org.forgerock.i18n.LocalizableMessage text, UIFactory.TextStyle style)
Returns a read only JEditorPane containing the provided text with the provided TextStyle. The JEditorPane will assume that the text is plain text.- Parameters:
text- the text to be used to initialize the JEditorPane contents.style- the TextStyle to be used.- Returns:
- a read only JEditorPane containing the provided text with the provided TextStyle.
-
createBorderLessScrollBar
public static JScrollPane createBorderLessScrollBar(Component comp)
Returns a JScrollPane that contains the provided component. The scroll pane will not contain any border.- Parameters:
comp- the component contained in the scroll pane.- Returns:
- a JScrollPane that contains the provided component. The scroll pane will not contain any border.
-
setScrollIncrementUnit
public static void setScrollIncrementUnit(JScrollPane scroll)
Sets the scroll increment unit for the scroll.- Parameters:
scroll- the scroll to be updated.
-
getEmptyInsets
public static Insets getEmptyInsets()
Return empty insets.- Returns:
- empty insets.
-
getButtonsPanelInsets
public static Insets getButtonsPanelInsets()
Returns the insets to be used for the button panel.- Returns:
- the insets to be used for the button panel.
-
getStepsPanelInsets
public static Insets getStepsPanelInsets()
Returns the insets to be used for the steps panel.- Returns:
- the insets to be used for the steps panel.
-
getCurrentStepPanelInsets
public static Insets getCurrentStepPanelInsets()
Returns the insets to be used for the current step panel.- Returns:
- the insets to be used for the current step panel.
-
applyFontToHtml
public static String applyFontToHtml(String html, Font font)
Returns a String that contains the html passed as parameter with a span applied. The span style corresponds to the Font specified as parameter. The goal of this method is to be able to specify a font for an HTML string.- Parameters:
html- the original html text.font- the font to be used to generate the new HTML.- Returns:
- a string that represents the original HTML with the font specified as parameter.
-
applyErrorBackgroundToHtml
public static String applyErrorBackgroundToHtml(String html)
Returns the html text passed as parameter with the error background applied to it.- Parameters:
html- the original html.- Returns:
- the html text passed as parameter with the error background applied to it.
-
applyWarningBackgroundToHtml
public static String applyWarningBackgroundToHtml(String html)
Returns the html text passed as parameter with the warning background applied to it.- Parameters:
html- the original html.- Returns:
- the html text passed as parameter with the warning background applied to it.
-
applySuccessfulBackgroundToHtml
public static String applySuccessfulBackgroundToHtml(String html)
Returns the html text passed as parameter with the success background applied to it.- Parameters:
html- the original html.- Returns:
- the html text passed as parameter with the success background applied to it.
-
applyMargin
public static String applyMargin(String html, int top, int right, int bottom, int left)
Returns the html text passed as parameter with some added margin.- Parameters:
html- the original html text.top- the top margin.right- the right margin.bottom- the bottom margin.left- the left margin.- Returns:
- the html text passed as parameter with some added margin.
-
-