com.ibm.as400.vaccess
Class RecordListTablePane
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- com.ibm.as400.vaccess.RecordListTablePane
-
- All Implemented Interfaces:
- java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Deprecated.Use Java Swing instead, along with the classes in package com.ibm.as400.access
public class RecordListTablePane extends javax.swing.JComponent implements java.io.Serializable
The RecordListTablePane class represents a table that contains the records and fields of a file using record-level access.The data in the table is retrieved from the system when load() is called. If load() is not called, the table will be empty.
Users must call close() to ensure that the system resources are properly freed when this table 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.
The data in this table is not editable, the individual cell values cannot be changed.
RecordListTablePane objects generate the following events:
- ErrorEvent
- ListSelectionEvent
- PropertyChangeEvent
// Set up table for file contents. AS400 system = new AS400("MySystem", "Userid", "Password"); String file = "/QSYS.LIB/QGPL.LIB/MyFile.FILE"; final RecordListTablePane pane = new RecordListTablePane(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/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field and Description 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
-
-
Constructor Summary
Constructors Constructor and Description RecordListTablePane()
Deprecated.Constructs a RecordListTablePane object.RecordListTablePane(AS400 system, java.lang.String fileName)
Deprecated.Constructs a RecordListTablePane object.RecordListTablePane(AS400 system, java.lang.String fileName, java.lang.Object[] key, int searchType)
Deprecated.Constructs a RecordListTablePane object.
-
Method Summary
Methods Modifier and Type Method and Description void
addErrorListener(ErrorListener listener)
Deprecated.Adds a listener to be notified when an error occurs.void
addListSelectionListener(javax.swing.event.ListSelectionListener listener)
Deprecated.Adds a listener to be notified when the selection changes.void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated.Adds a listener to be notified when the value of any bound property is changed.void
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Deprecated.Adds a listener to be notified when the value of any constrained property is changed.void
close()
Deprecated.Closes the file this table represents.javax.swing.table.TableColumnModel
getColumnModel()
Deprecated.Returns the column model for this table.java.lang.String
getColumnTitle(int columnIndex)
Deprecated.Returns the title of a column.int
getColumnWidth(int columnIndex)
Deprecated.Returns the width of a column.RecordListTableModel
getDataModel()
Deprecated.Returns the data model for the table.java.lang.String
getFileName()
Deprecated.Returns the file name.java.awt.Color
getGridColor()
Deprecated.Returns the color used to draw grid lines.java.lang.Object[]
getKey()
Deprecated.Returns the key.boolean
getKeyed()
Deprecated.Returns whether the file will be accessed in key or sequential order.int
getSearchType()
Deprecated.Returns the search type.javax.swing.ListSelectionModel
getSelectionModel()
Deprecated.Returns the ListSelectionModel that is used to maintain row selection state.boolean
getShowHorizontalLines()
Deprecated.Returns whether horizontal lines are drawn between rows.boolean
getShowVerticalLines()
Deprecated.Returns whether vertical lines are drawn between columns.java.lang.String
getStringValueAt(int rowIndex, int columnIndex)
Deprecated.Returns the string value at the specifed row and column.AS400
getSystem()
Deprecated.Returns the system where the file is located.java.lang.Object
getValueAt(int rowIndex, int columnIndex)
Deprecated.Returns the value at the specifed row and column.void
load()
Deprecated.Loads the table based on the state of the system.void
moveColumn(int columnIndex, int newIndex)
Deprecated.Moves the column and heading at columnIndex to newIndex.void
refreshHeadings()
Deprecated.Updates the table header to match the data.void
removeColumn(int columnIndex)
Deprecated.Removes a column from the table.void
removeErrorListener(ErrorListener listener)
Deprecated.Removes a listener from being notified when an error occurs.void
removeListSelectionListener(javax.swing.event.ListSelectionListener listener)
Deprecated.Removes a listener from being notified when the selection changes.void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated.Removes a listener from being notified when the value of any bound property is changed.void
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Deprecated.Removes a listener from being notified when the value of any constrained property is changed.void
setColumnTitle(int columnIndex, java.lang.String title)
Deprecated.Sets the title of a column.void
setColumnWidth(int columnIndex, int width)
Deprecated.Sets the width of a column.void
setFileName(java.lang.String fileName)
Deprecated.Sets the name of the file.void
setGridColor(java.awt.Color color)
Deprecated.Sets the color used to draw grid lines.void
setKey(java.lang.Object[] key)
Deprecated.Sets the key.void
setKeyed(boolean keyed)
Deprecated.Sets whether the file will be accessed in key or sequential order.void
setSearchType(int searchType)
Deprecated.Sets the search type.void
setSelectionModel(javax.swing.ListSelectionModel model)
Deprecated.Sets the ListSelectionModel that is used to maintain row selection state.void
setShowHorizontalLines(boolean show)
Deprecated.Sets whether horizontal lines are drawn between rows.void
setShowVerticalLines(boolean show)
Deprecated.Sets whether vertical lines are drawn between columns.void
setSystem(AS400 system)
Deprecated.Sets the system where the file is located.-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, 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
-
-
-
-
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
-
RecordListTablePane
public RecordListTablePane()
Deprecated.Constructs a RecordListTablePane object. This constructor sets the keyed property to false.
-
RecordListTablePane
public RecordListTablePane(AS400 system, java.lang.String fileName)
Deprecated.Constructs a RecordListTablePane 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.
-
RecordListTablePane
public RecordListTablePane(AS400 system, java.lang.String fileName, java.lang.Object[] key, int searchType)
Deprecated.Constructs a RecordListTablePane object. This constructor sets the keyed property to true.- Parameters:
system
- The system where the file is located.fileName
- The keyed 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
-
addErrorListener
public void addErrorListener(ErrorListener listener)
Deprecated.Adds a listener to be notified when an error occurs.- Parameters:
listener
- The listener.
-
addListSelectionListener
public void addListSelectionListener(javax.swing.event.ListSelectionListener listener)
Deprecated.Adds a listener to be notified when the selection changes.- Parameters:
listener
- The listener.
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated.Adds a listener to be notified when the value of any bound property is changed.- Overrides:
addPropertyChangeListener
in classjava.awt.Container
- Parameters:
listener
- The listener.
-
addVetoableChangeListener
public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Deprecated.Adds a listener to be notified when the value of any constrained property is changed.- Overrides:
addVetoableChangeListener
in classjavax.swing.JComponent
- Parameters:
listener
- The listener.
-
close
public void close()
Deprecated.Closes the file this table represents.
-
getColumnModel
public javax.swing.table.TableColumnModel getColumnModel()
Deprecated.Returns the column model for this table.- Returns:
- The model for this table's columns.
-
getColumnTitle
public java.lang.String getColumnTitle(int columnIndex)
Deprecated.Returns the title of a column. This is used for the table column heading. If an error occurs, null is returned.- Parameters:
columnIndex
- The index of the column. Indices start at 0.- Returns:
- The title of the column.
-
getColumnWidth
public int getColumnWidth(int columnIndex)
Deprecated.Returns the width of a column. If an error occurs, 0 is returned.- Parameters:
columnIndex
- The index of the column. Indices start at 0.- Returns:
- The width of the column.
-
getDataModel
public RecordListTableModel getDataModel()
Deprecated.Returns the data model for the table.- Returns:
- The data model for the table.
-
getFileName
public java.lang.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.
-
getGridColor
public java.awt.Color getGridColor()
Deprecated.Returns the color used to draw grid lines.- Returns:
- The color used to draw grid lines.
-
getKey
public java.lang.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.
-
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.
-
getSelectionModel
public javax.swing.ListSelectionModel getSelectionModel()
Deprecated.Returns the ListSelectionModel that is used to maintain row selection state.- Returns:
- The model that provides row selection state.
-
getShowHorizontalLines
public boolean getShowHorizontalLines()
Deprecated.Returns whether horizontal lines are drawn between rows.- Returns:
- true if horizontal lines are to be drawn; false otherwise.
-
getShowVerticalLines
public boolean getShowVerticalLines()
Deprecated.Returns whether vertical lines are drawn between columns.- Returns:
- true if vertical lines are to be drawn; false otherwise.
-
getSystem
public AS400 getSystem()
Deprecated.Returns the system where the file is located.- Returns:
- The system where the file is located.
-
getStringValueAt
public java.lang.String getStringValueAt(int rowIndex, int columnIndex)
Deprecated.Returns the string value at the specifed row and column. Indices start at 0. If an error occurs, null is returned.- Parameters:
rowIndex
- The row index.columnIndex
- The column index.- Returns:
- The value at the specified row and column as a string.
-
getValueAt
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
Deprecated.Returns the value at the specifed row and column. Indices start at 0. If an error occurs, null is returned.- Parameters:
rowIndex
- The row index.columnIndex
- The column index.- Returns:
- The value at the specified row and column.
-
load
public void load()
Deprecated.Loads the table based on the state of the system. The fileName and system properties must be set before this method is called. The table heading is reconstructed to ensure it matches the data, so any column customization will be lost.
-
moveColumn
public void moveColumn(int columnIndex, int newIndex)
Deprecated.Moves the column and heading at columnIndex to newIndex. The old column at columnIndex will now be found at newIndex, the column that used to be at newIndex is shifted left or right to make room. Indices start at 0.- Parameters:
columnIndex
- The index of column to be moved.newIndex
- The new index to move the column to.
-
refreshHeadings
public void refreshHeadings()
Deprecated.Updates the table header to match the data. Any column customization will be lost.
-
removeColumn
public void removeColumn(int columnIndex)
Deprecated.Removes a column from the table.- Parameters:
columnIndex
- The index of column. Indices start at 0.
-
removeErrorListener
public void removeErrorListener(ErrorListener listener)
Deprecated.Removes a listener from being notified when an error occurs.- Parameters:
listener
- The listener.
-
removeListSelectionListener
public void removeListSelectionListener(javax.swing.event.ListSelectionListener listener)
Deprecated.Removes a listener from being notified when the selection changes.- Parameters:
listener
- The listener.
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated.Removes a listener from being notified when the value of any bound property is changed.- Overrides:
removePropertyChangeListener
in classjava.awt.Component
- Parameters:
listener
- The listener.
-
removeVetoableChangeListener
public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Deprecated.Removes a listener from being notified when the value of any constrained property is changed.- Overrides:
removeVetoableChangeListener
in classjavax.swing.JComponent
- Parameters:
listener
- The listener.
-
setColumnTitle
public void setColumnTitle(int columnIndex, java.lang.String title)
Deprecated.Sets the title of a column. This is used for the table column heading.- Parameters:
columnIndex
- The index of column. Indices start at 0.title
- The title of the column.
-
setColumnWidth
public void setColumnWidth(int columnIndex, int width)
Deprecated.Sets the width of a column.- Parameters:
columnIndex
- The index of column. Indices start at 0.width
- The column width.
-
setFileName
public void setFileName(java.lang.String fileName) throws java.beans.PropertyVetoException
Deprecated.Sets the name of the file. This property is bound and constrained. Note that the data in the table 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:
java.beans.PropertyVetoException
- If the change is vetoed.
-
setGridColor
public void setGridColor(java.awt.Color color)
Deprecated.Sets the color used to draw grid lines.- Parameters:
color
- The color used to draw the grid lines.
-
setKey
public void setKey(java.lang.Object[] key) throws java.beans.PropertyVetoException
Deprecated.Sets the key. This property is bound and constrained. Note that the data in the table 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:
java.beans.PropertyVetoException
- If the change is vetoed.
-
setKeyed
public void setKeyed(boolean keyed) throws java.beans.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 table 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:
java.beans.PropertyVetoException
- If the change is vetoed.
-
setSearchType
public void setSearchType(int searchType) throws java.beans.PropertyVetoException
Deprecated.Sets the search type. This property is bound and constrained. Note that the data in the table 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:
java.beans.PropertyVetoException
- If the change is vetoed.
-
setSelectionModel
public void setSelectionModel(javax.swing.ListSelectionModel model)
Deprecated.Sets the ListSelectionModel that is used to maintain row selection state.- Parameters:
model
- The model that provides the row selection state.
-
setShowHorizontalLines
public void setShowHorizontalLines(boolean show)
Deprecated.Sets whether horizontal lines are drawn between rows.- Parameters:
show
- true if horizontal lines are to be drawn; false otherwise.
-
setShowVerticalLines
public void setShowVerticalLines(boolean show)
Deprecated.Sets whether vertical lines are drawn between columns.- Parameters:
show
- true if vertical lines are to be drawn; false otherwise.
-
setSystem
public void setSystem(AS400 system) throws java.beans.PropertyVetoException
Deprecated.Sets the system where the file is located. This property is bound and constrained. Note that the data in the table will not change until a load() is done.- Parameters:
system
- The system where the file is located.- Throws:
java.beans.PropertyVetoException
- If the change is vetoed.
-
-