com.ibm.as400.vaccess
Class CommandCallMenuItem

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.AbstractButton
                          |
                          +--javax.swing.JMenuItem
                                |
                                +--com.ibm.as400.vaccess.CommandCallMenuItem
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, javax.swing.MenuElement, java.io.Serializable, javax.swing.SwingConstants

public class CommandCallMenuItem
extends javax.swing.JMenuItem
implements java.io.Serializable

The CommandCallMenuItem class represents a menu item that calls an AS/400 CL command when selected. Results of the command are returned in a message list.

CommandCallMenuItem objects generate the following events:

See Also:
CommandCall, AS400Message, Serialized Form

Inner classes inherited from class javax.swing.JMenuItem
javax.swing.JMenuItem.AccessibleJMenuItem
 
Inner classes inherited from class javax.swing.AbstractButton
javax.swing.AbstractButton.AccessibleAbstractButton, javax.swing.AbstractButton.ButtonChangeListener
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Fields inherited from class javax.swing.AbstractButton
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
 
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 javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NORTH, NORTH_EAST, NORTH_WEST, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CommandCallMenuItem()
          Constructs a CommandCallMenuItem object.
CommandCallMenuItem(java.lang.String text)
          Constructs a CommandCallMenuItem object.
CommandCallMenuItem(java.lang.String text, javax.swing.Icon icon)
          Constructs a CommandCallMenuItem object.
CommandCallMenuItem(java.lang.String text, javax.swing.Icon icon, AS400 system)
          Constructs a CommandCallMenuItem object.
CommandCallMenuItem(java.lang.String text, javax.swing.Icon icon, AS400 system, java.lang.String command)
          Constructs a CommandCallMenuItem object.
 
Method Summary
 void addActionCompletedListener(ActionCompletedListener listener)
          Adds a listener to be notified when a command has been run on the AS/400.
 void addErrorListener(ErrorListener listener)
          Adds a listener to be notified when an error occurs.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a listener to be notified when the value of any bound property changes.
 void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Adds a listener to be notified when the value of any constrained property changes.
 java.lang.String getCommand()
          Returns the command.
 AS400Message[] getMessageList()
          Returns the message list resulting from the last command that was run.
 java.lang.String getMessageText()
          Returns the text from the first message resulting from the last command that was run.
 AS400 getSystem()
          Returns the AS/400 on which commands are run.
 void removeActionCompletedListener(ActionCompletedListener listener)
          Removes a action completed listener.
 void removeErrorListener(ErrorListener listener)
          Removes an error listener.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a property change listener.
 void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Removes a vetoable change listener.
 void setCommand(java.lang.String command)
          Sets the command that is run when the button is pressed.
 void setSystem(AS400 system)
          Sets the AS/400 on which commands are run.
 
Methods inherited from class javax.swing.JMenuItem
addMenuDragMouseListener, addMenuKeyListener, configurePropertiesFromAction, createActionPropertyChangeListener, fireMenuDragMouseDragged, fireMenuDragMouseEntered, fireMenuDragMouseExited, fireMenuDragMouseReleased, fireMenuKeyPressed, fireMenuKeyReleased, fireMenuKeyTyped, getAccelerator, getAccessibleContext, getComponent, getSubElements, getUIClassID, init, isArmed, menuSelectionChanged, paramString, processKeyEvent, processKeyEvent, processMenuDragMouseEvent, processMenuKeyEvent, processMouseEvent, removeMenuDragMouseListener, removeMenuKeyListener, setAccelerator, setArmed, setEnabled, setUI, updateUI
 
Methods inherited from class javax.swing.AbstractButton
addActionListener, addChangeListener, addItemListener, checkHorizontalKey, checkVerticalKey, createActionListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getDisabledIcon, getDisabledSelectedIcon, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getLabel, getMargin, getMnemonic, getModel, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, isBorderPainted, isContentAreaFilled, isFocusPainted, isFocusTraversable, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setFocusPainted, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setLabel, setMargin, setMnemonic, setMnemonic, setModel, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
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, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, 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, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, 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

CommandCallMenuItem

public CommandCallMenuItem()
Constructs a CommandCallMenuItem object.

CommandCallMenuItem

public CommandCallMenuItem(java.lang.String text)
Constructs a CommandCallMenuItem object.
Parameters:
text - The menu item text, or null if there is no text.

CommandCallMenuItem

public CommandCallMenuItem(java.lang.String text,
                           javax.swing.Icon icon)
Constructs a CommandCallMenuItem object.
Parameters:
text - The menu item text, or null if there is no text.
icon - The menu item icon, or null if there is no icon.

CommandCallMenuItem

public CommandCallMenuItem(java.lang.String text,
                           javax.swing.Icon icon,
                           AS400 system)
Constructs a CommandCallMenuItem object.
Parameters:
text - The menu item text, or null if there is no text.
icon - The menu item icon, or null if there is no icon.
system - The AS/400 on which commands are run.

CommandCallMenuItem

public CommandCallMenuItem(java.lang.String text,
                           javax.swing.Icon icon,
                           AS400 system,
                           java.lang.String command)
Constructs a CommandCallMenuItem object.
Parameters:
text - The menu item text, or null if there is no text.
icon - The menu item icon, or null if there is no icon.
system - The AS/400 on which commands are run.
command - The command.
Method Detail

addActionCompletedListener

public void addActionCompletedListener(ActionCompletedListener listener)
Adds a listener to be notified when a command has been run on the AS/400.
Parameters:
listener - The listener.

addErrorListener

public void addErrorListener(ErrorListener listener)
Adds a listener to be notified when an error occurs.
Parameters:
listener - The listener.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener to be notified when the value of any bound property changes.
Overrides:
addPropertyChangeListener in class javax.swing.JComponent
Parameters:
listener - The listener.

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a listener to be notified when the value of any constrained property changes.
Overrides:
addVetoableChangeListener in class javax.swing.JComponent
Parameters:
listener - The listener.

getCommand

public java.lang.String getCommand()
Returns the command.
Returns:
The command.

getMessageList

public AS400Message[] getMessageList()
Returns the message list resulting from the last command that was run.
Returns:
The message list.

getMessageText

public java.lang.String getMessageText()
Returns the text from the first message resulting from the last command that was run.
Returns:
The message text.

getSystem

public AS400 getSystem()
Returns the AS/400 on which commands are run.
Returns:
The AS400 on which commands are run.

removeActionCompletedListener

public void removeActionCompletedListener(ActionCompletedListener listener)
Removes a action completed listener.
Parameters:
listener - The listener.

removeErrorListener

public void removeErrorListener(ErrorListener listener)
Removes an error listener.
Parameters:
listener - The listener.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a property change listener.
Overrides:
removePropertyChangeListener in class javax.swing.JComponent
Parameters:
listener - The listener.

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes a vetoable change listener.
Overrides:
removeVetoableChangeListener in class javax.swing.JComponent
Parameters:
listener - The listener.

setCommand

public void setCommand(java.lang.String command)
                throws java.beans.PropertyVetoException
Sets the command that is run when the button is pressed.
Parameters:
command - The command that is run when the button is pressed.
Throws:
java.beans.PropertyVetoException - If the change is vetoed.

setSystem

public void setSystem(AS400 system)
               throws java.beans.PropertyVetoException
Sets the AS/400 on which commands are run.
Parameters:
system - The AS/400 on which commands are run.
Throws:
java.beans.PropertyVetoException - If the change is vetoed.