com.mucommander.ui.action
Class AWTActionProxy

java.lang.Object
  extended by com.mucommander.ui.action.AWTActionProxy
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class AWTActionProxy
extends java.lang.Object
implements java.awt.event.ActionListener

AWTActionProxy acts as a proxy between a given java.awt.event.ActionListener and java.swing.Action, transferring received action events to the Action's actionPerformed method. This class provides an easy way to use java.swing.Action instances in AWT components.

Usage: after creating an AWTActionProxy instance, the addActionListener method must be called on the AWT component which action events are to be proxied, using the AWTActionProxy instance as a parameter.

Author:
Maxence Bernard

Constructor Summary
AWTActionProxy(javax.swing.Action action)
          Creates a new AWTActionProxy instance that will transfer ActionEvents caught by actionPerformed(java.awt.event.ActionEvent) to the specified Action.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent actionEvent)
          Forwards the specified ActionEvent to the proxied Action.
 javax.swing.Action getProxiedAction()
          Returns the Action instance to which the ActionEvents received by actionPerformed(java.awt.event.ActionEvent) are transferred.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AWTActionProxy

public AWTActionProxy(javax.swing.Action action)
Creates a new AWTActionProxy instance that will transfer ActionEvents caught by actionPerformed(java.awt.event.ActionEvent) to the specified Action.

Parameters:
action - the Action instance to transfer the ActionEvents to.
Method Detail

getProxiedAction

public javax.swing.Action getProxiedAction()
Returns the Action instance to which the ActionEvents received by actionPerformed(java.awt.event.ActionEvent) are transferred.


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent actionEvent)
Forwards the specified ActionEvent to the proxied Action.

Specified by:
actionPerformed in interface java.awt.event.ActionListener


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard