Class UIFactory

java.lang.Object
com.sun.javatest.tool.UIFactory
Direct Known Subclasses:
UIFactory.UIFactoryExt

public class UIFactory extends Object
A factory for GUI components, providing support for internationalization, tool tips, context sensitive help, and on. UIFactory objects use a resource bundle specific to the client class to provide the internationalization support.
  • Field Details

  • Constructor Details

    • UIFactory

      public UIFactory(Class<?> c, com.sun.javatest.tool.jthelp.HelpBroker helpBroker)
      Create a UIFactory object for a specific class. The class is used to determine the resource bundle for i18n strings; the bundle is named i18n.properties in the same package as the specified class.
      Parameters:
      c - the class used to determine the i18n properties
      helpBroker - the help broker to be used when creating help buttons
    • UIFactory

      public UIFactory(Component c, com.sun.javatest.tool.jthelp.HelpBroker helpBroker)
      Create a UIFactory object for a specific component. The component's class is used to determine the resource bundle for i18n strings; the bundle is named i18n.properties in the same package as the specified class.
      Parameters:
      c - the component used to determine the i18n properties
      helpBroker - the help broker to be used when creating help buttons
    • UIFactory

      public UIFactory(Class<?> c, Component p, com.sun.javatest.tool.jthelp.HelpBroker helpBroker)
      Create a UIFactory object for a specific class. The class is used to determine the resource bundle for i18n strings; the bundle is named i18n.properties in the same package as the specified class.
      Parameters:
      c - the class used to determine the i18n properties
      p - the parent component to be used for any dialogs that are created
      helpBroker - the help broker to be used when creating help buttons
  • Method Details

    • getBaseFont

      public static Font getBaseFont()
    • getInvalidInputColor

      public static Color getInvalidInputColor()
      Get invalid input color (red by default)
      Returns:
      Color of invalid input
    • setInvalidInputColor

      public static void setInvalidInputColor(Color newColor)
      Set invalid input color
      Parameters:
      newColor - new invalid input color
    • getValidInputColor

      public static Color getValidInputColor()
      Get valid input color (green by default)
      Returns:
      Color of valid input
    • setValidInputColor

      public static void setValidInputColor(Color newColor)
      Set valid input color
      Parameters:
      newColor - new valid input color
    • getDefaultInputColor

      public static Color getDefaultInputColor()
      Get default input color (while by default)
      Returns:
      Color of default input
    • setDefaultInputColor

      public static void setDefaultInputColor(Color newColor)
      Set default input color
      Parameters:
      newColor - new default input color
    • setColorByName

      public static void setColorByName(String name, Color c)
      Set Color by preferences name
      Parameters:
      name - Color's preferences name
      c - new Color to set
    • setDefaultColors

      public static void setDefaultColors()
      Set all colors to default values
    • addColorChangeObserver

      public static void addColorChangeObserver(Preferences.Observer observer)
      Add Preferences observer to color changes
      Parameters:
      observer -
    • createColorChooseButton

      public JButton createColorChooseButton(String cs, JLabel label, ActionListener l)
      Creates a color-choosing button with background color set by preferences color name
      Parameters:
      cs - preferences color name. Used to set background color and is set as JButton.name
      label - JLabel for button
      l - ActionListener for button
      Returns:
      color-choosing button
    • setDialogParent

      public void setDialogParent(Component p)
      Set the parent component to be used for dialogs created by this factory. This setting cannot be changed after it is set.
      Parameters:
      p - The parent component, should not be null.
    • getDotsPerInch

      public int getDotsPerInch()
      Get the screen resolution, in dots per inch, as provided by the default AWT toolkit.
      Returns:
      the screen resolution, in dots per inch
    • getHelpBroker

      public com.sun.javatest.tool.jthelp.HelpBroker getHelpBroker()
      Get the help broker associated with this factory.
      Returns:
      the help broker associated with this factory
    • getI18NResourceBundle

      public I18NResourceBundle getI18NResourceBundle()
      Get the resource bundle used to obtain the resources for the components create by this factory.
      Returns:
      the resource bundle used to obtain the resources for the components create by this factory
    • getI18NMnemonic

      public int getI18NMnemonic(String key)
      Get a keycode from the resource bundle.
      Parameters:
      key - the name of the resource to be returned
      Returns:
      the first character of the string that was found
    • getI18NColor

      public Color getI18NColor(String key)
      Get a color from the resource bundle.
      Parameters:
      key - the base name of the resource to be returned
      Returns:
      the color identified in the resource
    • getI18NString

      public String getI18NString(String key)
      Get a string from the resource bundle.
      Parameters:
      key - the name of the resource to be returned
      Returns:
      the string that was found
    • getI18NString

      public String getI18NString(String key, Object arg)
      Get a string from the resource bundle.
      Parameters:
      key - the name of the resource to be returned
      arg - an argument to be formatted into the result using MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)
      Returns:
      the formatted string
    • getI18NString

      public String getI18NString(String key, Object... args)
      Get a string from the resource bundle.
      Parameters:
      key - the name of the resource to be returned
      args - an array of arguments to be formatted into the result using MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)
      Returns:
      the formatted string
    • setHelp

      public void setHelp(Component comp, String helpID)
      Set the help ID for the context-sensitive help for a component.
      Parameters:
      comp - the component for which to set the help ID
      helpID - the help ID identifying the context sensitive help for the component
    • setToolTip

      public void setToolTip(JComponent c, String uiKey)
      Set a tool tip for a component from a resource in the factory's resource bundle.
      By convention, tool tip resources end in ".tip". Most components created by this factory will already have a tool tip set, so this method need not be called for them.
      Also, the component's accessible description text will automatically be set to the supplied tooltip text.
      The resources used are:
      uiKey.tip the tool tip for the component
      Parameters:
      c - the component for which to set the tool tip
      uiKey - the base name of the resource to be used
    • setAccessibleDescription

      public void setAccessibleDescription(Component c, String uiKey)
      Sets only the accessible description for the given context, using the given key.
      uiKey.desc accessible description
      Parameters:
      c - the component to modify
      uiKey - the base name of the resource to be used
      See Also:
    • setAccessibleDescription

      public void setAccessibleDescription(AccessibleContext c, String uiKey)
      Sets only the accessible description for the given context, using the given key.
      uiKey.desc accessible description
      Parameters:
      c - the context object to modify
      uiKey - the base name of the resource to be used
    • setAccessibleName

      public void setAccessibleName(Component c, String uiKey)
      Sets only the accessible name for the given context, using the given key.
      Parameters:
      c - the component object to modify
      uiKey - the base name of the resource to be used
      See Also:
    • setAccessibleName

      public void setAccessibleName(AccessibleContext c, String uiKey)
      Sets only the accessible name for the given context, using the given key.
      uiKey.name accessible name
      Parameters:
      c - the context object to modify
      uiKey - the base name of the resource to be used
    • setAccessibleInfo

      public void setAccessibleInfo(Component c, String uiKey)
      Sets the accessible name and description for the given component.
      Parameters:
      c - the component object to modify
      uiKey - the base name of the resource to be used
      See Also:
    • setAccessibleInfo

      public void setAccessibleInfo(AccessibleContext c, String uiKey)
      Sets the accessibility name and description for the given context using the given key as the base. The resources used are:
      uiKey.name accessible name
      uiKey.desc accessible description text
      Parameters:
      c - the context object to modify
      uiKey - the base name of the resource to be used
    • createTitledBorder

      public Border createTitledBorder(String uiKey)
      Create a titled border, using a resource to specify the title.
      The resource used is:
      uiKey.bdr the text for the title
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      the border that was created
    • createHorizontalGlue

      public Component createHorizontalGlue(String uiKey)
      Create a horizontal filler that expands to fill the available space. The name of the glue component will be set to uikey. No resource strings are required at this time.
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      a filler component that expands to fill the available space
    • createGlue

      public Component createGlue(String uiKey)
      Create a filler that expands to fill the available space.
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      a filler component that expands to fill the available space
    • createHorizontalStrut

      public Component createHorizontalStrut(int width)
      Create a horizontal filler of a given width.
      Parameters:
      width - the desired width of the filler component
      Returns:
      a filler component of a given width
    • createButton

      public JButton createButton(String uiKey)
      Create a button, using resources to specify the name and the tool tip.
      The resources used are:
      uiKey.btn the name for the button
      uiKey.tip the tool tip for the button
      In addition, the name of the button and the action command for the button is set to uiKey.
      Parameters:
      uiKey - the base name of the resources to be used
      Returns:
      the button that was created
      See Also:
    • createButton

      public JButton createButton(Action a)
      Create a button based on the information in an Action.
      Parameters:
      a - the Action for which to define the button
      Returns:
      the button that was created
    • createButton

      public JButton createButton(String uiKey, Icon icon)
      Create a button containing an Icon.
      Parameters:
      uiKey - the base name of the resource to be used
      icon - the icon to appear in the button
      Returns:
      the button that was created
    • createButton

      public JButton createButton(String uiKey, ActionListener l)
      Create a button, using resources to specify the name and the tool tip, and with a specified ActionListener.
      The resources used are:
      uiKey.btn the name for the button
      uiKey.tip the tool tip for the button
      In addition, the name of the button and the action command for the button is set to uiKey.
      Parameters:
      uiKey - the base name of the resources to be used
      l - the ActionListener to be add to the button
      Returns:
      the button that was created
    • createButton

      public JButton createButton(String uiKey, ActionListener l, String cmd)
      Create a button, using resources to specify the name and the tool tip, and with a specified ActionListener and action command.
      The resources used are:
      uiKey.btn the name for the button
      uiKey.tip the tool tip for the button
      In addition, the name of the button is set to uiKey.
      Parameters:
      uiKey - the base name of the resources to be used
      l - the ActionListener to be add to the button
      cmd - the action command to be set for the button
      Returns:
      the button that was created
    • createCancelButton

      public JButton createCancelButton(String uiKey)
      Special method to create a cancel button. Differs from a standard button because it does not require a mnemonic, per the Java Look and Feel standard.
      Parameters:
      uiKey - key to use to get the tooltip with
      Returns:
      the button that was created
    • createCancelButton

      public JButton createCancelButton(String uiKey, ActionListener l)
      Special method to create a cancel button. Differs from a standard button because it does not require a mnemonic, per the Java Look and Feel standard.
      Parameters:
      uiKey - key to use to get the tooltip with
      l - listener to attach to the created button
      Returns:
      the button that was created
    • createCloseButton

      public JButton createCloseButton(String uiKey)
      Create a Close button, that will close the containing window when pressed, using a resource to specify the information for the button.
      The resources used are:
      uiKey.btn the name for the button
      uiKey.mne the mnemonic for the button
      uiKey.tip the tool tip for the button
      In addition, the name of the button is set to uiKey.
      Parameters:
      uiKey - the base name of the resources to be used
      Returns:
      the button that was created
      See Also:
    • createCloseButton

      public JButton createCloseButton(String uiKey, boolean needMnemonic)
      Create a Close button, that will close the containing window when pressed, using a resource to specify the information for the button.
      The resources used are:
      uiKey.btn the name for the button
      uiKey.mne the mnemonic for the button, if required
      uiKey.tip the tool tip for the button
      In addition, the name of the button is set to uiKey.
      Parameters:
      uiKey - the base name of the resources to be used
      needMnemonic - a boolean indicating whether or not a mnemonic should be set on the button. If the button is going to be the default button for a dialog, it does not need a mnemonic.
      Returns:
      the button that was created
      See Also:
    • createHelpButton

      public JButton createHelpButton(String uiKey, String helpID)
      Create a Help button, that will display a specific help topic when pressed, using a resource to specify the tool tip for the button.
      The resource used is:
      uiKey.tip the tool tip for the button
      In addition, the name of the button is set to uiKey.
      Parameters:
      uiKey - the base name of the resources to be used
      helpID - the help ID for the help topic to be displayed when the button is pressed
      Returns:
      the button that was created
      See Also:
    • createIconButton

      public JButton createIconButton(String uiKey)
      Create a button containing an icon, using resources to specify the icon image and the tool tip.
      The resources used are:
      uiKey.icon the name of the resource for the icon image
      uiKey.tip the tool tip for the button
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      the button that was created
    • createIconButton

      public JButton createIconButton(String uiKey, ActionListener l)
      Create a button containing an icon, using resources to specify the icon image and the tool tip.
      The resources used are:
      uiKey.icon the name of the resource for the icon image
      uiKey.tip the tool tip for the button
      Parameters:
      uiKey - the base name of the resource to be used
      l - the action listener to attach to the new button
      Returns:
      the button that was created
    • createRadioButton

      public JRadioButton createRadioButton(String uiKey, ButtonGroup group)
      Create a radio button, using resources to specify the name and tool tip.
      The button is initially set to false. The resources used are:
      uiKey.rb the label for the button
      uiKey.tip the tool tip for the button
      uiKey.mne the mnemonic for the button
      In addition, the name of the button is set to uiKey.
      Parameters:
      uiKey - the base name of the resources to be used
      group - the group to which the check box will be added
      Returns:
      the radio button that was created
      See Also:
    • setMnemonic

      public void setMnemonic(AbstractButton b, String uiKey)
      Set the mnemonic a button. The resources used are:
      uiKey.mne The keystroke to use
      Parameters:
      b - the button to modify
      uiKey - the base name of the resources to be used
      See Also:
    • createCheckBox

      public JCheckBox createCheckBox(String uiKey)
      Create a check box, using resources to specify the name and the tool tip.
      The resources used are:
      uiKey.ckb the name for the check box
      uiKey.tip the tool tip for the button
      uiKey.mne the mnemonic for the button
      In addition, the name of the check box is set to uiKey.
      Parameters:
      uiKey - the base name of the resources to be used
      Returns:
      the check box that was created
      See Also:
    • createCheckBox

      public JCheckBox createCheckBox(String uiKey, boolean state)
      Create a check box, using resources to specify the name and the tool tip.
      The resources used are:
      uiKey.ckb the name for the check box
      uiKey.tip the tool tip for the button
      uiKey.mne the mnemonic for the button
      In addition, the name of the check box is set to uiKey.
      Parameters:
      uiKey - the base name of the resources to be used
      state - the initial state of the check box
      Returns:
      the check box that was created
      See Also:
    • createCheckBox

      public JCheckBox createCheckBox(String uiKey, boolean state, ButtonGroup group)
      Create a check box, using resources to specify the name and the tool tip, within a specified button group.
      The resources used are:
      uiKey.ckb the name for the check box
      uiKey.tip the tool tip for the button
      uiKey.mne the mnemonic for the button
      In addition, the name of the check box is set to uiKey.
      Parameters:
      uiKey - the base name of the resources to be used
      state - the initial state of the check box
      group - the group to which the check box will be added
      Returns:
      the check box that was created
    • createChoice

      public JComboBox<String> createChoice(String uiKey, String... choiceKeys)
      Create a choice item, using resources to specify the choices and the tool tip.
      The resources used are:
      uiKey.choiceKeysi.chc the choice to appear in the item, for 0 <= i < choiceKeys.length
      uiKey.name the accessible name for the selector
      uiKey.tip the tool tip for the choice item
      In addition, the name of the choice is set to uiKey. Note: the choice item is created with the choices set to the names of the resources used -- not the values. This means that the client can examine and manipulate the choices, including the selected choice, as location-independent resource names. A custom renderer is used to ensure that the correctly localized value is displayed to the user.
      Parameters:
      uiKey - the base name of the resources to be used for the menu
      choiceKeys - an array of strings used to construct the resource names for the choices.
      Returns:
      the choice item that was created
      See Also:
    • createChoice

      public JComboBox<String> createChoice(String uiKey, String[] choiceKeys, boolean editable)
      Same as the two parameter createChoice, except you can make this an mutable choice component (freeform editing of the response). If the component is to be editable, an additional uiKey.ed resource is needed to set the component name of the editable field which will be onscreen.
      Parameters:
      uiKey - the base name of the resources to be used for the menu
      choiceKeys - an array of strings used to construct the resource names for the choices.
      editable - True if the choice component should allow freeform editing of the response.
      Returns:
      a choice box with the attributes indicated by the parameters
      See Also:
    • createChoice

      public <E> JComboBox<E> createChoice(String uiKey)
      Create an empty choice item, using a resource to specify the tool tip.
      The resource used is:
      uiKey.tip the tool tip for the choice item
      In addition, the name of the choice is set to uiKey.
      Parameters:
      uiKey - the base name of the resources to be used for the menu
      Returns:
      the choice component that was created
    • createChoice

      public <E> JComboBox<E> createChoice(String uiKey, boolean editable)
      Same as single parameter version, except you can select a component that allows freeform editing of the user's response.
      Parameters:
      uiKey - the base name of the resources to be used for the menu
      editable - True if the user should be allowed to edit the response.
      Returns:
      the choice component that was created
      See Also:
    • createChoice

      public <E> JComboBox<E> createChoice(String uiKey, JLabel label)
      Same as the one parameter version, except a label can be associated with this component. This is to support accessibility.
      Parameters:
      uiKey - the base name of the resources to be used for the menu
      label - Label to associate with this component
      Returns:
      the choice component that was created
      See Also:
    • createChoice

      public <E> JComboBox<E> createChoice(String uiKey, boolean editable, JLabel label)
      Combination of the two parameter methods, allowing you to select a mutable response and associate a label.
      Parameters:
      uiKey - the base name of the resources to be used for the menu
      editable - True if the user should be allowed to edit the response.
      label - Label to associate with this component
      Returns:
      a choice box with the attributes indicated by the parameters
      See Also:
    • createLiteralChoice

      public <E> JComboBox<E> createLiteralChoice(String uiKey, E... choices)
      Create an choice item containing literal choices, and using a resource to specify the tool tip. The choices appear as given: for example, this method might be used to create a choice item containing a set of filenames from which to choose.
      Note that if the choices are strings, they should probably be localized, and if they are otherwise should probably be shown to the user using a renderer which produces localized output. The resource used is:
      uiKey.tip the tool tip for the choice item
      In addition, the name of the choice is set to uiKey.
      Parameters:
      uiKey - the base name of the resources to be used for the menu
      choices - the choices to appear in the choice item
      Returns:
      the choice item that was created
      See Also:
    • createIcon

      public Icon createIcon(String uiKey)
      Create an icon, using a resource to specify the image.
      The resource used is:
      uiKey.icon the name of a resource containing the image
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      the icon that was created
      Throws:
      MissingResourceException - if the image resource cannot be found
      See Also:
    • getIconURL

      public URL getIconURL(String uiKey)
      Get the resource URL for an icon specified in a resource bundle.
      The resource used is:
      uiKey.icon the name of a resource containing the image
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      the URL for the resource obtained from the resource bundle
      Throws:
      MissingResourceException - if the image resource cannot be found
    • createIconLabel

      public JLabel createIconLabel(String uiKey)
      Create a label containing an icon, using a resource to specify the icon image.
      The resource used is:
      uiKey.icon the name of the resource for the icon image
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      the image that was created
      Throws:
      MissingResourceException - if the image resource cannot be found
      See Also:
    • createImage

      public Image createImage(String r)
      Create an image from a named resource.
      Parameters:
      r - The resource containing the image data.
      Returns:
      the image that was created
      Throws:
      MissingResourceException - if the image resource cannot be found
    • createLabel

      public JLabel createLabel(String uiKey)
      Create a label, using a resource to specify the text.
      The resource used is:
      uiKey.lbl the text for the label
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      the label that was created
      See Also:
    • createLabel

      public JLabel createLabel(String uiKey, boolean need508)
      Create a label, using a resource to specify the text and an optional mnemonic.
      The resource used is:
      uiKey.lbl the text for the label
      uiKey.tip the tooltip text for the label
      uiKey.mne the mnemonic for the label
      Parameters:
      uiKey - the base name of the resource to be used
      need508 - whether or not a mnemonic and tooltip should be set for this label
      Returns:
      the label that was created
      See Also:
    • createList

      public <E> JList<E> createList(String uiKey)
      Create an input text field, using a resource to specify the tool tip.
      The resource used is:
      uiKey.tip the tool tip for the field

      /** Create an empty list component.
      Note: list components do not currently support tool tips. When they do, this method will use a resource to specify the tool tip. The resources used are:

      uiKey.name the accessible name of the list
      uiKey.desc the accessible description of the list
      Parameters:
      uiKey - the base name of the resource to be used (currently ignored)
      Returns:
      the list that was created
    • createList

      public <E> JList<E> createList(String uiKey, ListModel<E> model)
      Create a list component with a given data model.
      Note: list components do not currently support tool tips. When they do, this method will use a resource to specify the tool tip. The resources used are:
      uiKey.name the accessible name of the list
      uiKey.desc the accessible description of the list
      Parameters:
      uiKey - the base name of the resource to be used (currently ignored)
      model - the data model for this list
      Returns:
      the list that was created
    • createMenuBar

      public JMenuBar createMenuBar(String uiKey)
      Create an empty menu bar, using resources to specify the accessible info.
      The resources used are:
      uiKey.name the accessible name text
      uiKey.desc accessible description text
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      the menu bar that was created
    • createMenu

      public JMenu createMenu(String uiKey)
      Create an empty menu, using resources to specify the name and mnemonic.
      The resources used are:
      uiKey.menu the display name of the menu
      uiKey.mne the single character mnemonic for the menu
      uiKey.desc accessible description text
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      the menu that was created
      See Also:
    • initMenu

      public void initMenu(JMenu m, String uiKey)
      Initialize an empty menu, using resources to specify the name and mnemonic.
      The resources used are:
      uiKey.menu the display name of the menu
      uiKey.mne the single character mnemonic for the menu
      uiKey.desc accessible description text
      Parameters:
      m - the menu the be initialized
      uiKey - the base name of the resource to be used
      See Also:
    • createMenu

      public JMenu createMenu(String uiKey, Action... actions)
      Create a menu, using actions to specify the menu items, and using resources to specify the name and mnemonic.
      The resources used are:
      uiKey.menu the display name of the menu
      uiKey.mne the single character mnemonic for the menu
      Parameters:
      uiKey - the base name of the resources to be used
      actions - the actions from which to create the menu items; use null in the array to indicate if and where a separator is required
      Returns:
      the menu that was created
      See Also:
    • createMenu

      public JMenu createMenu(String uiKey, String[] actions, ActionListener l)
      Create a menu using resources and an action listener to specify the menu items, and using resources to specify the name and mnemonic.
      The resources used are:
      uiKey.menu the display name of the menu
      uiKey.mne the single character mnemonic for the menu
      uiKey.actionsi.mit the text for the menu item, for 0 <= i < choiceKeys.length
      uiKey.actionsi.mne the single character mnemonic for the menu item, for 0 <= i < choiceKeys.length
      Parameters:
      uiKey - the base name of the resources to be used
      actions - the qualifying names for the resources for the individual menu items; use null in the array to indicate if and where a separator is required
      l - the action listener to be used for each menu item
      Returns:
      the menu that was created
      See Also:
    • initMenu

      public void initMenu(JMenu m, String uiKey, String[] actions, ActionListener l)
      Initialize a menu using resources and an action listener to specify the menu items, and using resources to specify the name and mnemonic.
      The resources used are:
      uiKey.menu the display name of the menu
      uiKey.mne the single character mnemonic for the menu
      uiKey.actionsi.mit the text for the menu item, for 0 <= i < choiceKeys.length
      uiKey.actionsi.mne the single character mnemonic for the menu item, for 0 <= i < choiceKeys.length
      Parameters:
      m - the menu the be initialized
      uiKey - the base name of the resources to be used
      actions - the qualifying names for the resources for the individual menu items; use null in the array to indicate if and where a separator is required
      l - the action listener to be used for each menu item
      See Also:
    • createPopupMenu

      public JPopupMenu createPopupMenu(String uiKey)
      Create an empty popup menu.
      Parameters:
      uiKey - the base name of the resource to be used (currently ignored)
      Returns:
      the popup menu that was created
      See Also:
    • createPopupMenu

      public JPopupMenu createPopupMenu(String uiKey, String[] actions, ActionListener l)
      Create an popup menu.
      Parameters:
      uiKey - the base name of the resource to be used
      actions - the qualifying names for the resources for the individual menu items; use null in the array to indicate if and where a separator is required
      l - the action listener to be used for each menu item
      Returns:
      the popup menu that was created
      See Also:
    • createMenuItem

      public JMenuItem createMenuItem(Action action)
      Create a menu item for an action. The name of the item is set to the action name.
      Parameters:
      action - from which to create the menu item
      Returns:
      the menu item that was created
      See Also:
    • createMenuItem

      public JMenuItem createMenuItem(String uiKey, String action, ActionListener l)
      Create a menu item, using resources to specify the text and mnemonic.
      The resources used are:
      uiKey.action.mit the text for the menu item
      uiKey.action.mne the single character mnemonic for the menu item
      Parameters:
      uiKey - the base name of the resources to be used
      action - the qualifying name for the resources for the menu item
      l - the action listener for the menu item
      Returns:
      the menu item that was created
      See Also:
    • createCheckBoxMenuItem

      public JCheckBoxMenuItem createCheckBoxMenuItem(String uiKey, String name, boolean state)
      Create a check box menu item, using resources to specify the name and the tool tip.
      The resources used are:
      uiKey.name.ckb the name for the menu item
      uiKey.name.tip the tool tip for the menu item
      In addition, the name of the check box is set to uiKey.
      Parameters:
      uiKey - the base name of the resources to be used
      name - a qualifying name for the resources used for this menu item
      state - the initial state of the check box
      Returns:
      the check box that was created
    • createHelpMenuItem

      public JMenuItem createHelpMenuItem(String uiKey, String helpID)
      Create a Help menu item, that will display a specific help topic when pressed, using resources to specify the name and mnemonic for the item.
      The resource used is:
      uiKey.mit the text for the menu item
      uiKey.mne the mnemonic for the menu item
      In addition, the name of the choice is set to uiKey.
      Parameters:
      uiKey - the base name of the resources to be used
      helpID - the help ID for the help topic to be displayed when the button is pressed
      Returns:
      the button that was created
      See Also:
    • createLiteralMenuItem

      public JMenuItem createLiteralMenuItem(String literal, ActionListener l)
      Create a menu item for a literal string and a specified listener. No mnemonic key nor descriptive action is added.
      Parameters:
      literal - the text for the menu item
      l - the action listener to add to the menu item
      Returns:
      the menu item that was created
    • createRadioButtonMenuItem

      public JRadioButtonMenuItem createRadioButtonMenuItem(String uiKey, String name)
      Create a check box menu item, using resources to specify the name and the tool tip.
      The resources used are:
      uiKey.name.ckb the name for the menu item
      uiKey.name.tip the tool tip for the menu item
      In addition, the name of the radio button is set to uiKey.
      Parameters:
      uiKey - the base name of the resources to be used
      name - a qualifying name for the resources used for this menu item
      Returns:
      the check box that was created
    • createScrollPane

      public JScrollPane createScrollPane(JComponent c)
      Surround a component in a scroll pane. The name of the scroll pane component is set to c.getName() plus the .sp suffix.
      Parameters:
      c - The component to put into the scroll pane.
      Returns:
      a scroll pane component with the given component inside
    • createScrollPane

      public JScrollPane createScrollPane(JComponent c, int vsp, int hsp)
      Same as the single argument version, with options for altering the scrollbar appearance policy.
      Parameters:
      c - The component to put into the scroll pane.
      vsp - vertical scrollbar policy setting
      hsp - horizontal scrollbar policy setting
      Returns:
      a scroll pane component with the given component inside
      See Also:
    • createSlider

      public JSlider createSlider(String uiKey, int min, int max, int value)
      Create a slider, using resources to specify the the tool tip.
      The resource used is:
      uiKey.name.tip the tool tip for the menu item
      Parameters:
      uiKey - the base name of the resources to be used
      min - the minimum value for the slider
      max - the maximum value for the slider
      value - the initial value for the slider
      Returns:
      the slider that was created
    • createSplitPane

      public JSplitPane createSplitPane(int orient)
      Create an empty split pane with the given orientation.
      Parameters:
      orient - The split's orientation.
      Returns:
      The empty split pane component.
      See Also:
    • createSplitPane

      public JSplitPane createSplitPane(int orient, Component c1, Component c2)
      Create an empty split pane with the given components inside.
      Parameters:
      orient - The split's orientation.
      c1 - first component (left)
      c2 - first component (right)
      Returns:
      The populated split pane component.
      See Also:
    • createTabbedPane

      public JTabbedPane createTabbedPane(String uiKey)
      Create an empty tabbed pane.
      Parameters:
      uiKey - the base name of the resources to be used
      Returns:
      an empty (no tabs) tabbed pane The resources used are:
      uiKey.name the accessible name for the tab pane. Where name is the literal string "name".
      uiKey.tip the accessible name for the tab pane. Where tip is the literal string "tip".
      The tooltip will automatically be transferred to the pane's accessible description. Use setAccessibleDescription() to set it independently.
    • createTabbedPane

      public JTabbedPane createTabbedPane(String uiKey, JComponent... children)
      Create a tabbed pane with a given set of component panes, using resources to determine the name and tool tip for each tab.
      The resources used are:
      uiKey.namei.tab the display name for the tab, where namei is the component name for children[i]
      uiKey.namei.tip the tool tip for the tab, where namei is the component name for children[i]
      uiKey.name the accessible name for the tab pane. Where name is the literal string "name".
      uiKey.tip the accessible name for the tab pane. Where tip is the literal string "tip".
      The tooltip will automatically be transferred to the pane's accessible description. Use setAccessibleDescription() to set it independently.
      Parameters:
      uiKey - the base name of the resources to be used
      children - an array of components to be added into the tabbed pane
      Returns:
      the tabbed pane that was created
      See Also:
    • addTab

      public void addTab(JTabbedPane tPane, String uiKey, JComponent comp)
      Add a component to a tabbed pane, using resources to specify the name and the tool tip for the tab.
      The resources used are:
      uiKey.tab the name for the tab
      uiKey.tip the tool tip for the tab
      Parameters:
      tPane - the tabbed pane to which to add the component
      uiKey - the base name of the resources to be used
      comp - the component to be added
    • createTable

      public JTable createTable(String uiKey, TableModel model)
      Create a table with a given data model. Resources used:
      uiKey.name the accessible name for the tab pane. Where name is the literal string "name".
      uiKey.tip the accessible name for the tab pane. Where tip is the literal string "tip".
      The tooltip will automatically be transferred to the pane's accessible description. Use setAccessibleDescription() to set it independently.
      Parameters:
      uiKey - the base name of the resources to be used (currently ignored)
      model - the data model for the table
      Returns:
      the table that was created
      See Also:
    • createHeading

      public JTextField createHeading(String uiKey)
      Create a text field for use as a heading, using a resource to specify the heading.
      The resource used is:
      uiKey.txt the text for the heading
      In addition, the name of the output field is set to uiKey.
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      the text field that was created
    • createInputField

      public JTextField createInputField(String uiKey)
      Create an input text field, using a resource to specify the tool tip.
      The resource used is:
      uiKey.tip the tool tip for the field
      In addition, the name of the input field is set to uiKey. By default, the input field is 10 characters wide.
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      the input field that was created
    • createInputField

      public JTextField createInputField(String uiKey, JLabel label)
      Create an input text field, using a resource to specify the tool tip.
      The resource used is:
      uiKey.tip the tool tip for the field
      In addition, the name of the input field is set to uiKey. By default, the input field is 10 characters wide.
      Parameters:
      uiKey - the base name of the resource to be used
      label - the label to associate with this component
      Returns:
      the input field that was created
    • createInputField

      public JTextField createInputField(String uiKey, int cols)
      Create an input text field with a specified number of columns, using a resource to specify the tool tip.
      The resource used is:
      uiKey.tip the tool tip for the field
      In addition, the name of the input field is set to uiKey.
      Parameters:
      uiKey - the base name of the resource to be used
      cols - the default width of the field, in characters
      Returns:
      the input field that was created
      See Also:
    • createInputField

      public JTextField createInputField(String uiKey, int cols, JLabel label)
      Create an input text field with a specified number of columns, using a resource to specify the tool tip.
      The resource used is:
      uiKey.tip the tool tip for the field
      In addition, the name of the input field is set to uiKey.
      Parameters:
      uiKey - the base name of the resource to be used
      cols - the default width of the field, in characters
      label - the label to associate with this component
      Returns:
      the input field that was created
      See Also:
    • createMessageArea

      public JTextArea createMessageArea(String uiKey)
      Create a message area, using a resource to specify the content. The message area will be transparent, uneditable, and word-wrapped.
      The resource used is:
      uiKey.txt the text for the message area
      Parameters:
      uiKey - the name of the resource to be used
      Returns:
      the message area that was created
    • createMessageArea

      public JTextArea createMessageArea(String uiKey, Object arg)
      Create a message area, using a resource to specify the content. The message area will be transparent, uneditable, and word-wrapped.
      The resource used is:
      uiKey.txt the text for the message area
      uiKey.name accessible name
      uiKey.desc accessible description text
      Parameters:
      uiKey - the name of the resource to be used
      arg - an argument to be formatted into the content using MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)
      Returns:
      the message area that was created
    • createMessageArea

      public JTextArea createMessageArea(String uiKey, Object... args)
      Create a message area, using a resource to specify the content. The message area will be transparent, uneditable, and word-wrapped.
      The resource used is:
      uiKey.txt the text for the message area
      uiKey.name accessible name
      uiKey.desc accessible description text
      Parameters:
      uiKey - the name of the resource to be used
      args - an array of arguments to be formatted into the content using MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)
      Returns:
      the message area that was created
    • createOutputField

      public JTextField createOutputField(String uiKey)
      Create an output text field, using a resource to specify the tool tip.
      The resource used is:
      uiKey.tip the tool tip for the field
      uiKey.name accessible name
      In addition, the name of the output field is set to uiKey. By default, the output field is empty and is 10 characters wide.
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      the empty output field that was created
      See Also:
    • createOutputField

      public JTextField createOutputField(String uiKey, JLabel label)
      Same as the single parameter version, except a label, which labels this new component, will be set. The label's setLabelFor() will be set.
      Parameters:
      uiKey - the base name of the resource to be used
      label - the label which is labeling this field
      Returns:
      the output field that was created
      See Also:
    • createOutputField

      public JTextField createOutputField(String uiKey, JLabel label, boolean autoSelect)
      Create an output text field with a specified number of columns, using a resource to specify the tool tip, which can automaticly select contained text.
      The label's setLabelFor() will be set.
      Parameters:
      uiKey - the base name of the resource to be used
      label - the label which is labeling this field
      autoSelect - automaticly select text containing in the field on focus
      Returns:
      the output field that was created
      See Also:
    • createOutputField

      public JTextField createOutputField(String uiKey, int cols)
      Create an output text field with a specified number of columns, and using a resource to specify the tool tip.
      The resource used is:
      uiKey.tip the tool tip for the field
      uiKey.name accessible name
      In addition, the name of the output field is set to uiKey. The output field is initially empty.
      Parameters:
      uiKey - the base name of the resource to be used
      cols - the default width of the field, in characters
      Returns:
      the empty output field that was created
    • createOutputField

      public JTextField createOutputField(String uiKey, int cols, JLabel label)
      Create an output text field with a specified number of columns, using a resource to specify the tool tip, with an attached label.
      The resource used is:
      uiKey.tip the tool tip for the field
      uiKey.name accessible name
      In addition, the name of the output field is set to uiKey. The output field is initially empty.
      Parameters:
      uiKey - the base name of the resource to be used
      cols - the default width of the field, in characters
      label - the label which is labeling this field
      Returns:
      the empty output field that was created
    • createOutputField

      public JTextField createOutputField(String uiKey, int cols, JLabel label, boolean autoSelect)
      Create an output text field with a specified number of columns, using a resource to specify the tool tip, with an attached label, which can automaticly select contained text.
      The resource used is:
      uiKey.tip the tool tip for the field
      uiKey.name accessible name
      In addition, the name of the output field is set to uiKey. The output field is initially empty.
      Parameters:
      uiKey - the base name of the resource to be used
      cols - the default width of the field, in characters
      label - the label which is labeling this field
      autoSelect - automaticly select text containing in the field on focus
      Returns:
      the empty output field that was created
    • createOutputField

      public JTextField createOutputField(String uiKey, String value)
      Create an output text field containing a specified value, and using a resource to specify the tool tip.
      The resource used is:
      uiKey.tip the tool tip for the field
      uiKey.name accessible name
      In addition, the name of the output field is set to uiKey. By default, the output field is 10 characters wide.
      Parameters:
      uiKey - the base name of the resource to be used
      value - the initial text to appear in the output field
      Returns:
      the output field that was created
    • createOutputField

      public JTextField createOutputField(String uiKey, String value, JLabel label)
      Create an output text field containing a specified value, using a resource to specify the tool tip, with an attached label.
      The resource used is:
      uiKey.tip the tool tip for the field
      uiKey.name accessible name
      In addition, the name of the output field is set to uiKey. By default, the output field is 10 characters wide.
      Parameters:
      uiKey - the base name of the resource to be used
      value - the text to appear in the output field
      label - the label which is labeling this field
      Returns:
      the output field that was created
    • createOutputField

      public JTextField createOutputField(String uiKey, String value, int cols)
      Create an output text field containing a specified value, with a specified number of columns, and using a resource to specify the tool tip.
      The resource used is:
      uiKey.tip the tool tip for the field
      uiKey.name accessible name
      In addition, the name of the output field is set to uiKey.
      Parameters:
      uiKey - the base name of the resource to be used
      value - the text to appear in the output field
      cols - the default width of the field, in characters
      Returns:
      the output field that was created
    • createOutputField

      public JTextField createOutputField(String uiKey, String value, int cols, JLabel label)
      Create an output text field containing a specified value, with a specified number of columns, using a resource to specify the tool tip, with a label referencing this new field.
      The resource used is:
      uiKey.tip the tool tip for the field
      uiKey.name accessible name
      In addition, the name of the output field is set to uiKey.
      Parameters:
      uiKey - the base name of the resource to be used
      value - the text to appear in the output field
      cols - the default width of the field, in characters
      label - the label which is labeling this field
      Returns:
      the output field that was created
    • createOutputField

      public JTextField createOutputField(String uiKey, String value, int cols, JLabel label, boolean autoSelect)
      Create an output text field containing a specified value, with a specified number of columns, using a resource to specify the tool tip, with a label referencing this new field, which can automaticly select contained text.
      The resource used is:
      uiKey.tip the tool tip for the field
      uiKey.name accessible name
      In addition, the name of the output field is set to uiKey.
      Parameters:
      uiKey - the base name of the resource to be used
      value - the text to appear in the output field
      cols - the default width of the field, in characters
      label - the label which is labeling this field
      autoSelect - automaticly select text containing in the field on focus
      Returns:
      the output field that was created
    • createTextArea

      public JTextArea createTextArea(String uiKey)
      Create a text area, using a resource to specify the tool tip.
      The resource used is:
      uiKey.tip the tool tip for the text area
      In addition, the name of the text area is set to uiKey.
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      the text area that was created
    • createTextArea

      public JTextArea createTextArea(String uiKey, JLabel label)
      Create a text area, using a resource to specify the tool tip.
      The resource used is:
      uiKey.tip the tool tip for the text area
      In addition, the name of the text area is set to uiKey.
      Parameters:
      uiKey - the base name of the resource to be used
      label - the label that labels this text area. May be null.
      Returns:
      the text area that was created
    • createProgressBar

      public JProgressBar createProgressBar(String uiKey, int orient)
      Create a basic progress bar. The resource used is:
      uiKey.name accessible name
      uiKey.tip the tool tip for the text area
      Parameters:
      uiKey - the base name of the resource to be used
      orient - Value from JProgressBar
      Returns:
      Returns a progress bar component with the specified attributes.
      See Also:
    • createProgressBar

      public JProgressBar createProgressBar(String uiKey, int orient, BoundedRangeModel model)
      Create a basic progress bar. The resources used are:
      uiKey.name accessible name
      uiKey.tip the tool tip for the text area
      Parameters:
      uiKey - the base name of the resource to be used
      orient - Value from JProgressBar
      model - Model to use for the progress bar.
      Returns:
      Returns a progress bar component with the specified attributes.
      See Also:
    • createToolBar

      public JToolBar createToolBar(String uiKey)
      Create an empty toolbar. The resources used are:
      uiKey.name accessible name
      uiKey.desc accessible description text
      Parameters:
      uiKey - Used to obtain accessibility info and name the component
      Returns:
      the tool bar that was created
    • createToolBar

      public JToolBar createToolBar(String uiKey, Action... actions)
      Create a toolbar, using actions to specify the buttons, and using resources to specify the name and mnemonic.
      The components on the toolbar which are derived from the actions will have their accessible description set to the short description of the action. The resources used are:
      uiKey.name accessible name
      uiKey.desc accessible description text
      Parameters:
      uiKey - used to obtain accessibility info and name the component
      actions - the actions from which to create the buttons; use null in the array to indicate if and where a separator is required
      Returns:
      the tool bar that was created
      See Also:
    • createToolBar

      public JToolBar createToolBar(String uiKey, JButton... buttons)
      Create a toolbar, using buttons. The resources used are:
      uiKey.name accessible name
      uiKey.desc accessible description text
      Parameters:
      uiKey - used to obtain accessibility info and name the component
      buttons - the buttons to be included in the bar.
      use null in the array to indicate if and where a separator is required
      Returns:
      the tool bar that was created
    • addToolBarActions

      public void addToolBarActions(JToolBar tb, Action... actions)
      Add a set of actions to an existing toolbar.
      Parameters:
      tb - The toolbar to modify, must not be null.
      actions - the actions from which to create the buttons; use null in the array to indicate if and where a separator is required
      See Also:
    • showInformation

      public void showInformation(String uiKey)
      Show an information dialog, using a resource to specify the error message.
      The resource used is:
      uiKey.err the information message to be displayed
      The method will block until the dialog is dismissed by the user.
      Parameters:
      uiKey - the base name of the resource to be used
    • showError

      public void showError(String uiKey)
      Show an error dialog, using a resource to specify the error message.
      The resource used is:
      uiKey.err the error message to be displayed
      The method will block until the dialog is dismissed by the user.
      Parameters:
      uiKey - the base name of the resource to be used
    • showError

      public void showError(String uiKey, Object arg)
      Show an error dialog, using a resource to specify the error message.
      The resource used is:
      uiKey.err the error message to be displayed
      Parameters:
      uiKey - the base name of the resource to be used
      arg - an argument to be formatted into the content using MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition) The method will block until the dialog is dismissed by the user.
    • showError

      public void showError(String uiKey, Object... args)
      Show an error dialog, using a resource to specify the error message.
      The resource used is:
      uiKey.err the error message to be displayed
      Parameters:
      uiKey - the base name of the resource to be used
      args - an array of arguments to be formatted into the content using MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition) The method will block until the dialog is dismissed by the user.
    • showError

      public void showError(String uiKey, Object[] args, Object... trace)
      Show an error dialog containing stack trace information, using a resource to specify the error message.
      The resource used is:
      uiKey.err the error message to be displayed
      Parameters:
      uiKey - the base name of the resource to be used
      args - an array of arguments to be formatted into the content using
      trace - an array of arguments containing stack trace information to be added to scrollable pane The method will block until the dialog is dismissed by the user.
    • showLiteralError

      public void showLiteralError(String title, String msg)
      Show a error dialog to the user, using previously localized (or unlocalized) strings for the message and title.
      Parameters:
      title - Title string for the dialog. If null, a generic title will be used.
      msg - Message to show to the user.
      See Also:
    • showOKCancelDialog

      public int showOKCancelDialog(String uiKey)
      Show a confirmation dialog with OK and Cancel buttons, using a resource to specify the message and title.
      The resources used are:
      uiKey.txt the message to be displayed
      uiKey.title the title for the dialog
      The method will block until the dialog is dismissed by the user.
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      an integer signifying how the dialog was dismissed
      See Also:
    • showOKCancelDialog

      public int showOKCancelDialog(String uiKey, Object arg)
      Show a confirmation dialog with OK and Cancel buttons, using a resource to specify the message and title.
      The resources used are:
      uiKey.txt the message to be displayed
      uiKey.title the title for the dialog
      The method will block until the dialog is dismissed by the user.
      Parameters:
      uiKey - the base name of the resource to be used
      arg - an argument to be formatted into the content using MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)
      Returns:
      an integer signifying how the dialog was dismissed
      See Also:
    • showOKCancelDialog

      public int showOKCancelDialog(String uiKey, Object... args)
      Show a confirmation dialog with OK and Cancel buttons, using a resource to specify the message and title.
      The resources used are:
      uiKey.txt the message to be displayed
      uiKey.title the title for the dialog
      The method will block until the dialog is dismissed by the user.
      Parameters:
      uiKey - the base name of the resource to be used
      args - an array of arguments to be formatted into the content using MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)
      Returns:
      an integer signifying how the dialog was dismissed
      See Also:
    • showYesNoDialog

      public int showYesNoDialog(String uiKey)
      Show a confirmation dialog with Yes and No buttons, using a resource to specify the message and title.
      The resources used are:
      uiKey.txt the message to be displayed
      uiKey.title the title for the dialog
      The method will block until the dialog is dismissed by the user.
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      an integer signifying how the dialog was dismissed
      See Also:
    • showYesNoDialog

      public int showYesNoDialog(String uiKey, Object arg)
      Show a confirmation dialog with Yes and No buttons, using a resource to specify the message and title.
      The resources used are:
      uiKey.txt the message to be displayed
      uiKey.title the title for the dialog
      The method will block until the dialog is dismissed by the user.
      Parameters:
      uiKey - the base name of the resource to be used
      arg - an argument to be formatted into the content using MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)
      Returns:
      an integer signifying how the dialog was dismissed
      See Also:
    • showCustomYesNoDialog

      public int showCustomYesNoDialog(String uiKey, Component msg)
      Show a confirmation dialog with Yes and No buttons, using a resource to specify the title and component for the message.
      The resources used are:
      uiKey.title the title for the dialog
      The method will block until the dialog is dismissed by the user.
      Parameters:
      uiKey - the base name of the resource to be used
      msg - the GUI component to be used as the dialogs message payload
      Returns:
      an integer signifying how the dialog was dismissed
      See Also:
    • showYesNoDialog

      public int showYesNoDialog(String uiKey, Object... args)
      Show a confirmation dialog with Yes and No buttons, using a resource to specify the message and title.
      The resources used are:
      uiKey.txt the message to be displayed
      uiKey.title the title for the dialog
      The method will block until the dialog is dismissed by the user.
      Parameters:
      uiKey - the base name of the resource to be used
      args - an array of arguments to be formatted into the content using MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)
      Returns:
      an integer signifying how the dialog was dismissed
      See Also:
    • showYesNoCancelDialog

      public int showYesNoCancelDialog(String uiKey)
      Show a confirmation dialog with Yes, No and Cancel buttons, using a resource to specify the message and title.
      The resources used are:
      uiKey.txt the message to be displayed
      uiKey.title the title for the dialog
      The method will block until the dialog is dismissed by the user.
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      an integer signifying how the dialog was dismissed
      See Also:
    • showYesNoCancelDialog

      public int showYesNoCancelDialog(String uiKey, Object arg)
      Show a confirmation dialog with Yes and No buttons, using a resource to specify the message and title.
      The resources used are:
      uiKey.txt the message to be displayed
      uiKey.title the title for the dialog
      The method will block until the dialog is dismissed by the user.
      Parameters:
      uiKey - the base name of the resource to be used
      arg - an argument to be formatted into the content using MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)
      Returns:
      an integer signifying how the dialog was dismissed
      See Also:
    • showYesNoCancelDialog

      public int showYesNoCancelDialog(String uiKey, Object... args)
      Show a confirmation dialog with Yes and No buttons, using a resource to specify the message and title.
      The resources used are:
      uiKey.txt the message to be displayed
      uiKey.title the title for the dialog
      The method will block until the dialog is dismissed by the user.
      Parameters:
      uiKey - the base name of the resource to be used
      args - an array of arguments to be formatted into the content using MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)
      Returns:
      an integer signifying how the dialog was dismissed
      See Also:
    • showInformationDialog

      public void showInformationDialog(String uiKey, Object... args)
      Show a message only dialog, no user feedback. The resources used are:
      uiKey.txt the message to be displayed
      uiKey.title the title for the dialog
      Parameters:
      uiKey - the base name of the resource to be used
      args - any arguments to be used to create the message
    • showInformationDialog

      public void showInformationDialog(String uiKey, Object[] args, Component parent)
    • showCustomInfoDialog

      public void showCustomInfoDialog(String uiKey, Object msg)
      Show a dialog which provides the user with an informational message.

      The resources used are:

      uiKey.title the title for the dialog
      Parameters:
      uiKey - the base name of the resource to be used
      msg - the body of the dialog, which should have already been localized
    • createHorizontalBox

      public Box createHorizontalBox(String uiKey)
      Create a horizontal placeholder "box".
      The name of this new box component will be set to uiKey.
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      A Box component
      See Also:
    • createPanel

      public JPanel createPanel(String uiKey)
      Create an empty panel.
      In the J2SE 1.4 and greater world, panels are focusable by default, so this panel will be focusable. Because of this, accessibility information must be set, therefore the following resources are required from the resource bundle:
      uiKey.name the accessible name of the panel
      uiKey.desc accessible description text
      The name of this new component will be set to uiKey.
      Parameters:
      uiKey - the base name of the resource to be used
      Returns:
      An empty panel component
    • createPanel

      public JPanel createPanel(String uiKey, boolean focusable)
      Create an empty panel.
      In the J2SE 1.4 and greater world, panels are focusable by default, so this panel will be focusable. Use this method to control whether or not the panel remains focusable. If you choose 'true', the following must be provided in the resource bundle:
      uiKey.name the accessible name of the panel
      uiKey.desc accessible description text
      The name of this new component will be set to uiKey.
      Parameters:
      uiKey - the base name of the resource to be used
      focusable - If true, the panel will accept focus in the GUI. If false it will not. Note that if it is focusable, you need to provide accessibility text.
      Returns:
      An empty panel component
    • createPanel

      public JPanel createPanel(String uiKey, LayoutManager layout)
      Create an empty panel with a specific layout manager.
      In the J2SE 1.4 and greater world, panels are focusable by default, so this panel will be focusable. Because of this, accessibility information must be set, therefore the following resources are required from the resource bundle:
      uiKey.name the accessible name of the panel
      uiKey.desc accessible description text
      The name of this new component will be set to uiKey.
      Parameters:
      uiKey - the base name of the resource to be used
      layout - the layout manager instance to use in this panel
      Returns:
      An empty panel component
    • createPanel

      public JPanel createPanel(String uiKey, LayoutManager layout, boolean focusable)
      Create an empty panel with a specific layout manager.
      In the J2SE 1.4 and greater world, panels are focusable by default, so this panel will be focusable. Use this method to control whether or not the panel remains focusable. If you choose 'true', the following must be provided in the resource bundle:
      uiKey.name the accessible name of the panel
      uiKey.desc accessible description text
      The name of this new component will be set to uiKey.
      Parameters:
      uiKey - the base name of the resource to be used
      layout - the layout manager instance to use in this panel
      focusable - If true, the panel will accept focus in the GUI. If false it will not. Note that if it is focusable, you need to provide accessibility text.
      Returns:
      An empty panel component
    • initPanel

      public void initPanel(JPanel p, String uiKey, boolean focusable)
      Set properties on an existing panel.
      Parameters:
      p - the panel to modify
      uiKey - the base name of the resource to be used
      focusable - If true, the panel will accept focus in the GUI. If false it will not. Note that if it is focusable, you need to provide accessibility text.
    • initPanel

      public void initPanel(JPanel p, String uiKey, LayoutManager layout, boolean focusable)
      Set properties on an existing panel, including the layout manager.
      Parameters:
      p - the panel to modify
      uiKey - the base name of the resource to be used
      layout - the layout manager instance that this panel should use
      focusable - If true, the panel will accept focus in the GUI. If false it will not. Note that if it is focusable, you need to provide accessibility text.
    • createDialog

      public JDialog createDialog(String uiKey, Component parent)
      Create an empty dialog.
      See initDialog(JDialog,String) for required resources.
      Parameters:
      uiKey - the base name of the resource to be used
      parent - the parent component of this dialog
      Returns:
      an empty dialog component
      See Also:
    • createDialog

      public JDialog createDialog(String uiKey, JFrame owner)
      Create an empty dialog.
      See initDialog(JDialog,String) for required resources.
      Parameters:
      uiKey - the base name of the resource to be used
      owner - the parent frame of this dialog
      Returns:
      an empty dialog component
      See Also:
    • createDialog

      public JDialog createDialog(String uiKey, JFrame owner, String title, Container content)
      Create an empty dialog.
      See initDialog(JDialog,String) for required resources.
      Parameters:
      uiKey - the base name of the resource to be used
      owner - the parent frame of this dialog. If owner is null - icon is set to the dialog
      title - the localized title of this new dialog
      content - the content to go into the dialog
      Returns:
      an dialog component with the given content component and title
      See Also:
    • createDialog

      public JDialog createDialog(String uiKey, JFrame owner, String title, Container content, Dialog.ModalityType type)
      Create an empty dialog.
      See initDialog(JDialog,String) for required resources.
      Parameters:
      uiKey - the base name of the resource to be used
      owner - the parent frame of this dialog. If owner is null - icon is set to the dialog
      title - the localized title of this new dialog
      content - the content to go into the dialog
      type - specifies whether dialog blocks input to other windows when shown. null value and unsupported modality types are equivalent to MODELESS
      Returns:
      an dialog component with the given content component and title
      See Also:
    • createFrame

      public JFrame createFrame(String uiKey, String title, Container content)
      Create an empty frame. Unlike to dialog createDialog(String uiKey, JFrame owner, String title, Container content) it can't be modal, it's always free-floating and it has minimize and maximize buttons. See initFrame(JFrame,String) for required resources.
      Parameters:
      uiKey - the base name of the resource to be used
      title - the localized title of this new frame
      content - the content to go into the frame
      Returns:
      a frame component with the given content component and title
      See Also:
    • createWaitDialog

      public JDialog createWaitDialog(String uiKey, Component parent)
      Create a dialog which will ask the user to wait. The resources used are:
      uiKey.txt the message to be displayed
      uiKey.title the title for the dialog
      Parameters:
      uiKey - The prefix to retrieve strings to be displayed.
      parent - The parent component of this new dialog.
      Returns:
      a dialog appropriate for asking the user to wait
    • createWaitDialog

      public JDialog createWaitDialog(String uiKey, JFrame owner)
      Create a dialog which will ask the user to wait. The resources used are:
      uiKey.txt the message to be displayed
      uiKey.title the title for the dialog
      uiKey.desc accessible description of the dialog
      uiKey.name accessible name of the dialog
      Parameters:
      uiKey - The prefix to retrieve strings to be displayed.
      owner - The frame which will own this new dialog.
      Returns:
      a dialog appropriate for asking the user to wait
    • initDialog

      public void initDialog(JDialog d, String uiKey)
      Configure a dialog with accessibility information.
      uiKey.desc accessible description of the dialog
      uiKey.name accessible name of the dialog
      uiKey.root component name for the root pane of the dialog
      Parameters:
      d - the dialog to upgrade
      uiKey - Key to retrieve the new properties with
    • initFrame

      public void initFrame(JFrame d, String uiKey)
      Configure a frame with accessibility information and an icon.
      uiKey.desc accessible description of the frame
      uiKey.name accessible name of the frame
      uiKey.root component name for the root pane of the frame
      Parameters:
      d - the frame to upgrade
      uiKey - Key to retrieve the new properties with
    • dispose

      public void dispose()
      Dispose of any owned resources.