ptolemy.vergil.toolbox
Class MenuActionFactory

java.lang.Object
  extended byptolemy.vergil.toolbox.MenuActionFactory
All Implemented Interfaces:
MenuItemFactory

public class MenuActionFactory
extends java.lang.Object
implements MenuItemFactory

A factory that adds a given action a given context menu.

Since:
Ptolemy II 1.0
Version:
$Id: MenuActionFactory.java,v 1.17 2004/04/13 05:12:44 cxh Exp $
Author:
Steve Neuendorffer
Accepted Rating:
Red (johnr)
Proposed Rating:
Red (eal)

Constructor Summary
MenuActionFactory(javax.swing.Action action)
           
 
Method Summary
 javax.swing.JMenuItem create(JContextMenu menu, NamedObj object)
          Add an item to the given context menu that will configure the parameters on the given target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuActionFactory

public MenuActionFactory(javax.swing.Action action)
Method Detail

create

public javax.swing.JMenuItem create(JContextMenu menu,
                                    NamedObj object)
Add an item to the given context menu that will configure the parameters on the given target.

Specified by:
create in interface MenuItemFactory
Parameters:
menu - The context menu to add to.
object - The object that the menu item command will operate on.
Returns:
A menu item, or null to decline to provide a menu item.