ABLE, Version 1.1b

com.ibm.able
Class AblePanelHelper

java.lang.Object
  |
  +--com.ibm.able.AblePanelHelper

public class AblePanelHelper
extends java.lang.Object

This class provides graphical helper methods to assure consistency of controls for AbleCustomizer panels. It contains only static methods.

Version:
$Revision: 1.14 $, $Date: 2000/09/26 21:14:56 $
See Also:
AbleObjectCustomizer

Method Summary
static javax.swing.JButton addButton(javax.swing.JPanel thePanel, int theX, int theY, int theWidth, java.lang.String theLabel, java.awt.event.ActionListener theAction, java.lang.String theToolTip)
          Construct a JButton and place it on the panel provided at the specified location.
static javax.swing.JButton addButton(javax.swing.JPanel thePanel, java.lang.String theLabel, java.awt.event.ActionListener theAction, java.lang.String theToolTip)
          Construct a JButton and place it on the panel.
static javax.swing.JCheckBox addCheckBox(javax.swing.JPanel thePanel, int theX, int theY, int theWidth, java.lang.String theLabel)
          Construct a JCheckBox and place it on the panel provided at the specified location.
static javax.swing.JCheckBox addCheckBox(javax.swing.JPanel thePanel, int theX, int theY, java.lang.String theLabel)
          Construct a JCheckBox and place it on the panel provided at the specified location.
static javax.swing.JComboBox addComboBox(javax.swing.JPanel thePanel, int theX, int theY, int theWidth)
          Construct a JComboBox and place it on the panel provided at the specified location.
static javax.swing.JLabel addLabel(javax.swing.JPanel thePanel, int theX, int theY, int theWidth, java.lang.String theLabel)
          Construct a JLabel and place it on the panel provided at the specified location.
static javax.swing.JList addList(javax.swing.JPanel thePanel, int theX, int theY, int theWidth, int theHeight, int theMode)
          Construct a JList and place it in a JScrollPane on the panel provided at the specified location.
static javax.swing.JTextArea addTextArea(javax.swing.JPanel thePanel, int theX, int theY, int theWidth, int theHeight, int theRows, int theColumns)
          Construct a JTextArea and place it in a JScrollPane on the panel provided at the specified location.
static javax.swing.JTextField addTextField(javax.swing.JPanel thePanel, int theX, int theY, int theWidth)
          Construct a JTextField and place it on the panel provided at the specified location.
static java.lang.String Copyright()
          Determine the copyright of this class.
static java.lang.String[] getFileDialog(java.awt.Window theParent, java.lang.String theChooserTitle, java.lang.String theFileTitle, java.lang.String[] theFileSpec, java.lang.String theDirectory, int theDialogType)
          Construct a modal JFileChooser and use it to obtain a file and path.
static java.lang.String[] getFileDialog(java.awt.Window theParent, java.lang.String theChooserTitle, java.lang.String theFileTitle, java.lang.String theFileExtension, java.lang.String theDirectory, int theDialogType)
          Construct a modal JFileChooser and use it to obtain a file and path.
static void run(java.lang.String theCommand)
          Run a command.
static void run(java.util.Vector theCommand)
          Run a command
static void setFileDialog(javax.swing.JTextField theTextField, java.lang.String theDialogTitle, java.lang.String theFileSpec)
          Deprecated. Use setTextFieldFromFileDialog instead.
static java.lang.String setTextFieldFromFileDialog(javax.swing.JTextField theTextField, java.lang.String theFileTitle, java.lang.String theFileExtension, java.lang.String theDirectory)
          Construct a OPEN JFileChooser dialog and use it to set the text of a JTextField.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addButton

public static javax.swing.JButton addButton(javax.swing.JPanel thePanel,
                                            int theX,
                                            int theY,
                                            int theWidth,
                                            java.lang.String theLabel,
                                            java.awt.event.ActionListener theAction,
                                            java.lang.String theToolTip)
Construct a JButton and place it on the panel provided at the specified location.
Parameters:
thePanel - add the new button to this JPanel.
theX - place the new button at this X location.
theY - place the new button at this Y location.
theWidth - the button width.
theLabel - use this label for the new button.
theAction - the action listener to use when the button is pressed.
theToolTip - the text to display when the mouse hovers over the button.

addButton

public static javax.swing.JButton addButton(javax.swing.JPanel thePanel,
                                            java.lang.String theLabel,
                                            java.awt.event.ActionListener theAction,
                                            java.lang.String theToolTip)
Construct a JButton and place it on the panel.
Parameters:
thePanel - add the new button to this JPanel.
theLabel - use this label for the new button.
theAction - the action listener to use when the button is pressed.
theToolTip - the text to display when the mouse hovers over the button.

addCheckBox

public static javax.swing.JCheckBox addCheckBox(javax.swing.JPanel thePanel,
                                                int theX,
                                                int theY,
                                                java.lang.String theLabel)
Construct a JCheckBox and place it on the panel provided at the specified location.
Parameters:
thePanel - add the new checkbox to this JPanel.
theX - place the new checkbox at this X location.
theY - place the new checkbox at this Y location.
theLabel - use this label for the new checkbox.

addCheckBox

public static javax.swing.JCheckBox addCheckBox(javax.swing.JPanel thePanel,
                                                int theX,
                                                int theY,
                                                int theWidth,
                                                java.lang.String theLabel)
Construct a JCheckBox and place it on the panel provided at the specified location.
Parameters:
thePanel - add the new checkbox to this JPanel.
theX - place the new checkbox at this X location.
theY - place the new checkbox at this Y location.
theWidth - the checkbox width.
theLabel - use this label for the new checkbox.

addComboBox

public static javax.swing.JComboBox addComboBox(javax.swing.JPanel thePanel,
                                                int theX,
                                                int theY,
                                                int theWidth)
Construct a JComboBox and place it on the panel provided at the specified location.
Parameters:
thePanel - add the new combobox to this JPanel.
theX - place the new combobox at this X location.
theY - place the new combobox at this Y location.
theWidth - the combobox width.

addLabel

public static javax.swing.JLabel addLabel(javax.swing.JPanel thePanel,
                                          int theX,
                                          int theY,
                                          int theWidth,
                                          java.lang.String theLabel)
Construct a JLabel and place it on the panel provided at the specified location.
Parameters:
thePanel - add the new label to this JPanel.
theX - place the new label at this X location.
theY - place the new label at this Y location.
theWidth - the new label width.
theLabel - use this label for the text.

addList

public static javax.swing.JList addList(javax.swing.JPanel thePanel,
                                        int theX,
                                        int theY,
                                        int theWidth,
                                        int theHeight,
                                        int theMode)
Construct a JList and place it in a JScrollPane on the panel provided at the specified location.
Parameters:
thePanel - add the new list to this JPanel.
theX - place the new list at this X location.
theY - place the new list at this Y location.
theWidth - the list width.
theHeight - the list height.
theMode - the selection mode for the ListSelectionModel.
See Also:
ListSelectionModel

addTextArea

public static javax.swing.JTextArea addTextArea(javax.swing.JPanel thePanel,
                                                int theX,
                                                int theY,
                                                int theWidth,
                                                int theHeight,
                                                int theRows,
                                                int theColumns)
Construct a JTextArea and place it in a JScrollPane on the panel provided at the specified location.
Parameters:
thePanel - add the new text area to this JPanel.
theX - place the new text area at this X location.
theY - place the new text area at this Y location.
theWidth - the text area width.
theHeight - the text area height.
theRows - the number of rows in the text area. Provide -1 to avoid setting the row size.
theColumns - the number of rows in the text area. Provide -1 to avoid setting the column size.

addTextField

public static javax.swing.JTextField addTextField(javax.swing.JPanel thePanel,
                                                  int theX,
                                                  int theY,
                                                  int theWidth)
Construct a JTextField and place it on the panel provided at the specified location.
Parameters:
thePanel - add the new text field to this JPanel.
theX - place the new text field at this X location.
theY - place the new text field at this Y location.
theWidth - the text field width.

setFileDialog

public static void setFileDialog(javax.swing.JTextField theTextField,
                                 java.lang.String theDialogTitle,
                                 java.lang.String theFileSpec)
