com.ibm.as400.vaccess
Class VActionAdapter
- java.lang.Object
-
- com.ibm.as400.vaccess.VActionAdapter
-
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.io.Serializable, java.util.EventListener, javax.swing.Action
Deprecated.Use Java Swing instead, along with the classes in package com.ibm.as400.access
public class VActionAdapter extends java.lang.Object implements javax.swing.Action, java.io.Serializable
The VActionAdapter class represents an object that listens for action events and subsequently performs a VAction.A VActionAdapter object is useful when an action listener is needed to perform a VAction. For example, this can be used to as an action listener for button clicks or menu item selections.
This class essentially adapts the VAction class hierarchy to the javax.swing.Action class hierarchy.
The following example creates an action adapter which is used to put up a properties pane for a directory in the integrated file system. The action adapter is then attached to a menu item, so that the action is performed when the menu item is selected.
// Set up the directory object. AS400 system = new AS400 ("MySystem", "Userid", "Password"); VIFSDirectory directory = new VIFSDirectory (system, "/myDirectory");
// Set up a pane and add it to a frame. AS400ExplorerPane pane = new AS400ExplorerPane (directory); JFrame frame = new JFrame ("My Window"); frame.getContentPane().add(new JScrollPane(pane));
// Set up the properties action adapter. VActionAdapter adapter = new VActionAdapter (directory, new VPropertiesAction (), pane.getActionContext ());
// Set up the menu item. JMenuItem menuItem = new JMenuItem ("Properties"); menuItem.setEnabled (true); menuItem.addActionListener (adapter);- See Also:
VAction
, Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description VActionAdapter()
Deprecated.Constructs a VActionAdapter object.VActionAdapter(VAction action, VActionContext actionContext)
Deprecated.Constructs a VActionAdapter object.
-
Method Summary
Methods Modifier and Type Method and Description void
actionPerformed(java.awt.event.ActionEvent event)
Deprecated.Invoked when an action is performed.void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated.Adds a listener to be notified when the value of any bound property changes.VAction
getAction()
Deprecated.Returns the action with which the action adapter is associated.VActionContext
getActionContext()
Deprecated.Returns the context in which the associated action will be performed.java.lang.Object
getValue(java.lang.String key)
Deprecated.Returns the value of the property associated with the given key.boolean
isEnabled()
Deprecated.Indicates if the action is enabled.void
putValue(java.lang.String key, java.lang.Object value)
Deprecated.Sets the value of the property associated with the given key.void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated.Removes a property change listener.void
setAction(VAction action)
Deprecated.Sets the action with which the action adapter is associated.void
setActionContext(VActionContext actionContext)
Deprecated.Sets the context in which the associated action will be performed.void
setEnabled(boolean enabled)
Deprecated.Sets the enabled state of the action.
-
-
-
Constructor Detail
-
VActionAdapter
public VActionAdapter()
Deprecated.Constructs a VActionAdapter object.
-
VActionAdapter
public VActionAdapter(VAction action, VActionContext actionContext)
Deprecated.Constructs a VActionAdapter object.- Parameters:
action
- The action.actionContext
- The action context.
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
Deprecated.Invoked when an action is performed. This will cause the specified event to also be performed.- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Parameters:
event
- The event.
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated.Adds a listener to be notified when the value of any bound property changes.- Specified by:
addPropertyChangeListener
in interfacejavax.swing.Action
- Parameters:
listener
- The listener.
-
getAction
public VAction getAction()
Deprecated.Returns the action with which the action adapter is associated.- Returns:
- The action, or null if none has been set.
-
getActionContext
public VActionContext getActionContext()
Deprecated.Returns the context in which the associated action will be performed.- Returns:
- The action context, or null if none has been set.
-
getValue
public java.lang.Object getValue(java.lang.String key)
Deprecated.Returns the value of the property associated with the given key.- Specified by:
getValue
in interfacejavax.swing.Action
- Parameters:
key
- The key.- Returns:
- The value.
-
isEnabled
public boolean isEnabled()
Deprecated.Indicates if the action is enabled.- Specified by:
isEnabled
in interfacejavax.swing.Action
- Returns:
- true if the action is enabled; false otherwise.
-
putValue
public void putValue(java.lang.String key, java.lang.Object value)
Deprecated.Sets the value of the property associated with the given key.- Specified by:
putValue
in interfacejavax.swing.Action
- Parameters:
key
- The key.value
- The value of the property.
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated.Removes a property change listener.- Specified by:
removePropertyChangeListener
in interfacejavax.swing.Action
- Parameters:
listener
- The listener.
-
setAction
public void setAction(VAction action)
Deprecated.Sets the action with which the action adapter is associated.- Parameters:
action
- The action.
-
setActionContext
public void setActionContext(VActionContext actionContext)
Deprecated.Sets the context in which the associated action will be performed.- Parameters:
actionContext
- The action context.
-
setEnabled
public void setEnabled(boolean enabled)
Deprecated.Sets the enabled state of the action.- Specified by:
setEnabled
in interfacejavax.swing.Action
- Parameters:
enabled
- true if the action is enabled; false otherwise.
-
-