com.ibm.as400.util.html
Class GridLayoutFormPanel

java.lang.Object
  extended bycom.ibm.as400.util.html.LayoutFormPanel
      extended bycom.ibm.as400.util.html.GridLayoutFormPanel
All Implemented Interfaces:
HTMLTagElement, Serializable

public class GridLayoutFormPanel
extends LayoutFormPanel

The GridLayoutFormPanel class represents a grid layout of HTML form elements.

GridLayoutFormPanel objects generate the following events:

This examples creates a GridLayoutFormPanel object with two columns.

  

// Create a text form input element for the system. LabelFormElement sysPrompt = new LabelFormElement("System:"); TextFormInput system = new TextFormInput("System");

// Create a text form input element for the userId. LabelFormElement userPrompt = new LabelFormElement("User:"); TextFormInput user = new TextFormInput("User");

// Create a password form input element for the password. LabelFormElement passwordPrompt = new LabelFormElement("Password:"); PasswordFormInput password = new PasswordFormInput("Password");

// Create the GridLayoutFormPanel object with two columns and add the form elements. GridLayoutFormPanel panel = new GridLayoutFormPanel(2); panel.addElement(sysPrompt); panel.addElement(system); panel.addElement(userPrompt); panel.addElement(user); panel.addElement(passwordPrompt); panel.addElement(password);

// Create the submit button to the form. SubmitFormInput logonButton = new SubmitFormInput("logon", "Logon");

// Create HTMLForm object and add the panel to it. HTMLForm form = new HTMLForm(servletURI); form.addElement(panel); form.addElement(logonButton);

See Also:
Serialized Form

Constructor Summary
GridLayoutFormPanel()
          Constructs a default GridLayoutFormPanel with one column.
GridLayoutFormPanel(int columns)
          Constructs a GridLayoutFormPanel with the specified number of columns.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener.
 void addVetoableChangeListener(VetoableChangeListener listener)
          Adds the VetoableChangeListener.
 String getAlignment()
          Returns the alignment of the text interpretation.
 String getColumnAlignment(int column)
          Returns the alignment of the text that is used for elements in a specific column in the grid.
 String getColumnDirection(int column)
          Returns the direction of the text interpretation that is used for elements in a specific column in the grid.
 int getColumns()
          Returns the number of columns in the layout.
 String getDirection()
          Returns the direction of the text interpretation.
 String getFOTag()
          Returns a comment tag.
 String getLanguage()
          Returns the language of the input element.
 String getTag()
          Returns the grid layout panel tag.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes the PropertyChangeListener from the internal list.
 void removeVetoableChangeListener(VetoableChangeListener listener)
          Removes the VetoableChangeListener from the internal list.
 void setAlignment(String align)
          Sets the alignment of the text for the grid.
 void setColumnAlignment(int column, String align)
          Sets the alignment of the text interpretation that is used for elements in a specific column in the grid.
 void setColumnDirection(int column, String dir)
          Sets the direction of the text interpretation that is used for elements in a specific column in the grid.
 void setColumns(int columns)
          Sets the number of columns in the layout.
 void setDirection(String dir)
          Sets the direction of the text interpretation.
 void setLanguage(String lang)
          Sets the language of the input tag.
 
Methods inherited from class com.ibm.as400.util.html.LayoutFormPanel
addElement, addElementListener, getSize, removeElement, removeElementListener, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridLayoutFormPanel

public GridLayoutFormPanel()
Constructs a default GridLayoutFormPanel with one column.


GridLayoutFormPanel

public GridLayoutFormPanel(int columns)
Constructs a GridLayoutFormPanel with the specified number of columns.

Parameters:
columns - The number of columns.
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener. The specified PropertyChangeListener's propertyChange method will be called each time the value of any bound property is changed.

Parameters:
listener - The PropertyChangeListener.
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener)

addVetoableChangeListener

