rvl.piface
Class PiActionAdapter

java.lang.Object
  |
  +--rvl.piface.PiActionAdapter
All Implemented Interfaces:
ActionComponent, java.awt.event.ActionListener, java.util.EventListener, PiComponent

public class PiActionAdapter
extends java.lang.Object
implements ActionComponent, java.awt.event.ActionListener

The purpose of this class is to make it easy to write a Piface-style event handler for any Component that creates an ActionEvent.


Constructor Summary
PiActionAdapter(java.lang.String methodName, java.awt.Component component)
          Simplified constructor where the label is set equal to methodName
PiActionAdapter(java.lang.String methodName, java.lang.String label, java.awt.Component component)
          Constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
           
 void addActionListener(java.awt.event.ActionListener al)
           
 java.lang.String getLabel()
           
 java.lang.String getName()
           
 void setName(java.lang.String methodName, java.lang.String label)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PiActionAdapter

public PiActionAdapter(java.lang.String methodName,
                       java.lang.String label,
                       java.awt.Component component)
Constructor
Parameters:
methodName - The Piface method that is called when an action is generated
label - Available to even handler via getLabel()
component - The component to register as an ActionComponent.
See Also:
getLabel()

PiActionAdapter

public PiActionAdapter(java.lang.String methodName,
                       java.awt.Component component)
Simplified constructor where the label is set equal to methodName
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface PiComponent

getLabel

public java.lang.String getLabel()
Specified by:
getLabel in interface PiComponent

setName

public void setName(java.lang.String methodName,
                    java.lang.String label)
Specified by:
setName in interface PiComponent

addActionListener

public void addActionListener(java.awt.event.ActionListener al)
Specified by:
addActionListener in interface PiComponent

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Specified by:
actionPerformed in interface java.awt.event.ActionListener