com.digi.config.ui
Class GridContentPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycom.digi.config.ui.CustomPanel
                      extended bycom.digi.config.ui.GridContentPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class GridContentPanel
extends CustomPanel

This class is a panel that holds controls in a tabular manner. Views can imbed this panel anywhere they want a table of controls. The class has helper methods for inserting entries into the table. The columns of this table are: FieldName | FieldValueControl | FieldDescription

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
(package private)  java.awt.GridBagConstraints c
           
(package private)  boolean edittingRow
          indicates if current row is being editted
(package private)  java.awt.GridBagLayout gbl
           
(package private)  java.awt.Color headingBarColor
           
(package private)  int maxColumns
           
(package private)  int rowCount
           
 
Fields inherited from class com.digi.config.ui.CustomPanel
backgroundColor, backgroundIcon, backgroundImage, customizeKey, dftBackgroundColor, dftForegroundColor, foregroundColor, opaque, stretchImage, tileImage
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
GridContentPanel(int fieldColumns)
          Create a Grid panel that we can put controls in.
GridContentPanel(java.lang.String panelKey, int fieldColumns)
           
 
Method Summary
 javax.swing.JButton addAction(java.lang.String prefixTag, javax.swing.Action action, java.lang.String postfixTag)
          Helper method to add a button to the panel.
 javax.swing.JButton addAction(java.lang.String prefixTag, javax.swing.Action action, java.lang.String postfixTag, int fieldColumn, boolean endRow)
          Helper method to add a button to the panel.
 void addBlankLine()
          Inserts a blank line of space in the panel.
 javax.swing.JLabel addColumnHeading(java.lang.String textTag, java.awt.event.ActionListener fieldListener)
          Helper method to create and add a ColumnHeading control to the panel.
 javax.swing.JLabel addColumnHeading(java.lang.String textTag, java.awt.event.ActionListener fieldListener, int fieldColumn, boolean endRow)
           
 void addField(java.lang.String prefixTag, java.awt.Component fieldComponent, java.lang.String postfixTag)
          Helper method to add any Component style control to the panel in the first field column.
 void addField(java.lang.String prefixTag, java.awt.Component fieldComponent, java.lang.String postfixTag, int fieldColumn, boolean endRow)
          Helper method to add any Component style control to the panel at a specified field column.
 void addHeadingBar(java.lang.String headingTag)
          A Helper method to add a heading string to the panel.
 javax.swing.JCheckBox addJCheckBox(java.lang.String labelTag, java.awt.event.ActionListener fieldListener)
          Helper method to create and add a JCheckBox control to the panel.
 javax.swing.JCheckBox addJCheckBox(java.lang.String labelTag, java.awt.event.ActionListener fieldListener, int fieldColumn, boolean endRow)
           
 javax.swing.JComboBox addJComboBox(java.lang.String prefixTag, java.lang.String postfixTag, java.lang.String[] choices, java.awt.event.ActionListener fieldListener)
          Helper method to create and add a JComboBox control to the panel.
 javax.swing.JComboBox addJComboBox(java.lang.String prefixTag, java.lang.String postfixTag, java.lang.String[] choices, java.awt.event.ActionListener fieldListener, int fieldColumn, boolean endRow)
           
 javax.swing.JFormattedTextField addJFormattedTextField(java.lang.String prefixTag, java.lang.String postfixTag, java.text.Format format, int maxWidth, java.awt.event.FocusListener fieldListener)
           
 javax.swing.JFormattedTextField addJFormattedTextField(java.lang.String prefixTag, java.lang.String postfixTag, java.text.Format format, int maxWidth, java.awt.event.FocusListener fieldListener, int fieldColumn, boolean endRow)
           
 javax.swing.JFormattedTextField addJFormattedTextField(java.lang.String prefixTag, java.lang.String postfixTag, javax.swing.JFormattedTextField.AbstractFormatter formatter, int maxWidth, java.awt.event.FocusListener fieldListener)
          Helper method to create and add a JFormattedTextField control to the panel.
 javax.swing.JFormattedTextField addJFormattedTextField(java.lang.String prefixTag, java.lang.String postfixTag, javax.swing.JFormattedTextField.AbstractFormatter formatter, int maxWidth, java.awt.event.FocusListener fieldListener, int fieldColumn, boolean endRow)
           
 javax.swing.JLabel addJLabel(java.lang.String prefixTag, java.lang.String postfixTag)
          Helper method to create and add a JLabel control to the panel.
 javax.swing.JLabel addJLabel(java.lang.String prefixTag, java.lang.String postfixTag, int maxWidth)
           
 javax.swing.JLabel addJLabel(java.lang.String prefixTag, java.lang.String postfixTag, int maxWidth, int fieldColumn, boolean endRow)
           
 javax.swing.JPasswordField addJPasswordField(java.lang.String prefixTag, java.lang.String postfixTag, int maxWidth, java.awt.event.FocusListener fieldListener)
          Helper method to create and add a JPasswordField control to the panel.
 javax.swing.JPasswordField addJPasswordField(java.lang.String prefixTag, java.lang.String postfixTag, int maxWidth, java.awt.event.FocusListener fieldListener, int fieldColumn, boolean endRow)
           
 javax.swing.JRadioButton addJRadioButton(java.lang.String labelTag, java.awt.event.ActionListener fieldListener)
          Helper method to create and add a JRadioButton control to the panel.
 javax.swing.JRadioButton addJRadioButton(java.lang.String labelTag, java.awt.event.ActionListener fieldListener, javax.swing.ButtonGroup group)
           
 javax.swing.JRadioButton addJRadioButton(java.lang.String labelTag, java.awt.event.ActionListener fieldListener, javax.swing.ButtonGroup group, int fieldColumn, boolean endRow)
           
 javax.swing.JTextField addJTextField(java.lang.String prefixTag, java.lang.String postfixTag, int maxWidth, java.awt.event.FocusListener fieldListener)
          Helper method to create and add a JTextField control to the panel.
 javax.swing.JTextField addJTextField(java.lang.String prefixTag, java.lang.String postfixTag, int maxWidth, java.awt.event.FocusListener fieldListener, int fieldColumn, boolean endRow)
           
 void addSubPanel(javax.swing.JComponent subPanel)
          A helper panel to imbed another JPanel inside of this panel.
 void addTextLine(java.lang.String textTag)
          A Helper method to add a line of text to the panel.
 void addVGlue()
          Adds vertical glue at this point in the panel.
 void setContainerEnabled(boolean enabled)
          A Helper method to enable/disable this panel and all the controls held within it.
 void setContainerEnabled(java.awt.Container c, boolean enabled)
           
 
Methods inherited from class com.digi.config.ui.CustomPanel
isOpaque, paint
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

gbl

java.awt.GridBagLayout gbl

c

java.awt.GridBagConstraints c

rowCount

int rowCount

maxColumns

int maxColumns

edittingRow

boolean edittingRow
indicates if current row is being editted


headingBarColor

java.awt.Color headingBarColor
Constructor Detail

GridContentPanel

public GridContentPanel(int fieldColumns)
Create a Grid panel that we can put controls in. This panel is a helper panel for doing grid bag controls. It simplifies adding layouts that consist of multiple lines of the following format: label value description label value description label value description The panel also supports multiple columns of this type of data such as: label value description label value description label value description label value description label value description label value description Caller specifies the number of field columns to be used.

Parameters:
fieldColumns - is the number of label/value/description groups to horizontally lay out on the screen.

GridContentPanel

public GridContentPanel(java.lang.String panelKey,
                        int fieldColumns)
Method Detail

setContainerEnabled

public void setContainerEnabled(boolean enabled)
A Helper method to enable/disable this panel and all the controls held within it.


setContainerEnabled

public void setContainerEnabled(java.awt.Container c,
                                boolean enabled)

addHeadingBar

public void addHeadingBar(java.lang.String headingTag)
A Helper method to add a heading string to the panel. The heading string value will be looked up in the UI resource bundle and will be displayed across the entire width of the window on the desginated heading color.

Parameters:
headingTag - the UI resource tag of the heading string

addBlankLine

public void addBlankLine()
Inserts a blank line of space in the panel.


addTextLine

public void addTextLine(java.lang.String textTag)
A Helper method to add a line of text to the panel. The string value will be looked up in the UI resource bundle and will be displayed across the entire width of the window in normal text.

