org.tigris.swidgets

Class ActionUtilities


public class ActionUtilities
extends java.lang.Object

A collection of utility methods for Swing Actions.
Author:
Eugenio Alvarez

Method Summary

static Container
getActionRoot(ActionEvent ae)
Intended for use inside an actionPerformed method eg:
     public void actionPerformed(ActionEvent ae) {
         Container appRoot = ActionUtilities.getActionRoot(ae);
     }
 
Returns the root object, usually a JFrame, JDialog or JApplet that is the owner of the source event source object (JMenu, JMenuItem, JPopupMenu etc).
static Container
getActionRoot(Object source)
Intended for use inside an actionPerformed method eg:
     public void actionPerformed(ActionEvent e) {
         Container appRoot = ActionUtilities.getActionRoot(e.getSource());
     }
 

Method Details

getActionRoot

public static Container getActionRoot(ActionEvent ae)
Intended for use inside an actionPerformed method eg:
     public void actionPerformed(ActionEvent ae) {
         Container appRoot = ActionUtilities.getActionRoot(ae);
     }
 
Returns the root object, usually a JFrame, JDialog or JApplet that is the owner of the source event source object (JMenu, JMenuItem, JPopupMenu etc).
Parameters:
ae - the given action event
Returns:
the root object

getActionRoot

public static Container getActionRoot(Object source)
Intended for use inside an actionPerformed method eg:
     public void actionPerformed(ActionEvent e) {
         Container appRoot = ActionUtilities.getActionRoot(e.getSource());
     }
 
Parameters:
source - the source of the event
Returns:
the root object, usually a JFrame, JDialog or JApplet that is the owner of the source event source object (JMenu, JMenuItem, JPopupMenu etc). null if none is found.