Deprecated. Use setTextFieldFromFileDialog instead.
Construct a FileDialog and use it to populate a JTextField. The FileDialog will be placed 20 pels below and 20 pels to the right of the parent of the JTextField.
Parameters:
theTextField - The textfield to be populated with the FileDialog selection.
theDialogTitle - The title to be used for the FileDialog box.
theFileSpec - The filter to be used to select files.

getFileDialog

public static java.lang.String[] getFileDialog(java.awt.Window theParent,
                                               java.lang.String theChooserTitle,
                                               java.lang.String theFileTitle,
                                               java.lang.String theFileExtension,
                                               java.lang.String theDirectory,
                                               int theDialogType)
Construct a modal JFileChooser and use it to obtain a file and path.
Parameters:
theParent - The Window that represents the JFileChooser's parent.
theChooserTitle - A String containing the JFileChooser's title.
theFileTitle - The description used to identify the file selection. Suggested format: "Description of File (*.xyz)"
theFileExtension - The extension used to filter the search, for example: "xyz".
theDirectory - A String containing the starting directory.
theDialogType - An integer representing the type of dialog:
JFileChooser.OPEN_DIALOG
JFileChooser.OPEN_DIALOG
Returns:
A String array where:
[0]
Path, where null indicates no file was chosen
[1]
FileName.extension, where null indicates no file was chosen
[2]
FileName only, where null indicates no file was chosen
See Also:
java.io.JFileChooser

getFileDialog

public static java.lang.String[] getFileDialog(java.awt.Window theParent,
                                               java.lang.String theChooserTitle,
                                               java.lang.String theFileTitle,
                                               java.lang.String[] theFileSpec,
                                               java.lang.String theDirectory,
                                               int theDialogType)
Construct a modal JFileChooser and use it to obtain a file and path.
Parameters:
theParent - The Window that represents the JFileChooser's parent.
theChooserTitle - A String containing the JFileChooser's title.
theFileTitle - The description used to identify the file selection. Suggested format: "Description of File (*.xyz)"
theFileExtensions - A String array of file extensions used to filter the search, for example: {"ser", "xlt"}.
theDirectory - A String containing the starting directory.
theDialogType - An integer representing the type of dialog:
JFileChooser.OPEN_DIALOG
JFileChooser.OPEN_DIALOG
Returns:
A String array where:
[0]
Path, where null indicates no file was chosen
[1]
FileName.extension, where null indicates no file was chosen
[2]
FileName only, where null indicates no file was chosen
See Also:
java.io.JFileChooser

setTextFieldFromFileDialog

public static java.lang.String setTextFieldFromFileDialog(javax.swing.JTextField theTextField,
                                                          java.lang.String theFileTitle,
                                                          java.lang.String theFileExtension,
                                                          java.lang.String theDirectory)
Construct a OPEN JFileChooser dialog and use it to set the text of a JTextField. The dialog parent is obtained from the JTextField.
Parameters:
theTextField - The textfield to be populated with the JFileChooser selection.
theFileTitle - The description used to identify the file selection. Suggested format: "Description of File (*.xyz)"
theFileExtension - The extension used to filter the search, for example: "xyz".
theDirectory - A String containing the starting directory.
Returns:
A String representing the path to the selected file, where null indicates nothing was selected.

run

public static void run(java.lang.String theCommand)
                throws java.lang.Exception
Run a command.
Parameters:
A - String containing the command to run.
Throws:
An - exception if an error occurs when the command is run.

run

public static void run(java.util.Vector theCommand)
                throws java.lang.Exception
Run a command
Parameters:
A - Vector where each element contains a word of the command to run.
Throws:
An - exception if an error occurs when the command is run. Platforms tested as of 4/11/2000:
     NT    (OK),
     95/98 (???),
     AIX   (???) ,
     OS/2  (???) ,
     MAC   (???)
   

Copyright

public static java.lang.String Copyright()
Determine the copyright of this class.
Returns:
A String containing this class's copyright statement.


ABLE, Version 1.1b

ABLE: Produced by Joe, Don, and Jeff who say, 'Thanks for your support.'