com.ibm.as400.vaccess
Class RecordListFormPane

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended bycom.ibm.as400.vaccess.RecordListFormPane
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

Deprecated. Use Java Swing instead, along with the classes in package com.ibm.as400.access

public class RecordListFormPane
extends JComponent
implements Serializable

The RecordListFormPane class represents a form that is filled in with the fields of a file on the server. The form displays one record at a time and provides buttons that allow the user to scroll forward, backward, to the first or last record, or refresh the view of the file.

The data in the form is retrieved from the system (and the GUI fields for the data are created) when load() is called. If load() is not called, the form will be empty.

Users must call close() to ensure that the server resources are properly freed when this form is no longer needed.

Most errors are reported by firing ErrorEvents, rather than throwing exceptions. Users should listen for ErrorEvents in order to diagnose and recover from error conditions.

RecordListFormPane objects generate the following events:

 // Set up table for file contents.
AS400 system = new AS400("MySystem", "Userid", "Password");
String file = "/QSYS.LIB/QGPL.LIB/MyFile.FILE";
final RecordListFormPane pane = new RecordListFormPane(system, file);

 // Set up window to hold table
JFrame frame = new JFrame ("My Window");
WindowListener l = new WindowAdapter()
{
     // Close the model when window is closed.
    public void windowClosing(WindowEvent e)
    {
        pane.close();
    }
};
frame.addWindowListener(l);

// Set up the error dialog adapter.
pane.addErrorListener (new ErrorDialogAdapter (frame));

// Add the component and get data from system.
frame.getContentPane().add(pane);
pane.load();

 // Display the window
frame.setVisible(true)

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static int KEY_EQ
          Deprecated. Constant indicating search type of equal.
static int KEY_GE
          Deprecated. Constant indicating search type of greater than or equal.
static int KEY_GT
          Deprecated. Constant indicating search type of greater than.
static int KEY_LE
          Deprecated. Constant indicating search type of less than or equal.
static int KEY_LT
          Deprecated. Constant indicating search type of less than.
 
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.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
RecordListFormPane()
          Deprecated. Constructs a RecordListFormPane object.
RecordListFormPane(AS400 system, String fileName)
          Deprecated. Constructs a RecordListFormPane object.
RecordListFormPane(AS400 system, String fileName, Object[] key, int searchType)
          Deprecated. Constructs a RecordListFormPane object.
 
Method Summary
 void addActionCompletedListener(ActionCompletedListener listener)
          Deprecated. Adds a listener to be notified when a new record is displayed.
 void addErrorListener(ErrorListener listener)
          Deprecated. Adds a listener to be notified when an error occurs.
 void close()
          Deprecated. Closes the server file this form represents.
 void displayFirst()
          Deprecated. Displays the first record of the record list.
 void displayLast()
          Deprecated. Displays the last record of the record list.
 void displayNext()
          Deprecated. Displays the next record of the record list.
 void displayPrevious()
          Deprecated. Displays the previous record of the record list.
 int getCurrentRecord()
          Deprecated. Returns the index of the record currently being displayed.
 String getFileName()
          Deprecated. Returns the file name.
 Object[] getKey()
          Deprecated. Returns the key.
 boolean getKeyed()
          Deprecated. Returns whether the file will be accessed in key or sequential order.
 String getLabelText(int index)
          Deprecated. Returns the text of the label at the given index.
 int getSearchType()
          Deprecated. Returns the search type.
 String getStringValueAt(int index)
          Deprecated. Returns the string value of the current record at the given index.
 AS400 getSystem()
          Deprecated. Returns the system where the file is located.
 Object getValueAt(int index)
          Deprecated. Returns the value of the current record at the given index.
 void load()
          Deprecated. Refreshes the view based on the state of the system.
 void removeActionCompletedListener(ActionCompletedListener listener)
          Deprecated. Removes a listener from being notified when a new record is displayed.
 void removeErrorListener(ErrorListener listener)
          Deprecated. Removes a listener from being notified when an error occurs.
 void setFileName(String fileName)
          Deprecated. Sets the name of the file.
 void setKey(Object[] key)
          Deprecated. Sets the key.
 void setKeyed(boolean keyed)
          Deprecated. Sets whether the file will be accessed in key or sequential order.
 void setLabelText(int index, String text)
          Deprecated. Sets the text of the label at the given index.
 void setSearchType(int searchType)
          Deprecated. Sets the search type.
 void setSystem(AS400 system)
          Deprecated. Sets the system where the file is located.
 
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, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, updateUI
 
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

KEY_EQ

public static final int KEY_EQ
Deprecated. 
Constant indicating search type of equal.

See Also:
Constant Field Values

KEY_GT

public static final int KEY_GT
Deprecated. 
Constant indicating search type of greater than.

See Also:
Constant Field Values

KEY_GE

public static final int KEY_GE
Deprecated. 
Constant indicating search type of greater than or equal.

See Also:
Constant Field Values

KEY_LT

public static final int KEY_LT
Deprecated. 
Constant indicating search type of less than.

See Also:
Constant Field Values

KEY_LE

public static final int KEY_LE
Deprecated. 
Constant indicating search type of less than or equal.

See Also:
Constant Field Values
Constructor Detail

RecordListFormPane

public RecordListFormPane()
Deprecated. 
Constructs a RecordListFormPane object. This constructor sets the keyed property to false.


RecordListFormPane

public RecordListFormPane(AS400 system,
                          String fileName)
Deprecated. 
Constructs a RecordListFormPane object. This constructor sets the keyed property to false.

Parameters:
system - The system where the file is located.
fileName - The file name. The name is specified as a fully qualified path name in the library file system.