Parameters:
textTag - the UI resource tag of the string to display

addColumnHeading

public javax.swing.JLabel addColumnHeading(java.lang.String textTag,
                                           java.awt.event.ActionListener fieldListener)
Helper method to create and add a ColumnHeading control to the panel.


addColumnHeading

public javax.swing.JLabel addColumnHeading(java.lang.String textTag,
                                           java.awt.event.ActionListener fieldListener,
                                           int fieldColumn,
                                           boolean endRow)

addJLabel

public javax.swing.JLabel addJLabel(java.lang.String prefixTag,
                                    java.lang.String postfixTag)
Helper method to create and add a JLabel control to the panel.


addJLabel

public javax.swing.JLabel addJLabel(java.lang.String prefixTag,
                                    java.lang.String postfixTag,
                                    int maxWidth)

addJLabel

public javax.swing.JLabel addJLabel(java.lang.String prefixTag,
                                    java.lang.String postfixTag,
                                    int maxWidth,
                                    int fieldColumn,
                                    boolean endRow)

addJTextField

public javax.swing.JTextField addJTextField(java.lang.String prefixTag,
                                            java.lang.String postfixTag,
                                            int maxWidth,
                                            java.awt.event.FocusListener fieldListener)
Helper method to create and add a JTextField control to the panel.


addJTextField

public javax.swing.JTextField addJTextField(java.lang.String prefixTag,
                                            java.lang.String postfixTag,
                                            int maxWidth,
                                            java.awt.event.FocusListener fieldListener,
                                            int fieldColumn,
                                            boolean endRow)

addJFormattedTextField

public javax.swing.JFormattedTextField addJFormattedTextField(java.lang.String prefixTag,
                                                              java.lang.String postfixTag,
                                                              javax.swing.JFormattedTextField.AbstractFormatter formatter,
                                                              int maxWidth,
                                                              java.awt.event.FocusListener fieldListener)
Helper method to create and add a JFormattedTextField control to the panel.


addJFormattedTextField

public javax.swing.JFormattedTextField addJFormattedTextField(java.lang.String prefixTag,
                                                              java.lang.String postfixTag,
                                                              javax.swing.JFormattedTextField.AbstractFormatter formatter,
                                                              int maxWidth,
                                                              java.awt.event.FocusListener fieldListener,
                                                              int fieldColumn,
                                                              boolean endRow)

addJFormattedTextField

public javax.swing.JFormattedTextField addJFormattedTextField(java.lang.String prefixTag,
                                                              java.lang.String postfixTag,
                                                              java.text.Format format,
                                                              int maxWidth,
                                                              java.awt.event.FocusListener fieldListener)

addJFormattedTextField

public javax.swing.JFormattedTextField addJFormattedTextField(java.lang.String prefixTag,
                                                              java.lang.String postfixTag,
                                                              java.text.Format format,
                                                              int maxWidth,
                                                              java.awt.event.FocusListener fieldListener,
                                                              int fieldColumn,
                                                              boolean endRow)

addJPasswordField

public javax.swing.JPasswordField addJPasswordField(java.lang.String prefixTag,
                                                    java.lang.String postfixTag,
                                                    int maxWidth,
                                                    java.awt.event.FocusListener fieldListener)
Helper method to create and add a JPasswordField control to the panel.


addJPasswordField

public javax.swing.JPasswordField addJPasswordField(java.lang.String prefixTag,
                                                    java.lang.String postfixTag,
                                                    int maxWidth,
                                                    java.awt.event.FocusListener fieldListener,
                                                    int fieldColumn,
                                                    boolean endRow)

addJCheckBox

public javax.swing.JCheckBox addJCheckBox(java.lang.String labelTag,
                                          java.awt.event.ActionListener fieldListener)
Helper method to create and add a JCheckBox control to the panel.


addJCheckBox

public javax.swing.JCheckBox addJCheckBox(java.lang.String labelTag,
                                          java.awt.event.ActionListener fieldListener,
                                          int fieldColumn,
                                          boolean endRow)

addJComboBox

public javax.swing.JComboBox addJComboBox(java.lang.String prefixTag,
                                          java.lang.String postfixTag,
                                          java.lang.String[] choices,
                                          java.awt.event.ActionListener fieldListener)
Helper method to create and add a JComboBox control to the panel.


addJComboBox

public javax.swing.JComboBox addJComboBox(java.lang.String prefixTag,
                                          java.lang.String postfixTag,
                                          java.lang.String[] choices,
                                          java.awt.event.ActionListener fieldListener,
                                          int fieldColumn,
                                          boolean endRow)

addJRadioButton

public javax.swing.JRadioButton addJRadioButton(java.lang.String labelTag,
                                                java.awt.event.ActionListener fieldListener)
Helper method to create and add a JRadioButton control to the panel.


addJRadioButton

public javax.swing.JRadioButton addJRadioButton(java.lang.String labelTag,
                                                java.awt.event.ActionListener fieldListener,
                                                javax.swing.ButtonGroup group)

addJRadioButton

public javax.swing.JRadioButton addJRadioButton(java.lang.String labelTag,
                                                java.awt.event.ActionListener fieldListener,
                                                javax.swing.ButtonGroup group,
                                                int fieldColumn,
                                                boolean endRow)

addSubPanel

public void addSubPanel(javax.swing.JComponent subPanel)
A helper panel to imbed another JPanel inside of this panel. The panel will be placed in the first column of the current row and will span the width of the panel.

Parameters:
subPanel - to be embedded in this panel.

addVGlue

public void addVGlue()
Adds vertical glue at this point in the panel. This space will expand to fill fill the available space in the panel. The available space will be evently spread between any vertical glue slots in the panel.


addAction

public javax.swing.JButton addAction(java.lang.String prefixTag,
                                     javax.swing.Action action,
                                     java.lang.String postfixTag)
Helper method to add a button to the panel. The button can have optional prefix and postfix strings. These strings will be looked up in the UI resource bundle. The caller suplies the action to be called when the button is pressed. The item will be placed in the first field column of the table.

Parameters:
prefixTag - is the resource key for the prefix string. Null value means don't use a prefix string and instead place the button in the first column.
action - is the action the button will be created to invoke when it is pressed. The button will get its text and icon attributes from the action.
postfixTag - is the resource key for the postfix string. Null value means don't use a postfix string

addAction

public javax.swing.JButton addAction(java.lang.String prefixTag,
                                     javax.swing.Action action,
                                     java.lang.String postfixTag,
                                     int fieldColumn,
                                     boolean endRow)
Helper method to add a button to the panel. The button can have optional prefix and postfix strings. These strings will be looked up in the UI resource bundle. The caller suplies the action to be called when the button is pressed. The item will be placed in the first field column of the table.

Parameters:
prefixTag - is the resource key for the prefix string. Null value means don't use a prefix string and instead place the button in the first column.
action - is the action the button will be created to invoke when it is pressed. The button will get its text and icon attributes from the action.
postfixTag - is the resource key for the postfix string. Null value means don't use a postfix string

addField

public void addField(java.lang.String prefixTag,
                     java.awt.Component fieldComponent,
                     java.lang.String postfixTag)
Helper method to add any Component style control to the panel in the first field column. The component can have prefix and postfix strings as desired.

Parameters:
prefixTag - is the resource key for the prefix string. Null value means don't use a prefix string and instead place the component in the first column.
fieldComponent - is the component to be inserted into the field column
postfixTag - is the resource key for the postfix string. Null value means don't use a postfix string

addField

public void addField(java.lang.String prefixTag,
                     java.awt.Component fieldComponent,
                     java.lang.String postfixTag,
                     int fieldColumn,
                     boolean endRow)
Helper method to add any Component style control to the panel at a specified field column. The component can have prefix and postfix strings as desired. This method can be called multiple times to place multiple fields on the same row. Specifying endRow indicates this will be the last field added to the current row.

Parameters:
prefixTag - is the resource key for the prefix string. Null value means don't use a prefix string and instead place the component in the first column.
fieldComponent - is the component to be inserted into the field column
postfixTag - is the resource key for the postfix string. Null value means don't use a postfix string
fieldColumn - is the major column index to place the prefix/field/postfix combination at. (zero based)
endRow - indicates if this is the last Field to be added to this row. It triggers subsequent fields to be inserted on the next row.


Copyright © 2001-2002 Digi International. All Rights Reserved.