|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--com.ibm.as400.vaccess.ResourceListPane
The ResourceListPane class represents a graphical user interface
that presents the contents of a
ResourceList
in a list. Every item represents a
Resource
from the
list. You must explicitly call load()
to load the information from the resource list.
Pop-up menus are enabled by default. The pop-up menus will contain a single "Properties" menu item which, when selected, presents one of the following Properties dialogs:
Most errors are reported as ErrorEvents rather than throwing exceptions. Users should listen for ErrorEvents in order to diagnose and recover from error conditions.
ResourceListPane objects generate the following events:
The following example creates a list pane filled with the list of messages in a message queue.
// Create the resource list. This example creates // a list of all messages in a message queue. AS400 system = new AS400("MYSYSTEM", "MYUSERID", "MYPASSWORD"); RMessageQueue mq = new RMessageQueue(system, "/QSYS.LIB/MYLIB.LIB/MYMQ.MSGQ");
// Create the ResourceListPane. ResourceListPane listPane = new ResourceListPane(); listPane.setResourceList(mq);
// Add the ResourceListPane to a JFrame and show it. JFrame frame = new JFrame("My Window"); frame.getContentPane().add(listPane); frame.pack(); frame.show();
// The ResourceListPane will appear empty until we // load it. This gives us control of when the list // of messages is retrieved from the AS/400. listPane.load();
ResourceListModel
, Serialized FormInner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
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 |
Constructor Summary | |
ResourceListPane()
Constructs a ResourceListPane object. |
|
ResourceListPane(ResourceList resourceList,
ResourceProperties resourceProperties)
Constructs a ResourceListPane object. |
Method Summary | |
void |
addErrorListener(ErrorListener listener)
Adds a listener to be notified when an error occurs. |
void |
addListSelectionListener(javax.swing.event.ListSelectionListener listener)
Adds a listener to be notified when a list selection occurs. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener to be notified when the value of any bound property changes. |
boolean |
getAllowActions()
Indicates if pop-up menus are enabled. |
javax.swing.ListModel |
getModel()
Returns the list model. |
Resource |
getResourceAtPoint(java.awt.Point point)
Returns the resource that corresponds to the row located at the specified point. |
ResourceList |
getResourceList()
Returns the resource list from which all information for the model is gathered. |
ResourceProperties |
getResourceProperties()
Returns the resource properties. |
Resource |
getSelectedResource()
Returns the first selected resource. |
Resource[] |
getSelectedResources()
Returns the selected resources. |
javax.swing.ListSelectionModel |
getSelectionModel()
Returns the selection model that is used to maintain selection state. |
int |
getVisibleRowCount()
Returns the preferred number of visible rows. |
boolean |
isSelected(Resource resource)
Indicates if the resource is selected. |
void |
load()
Loads the information from the resource list. |
void |
removeErrorListener(ErrorListener listener)
Removes an error listener. |
void |
removeListSelectionListener(javax.swing.event.ListSelectionListener listener)
Removes a list selection listener. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a property change listener. |
void |
setAllowActions(boolean allowActions)
Sets whether pop-up menus are enabled. |
void |
setResourceList(ResourceList resourceList)
Sets the resource list from which all information for the model is gathered. |
void |
setResourceProperties(ResourceProperties resourceProperties)
Sets the resource properties. |
void |
setSelectionModel(javax.swing.ListSelectionModel selectionModel)
Sets the selection model that is used to maintain selection state. |
void |
setVisibleRowCount(int visibleRowCount)
Sets the preferred number of visible rows. |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getAccessibleContext,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getUIClassID,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paint,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
paramString,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
unregisterKeyboardAction,
update,
updateUI |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public ResourceListPane()
public ResourceListPane(ResourceList resourceList, ResourceProperties resourceProperties)
resourceList
- The resource list.resourceProperties
- The resource properties.Method Detail |
public void addErrorListener(ErrorListener listener)
listener
- The listener.public void addListSelectionListener(javax.swing.event.ListSelectionListener listener)
listener
- The listener.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener.public boolean getAllowActions()
public javax.swing.ListModel getModel()
public Resource getResourceAtPoint(java.awt.Point point)
point
- The point.public ResourceList getResourceList()
public ResourceProperties getResourceProperties()
public Resource getSelectedResource()
getSelectionModel()
,
setSelectionModel(javax.swing.ListSelectionModel)
public Resource[] getSelectedResources()
getSelectionModel()
,
setSelectionModel(javax.swing.ListSelectionModel)
public javax.swing.ListSelectionModel getSelectionModel()
public int getVisibleRowCount()
public boolean isSelected(Resource resource)
resource
- The resource.getSelectionModel()
,
setSelectionModel(javax.swing.ListSelectionModel)
public void load()
public void removeErrorListener(ErrorListener listener)
listener
- The listener.public void removeListSelectionListener(javax.swing.event.ListSelectionListener listener)
listener
- The listener.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener.public void setAllowActions(boolean allowActions)
true
- to enable pop-up menus, false otherwise.
The default is true.public void setResourceList(ResourceList resourceList)
resourceList
- The resource list from which all information for the model is gathered.public void setResourceProperties(ResourceProperties resourceProperties)
resourceProperties
- The resource properties.public void setSelectionModel(javax.swing.ListSelectionModel selectionModel)
selectionModel
- The selection model.public void setVisibleRowCount(int visibleRowCount)
visibleRowCount
- The preferred number of visible rows.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |