Class PopupMenuHandler


  • public class PopupMenuHandler
    extends java.lang.Object
    Handler to ease management of actions in different popup menus.
    Since:
    5821
    • Constructor Summary

      Constructors 
      Constructor Description
      PopupMenuHandler​(javax.swing.JPopupMenu menu)
      Constructs a new RelationActionMenuHandler for the specified popup menu.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.swing.JMenuItem addAction​(javax.swing.Action a)
      Appends a new menu item to the end of the menu which dispatches the specified Action object.
      void addListener​(javax.swing.event.PopupMenuListener l)
      Adds a PopupMenu listener.
      void addSeparator()
      Appends a new separator at the end of the menu.
      java.util.Collection<IPrimitiveAction> getPrimitiveActions()
      Returns all enabled primitive actions.
      void removeAction​(javax.swing.Action a)
      Removes the menu item which dispatches the specified Action object.
      void removeListener​(javax.swing.event.PopupMenuListener l)
      Removes a PopupMenu listener.
      void setPrimitives​(java.util.Collection<? extends IPrimitive> primitives)
      Specifies the working set of primitives for all primitive actions.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PopupMenuHandler

        public PopupMenuHandler​(javax.swing.JPopupMenu menu)
        Constructs a new RelationActionMenuHandler for the specified popup menu.
        Parameters:
        menu - The menu to be managed
    • Method Detail

      • addSeparator

        public void addSeparator()
        Appends a new separator at the end of the menu.
        See Also:
        JPopupMenu.addSeparator()
      • addAction

        public javax.swing.JMenuItem addAction​(javax.swing.Action a)
        Appends a new menu item to the end of the menu which dispatches the specified Action object.
        Parameters:
        a - the Action to add to the menu
        Returns:
        the new menu item
        See Also:
        JPopupMenu.add(Action)
      • removeAction

        public void removeAction​(javax.swing.Action a)
        Removes the menu item which dispatches the specified Action object.
        Parameters:
        a - the Action to remove from the menu
        See Also:
        JPopupMenu.remove(int)
      • addListener

        public void addListener​(javax.swing.event.PopupMenuListener l)
        Adds a PopupMenu listener.
        Parameters:
        l - the PopupMenuListener to add
        See Also:
        JPopupMenu.addPopupMenuListener(javax.swing.event.PopupMenuListener)
      • removeListener

        public void removeListener​(javax.swing.event.PopupMenuListener l)
        Removes a PopupMenu listener.
        Parameters:
        l - the PopupMenuListener to remove
        See Also:
        JPopupMenu.removePopupMenuListener(javax.swing.event.PopupMenuListener)