RecordListFormPane

public RecordListFormPane(AS400 system,
                          String fileName,
                          Object[] key,
                          int searchType)
Deprecated. 
Constructs a RecordListFormPane object. This constructor sets the keyed property to true.

Parameters:
system - The system where the file is located.
fileName - The file name. The name is specified as a fully qualified path name in the library file system.
key - The values which make up the key with which to find the record. This value may be null.
searchType - Constant indicating the type of match required.
Method Detail

addActionCompletedListener

public void addActionCompletedListener(ActionCompletedListener listener)
Deprecated. 
Adds a listener to be notified when a new record is displayed. The listener's actionCompleted() method will be called.

Parameters:
listener - The listener.

addErrorListener

public void addErrorListener(ErrorListener listener)
Deprecated. 
Adds a listener to be notified when an error occurs. The listener's errorOccurred() method will be called.

Parameters:
listener - The listener.

close

public void close()
Deprecated. 
Closes the server file this form represents.


displayFirst

public void displayFirst()
Deprecated. 
Displays the first record of the record list.


displayLast

public void displayLast()
Deprecated. 
Displays the last record of the record list.


displayNext

public void displayNext()
Deprecated. 
Displays the next record of the record list. If the last record is being displayed, the first record will be displayed.


displayPrevious

public void displayPrevious()
Deprecated. 
Displays the previous record of the record list. If the first record is being displayed, the last record will be displayed.


getCurrentRecord

public int getCurrentRecord()
Deprecated. 
Returns the index of the record currently being displayed. Indices start at 0, and increment one for each of the records in the list. Note that this is not the same as the record number.

Returns:
The index of the record currently being displayed. If there is no record being displayed, -1 is returned.

getFileName

public String getFileName()
Deprecated. 
Returns the file name. The name is formatted as a fully qualified path name in the library file system.

Returns:
The file name.

getKey

public Object[] getKey()
Deprecated. 
Returns the key. The key is only used if the keyed property is true.

Returns:
The key.

getKeyed

public boolean getKeyed()
Deprecated. 
Returns whether the file will be accessed in key or sequential order.

Returns:
true if the file will be accessed in key order; false if the file will be accessed in sequential order.

getLabelText

public String getLabelText(int index)
Deprecated. 
Returns the text of the label at the given index.

Parameters:
index - The index of the label. Indices start at 0.
Returns:
The text of the label at the given index.

getSearchType

public int getSearchType()
Deprecated. 
Returns the search type. The search type is only used if the keyed property is true and the key property is not null.

Returns:
The search type.

getSystem

public AS400 getSystem()
Deprecated. 
Returns the system where the file is located.

Returns:
The system where the file is located.

getStringValueAt

public String getStringValueAt(int index)
Deprecated. 
Returns the string value of the current record at the given index.

Parameters:
index - The index of the value. Indices start at 0.
Returns:
The value at the given index as a string.

getValueAt

public Object getValueAt(int index)
Deprecated. 
Returns the value of the current record at the given index.

Parameters:
index - Index of the value. Indices start at 0.
Returns:
The value at the given index.

load

public void load()
Deprecated. 
Refreshes the view based on the state of the system. The first record will be displayed. The labels are reconstructed, so any label customization will be lost. The fielName and system properties must be set before this method is called.


removeActionCompletedListener

public void removeActionCompletedListener(ActionCompletedListener listener)
Deprecated. 
Removes a listener from being notified when a new record is displayed.

Parameters:
listener - The listener.

removeErrorListener

public void removeErrorListener(ErrorListener listener)
Deprecated. 
Removes a listener from being notified when an error occurs.

Parameters:
listener - The listener.

setFileName

public void setFileName(String fileName)
                 throws PropertyVetoException
Deprecated. 
Sets the name of the file. This property is bound and constrained. Note that the data in the form will not change until a load() is done.

Parameters:
fileName - The file name. The name is specified as a fully qualified path name in the library file system.
Throws:
PropertyVetoException - If the change is vetoed.

setKey

public void setKey(Object[] key)
            throws PropertyVetoException
Deprecated. 
Sets the key. This property is bound and constrained. Note that the data in the form will not change until a load() is done. The key is only used if the keyed property is true.

Parameters:
key - The values which make up the key with which to find the record. This value may be null.
Throws:
PropertyVetoException - If the change is vetoed.

setKeyed

public void setKeyed(boolean keyed)
              throws PropertyVetoException
Deprecated. 
Sets whether the file will be accessed in key or sequential order. This property is bound and constrained. Note that the data in the form will not change until a load() is done.

Parameters:
keyed - true if the file will be accessed in key order; false if the file will be accessed in sequential order.
Throws:
PropertyVetoException - If the change is vetoed.

setLabelText

public void setLabelText(int index,
                         String text)
Deprecated. 
Sets the text of the label at the given index.

Parameters:
index - The index of the label. Indices start at 0.
text - The text of the label.

setSearchType

public void setSearchType(int searchType)
                   throws PropertyVetoException
Deprecated. 
Sets the search type. This property is bound and constrained. Note that the data in the form will not change until a load() is done. The search type is only used if the keyed property is true and the key property is not null.

Parameters:
searchType - Constant indicating the type of match required.
Throws:
PropertyVetoException - If the change is vetoed.

setSystem

public void setSystem(AS400 system)
               throws PropertyVetoException
Deprecated. 
Sets the system where the file is located. This property is bound and constrained. Note that the data in the form will not change until a load() is done.

Parameters:
system - The system where the file is located.
Throws:
PropertyVetoException - If the change is vetoed.