public void addVetoableChangeListener(VetoableChangeListener listener)
Adds the VetoableChangeListener. The specified VetoableChangeListener's vetoableChange method will be called each time the value of any constrained property is changed.

Parameters:
listener - The VetoableChangeListener.
See Also:
removeVetoableChangeListener(java.beans.VetoableChangeListener)

getAlignment

public String getAlignment()
Returns the alignment of the text interpretation.

Returns:
The alignment of the text.

getColumnAlignment

public String getColumnAlignment(int column)
Returns the alignment of the text that is used for elements in a specific column in the grid. Use getAlignment to determine the alignment used for the overall grid.

Parameters:
column - The column for which to retrieve the alignment. The column is 0-based.
Returns:
The alignment of the text, or null if one was not set.
See Also:
setColumnAlignment(int, java.lang.String)

getColumnDirection

public String getColumnDirection(int column)
Returns the direction of the text interpretation that is used for elements in a specific column in the grid. Use getDirection to determine the direction used for the overall grid.

Parameters:
column - The column for which to retrieve the direction. The column is 0-based.
Returns:
The direction of the text, or null if one was not set.
See Also:
setColumnDirection(int, java.lang.String)

getColumns

public int getColumns()
Returns the number of columns in the layout.

Returns:
The number of columns.

getDirection

public String getDirection()
Returns the direction of the text interpretation.

Returns:
The direction of the text.

getLanguage

public String getLanguage()
Returns the language of the input element.

Returns:
The language of the input element.

getFOTag

public String getFOTag()
Returns a comment tag. This method should not be called. There is no XSL-FO support for this class.

Returns:
The comment tag.

getTag

public String getTag()
Returns the grid layout panel tag.

Returns:
The tag.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes the PropertyChangeListener from the internal list. If the PropertyChangeListener is not on the list, nothing is done.

Parameters:
listener - The PropertyChangeListener.
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

removeVetoableChangeListener

public void removeVetoableChangeListener(VetoableChangeListener listener)
Removes the VetoableChangeListener from the internal list. If the VetoableChangeListener is not on the list, nothing is done.

Parameters:
listener - The VetoableChangeListener.
See Also:
addVetoableChangeListener(java.beans.VetoableChangeListener)

setAlignment

public void setAlignment(String align)
Sets the alignment of the text for the grid.

Parameters:
align - The alignment. Use one of the following constants defined in HTMLConstants: LEFT, RIGHT, or CENTER.
See Also:
HTMLConstants

setColumnAlignment

public void setColumnAlignment(int column,
                               String align)
Sets the alignment of the text interpretation that is used for elements in a specific column in the grid. Use setAlignment to set the alignment for the overall grid.

Parameters:
column - The column. This value is 0-based.
align - The alignment. One of the following constants defined in HTMLConstants: LEFT, RIGHT, or CENTER.
See Also:
HTMLConstants

setColumnDirection

public void setColumnDirection(int column,
                               String dir)
Sets the direction of the text interpretation that is used for elements in a specific column in the grid. Use setDirection to set the direction for the overall grid.

Parameters:
column - The column. This value is 0-based.
dir - The direction. One of the following constants defined in HTMLConstants: LTR or RTL.
See Also:
HTMLConstants

setColumns

public void setColumns(int columns)
                throws PropertyVetoException
Sets the number of columns in the layout. Note that this will not preserve any column alignment or column direction information that was previously set.

Parameters:
columns - The number of columns.
Throws:
PropertyVetoException - If a change is vetoed.

setDirection

public void setDirection(String dir)
                  throws PropertyVetoException
Sets the direction of the text interpretation.

Parameters:
dir - The direction. One of the following constants defined in HTMLConstants: LTR or RTL.
Throws:
PropertyVetoException - If a change is vetoed.
See Also:
HTMLConstants

setLanguage

public void setLanguage(String lang)
                 throws PropertyVetoException
Sets the language of the input tag.

Parameters:
lang - The language. Example language tags include: en and en-US.
Throws:
PropertyVetoException - If a change is vetoed.