Class MenuAction

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, java.util.EventListener, javax.swing.Action, javax.swing.event.MenuListener, javax.swing.event.PopupMenuListener
    Direct Known Subclasses:
    MDMenuAction

    @OpenApiAll
    public class MenuAction
    extends ActionsCategory
    implements javax.swing.event.PopupMenuListener, javax.swing.event.MenuListener
    This class represents special kind of action. It can behave as normal actions category, but has methods which informs action about menu created from this action selecting /deselecting.
    See Also:
    Serialized Form
    • Constructor Detail

      • MenuAction

        public MenuAction​(@CheckForNull
                          java.lang.String id,
                          @CheckForNull
                          java.lang.String name)
        Construct a menu action with id and name
        Parameters:
        id - the id of the category.
        name - the name of the category.
      • MenuAction

        public MenuAction​(@CheckForNull
                          java.lang.String id,
                          @CheckForNull
                          java.lang.String name,
                          @CheckForNull
                          javax.swing.KeyStroke stroke)
        Creates menu action with given id, name, and KeyStroke.
        Parameters:
        id - the id of the category.
        name - the name of the category.
        stroke - key stroke used for invoking action category.
      • MenuAction

        public MenuAction​(@CheckForNull
                          java.lang.String id,
                          @CheckForNull
                          java.lang.String name,
                          @CheckForNull
                          javax.swing.KeyStroke stroke,
                          @CheckForNull
                          java.lang.String group)
        Creates menu action with given id, name, and KeyStroke.
        Parameters:
        id - the id of the category.
        name - the name of the category.
        stroke - key stroke used for invoking action category.
        group - the name of the related commands group.
      • MenuAction

        public MenuAction​(@CheckForNull
                          java.lang.String id,
                          @CheckForNull
                          java.lang.String name,
                          int keyCode)
        Creates menu action with given id, name, and key code.
        Parameters:
        id - the id of the category.
        name - the name of the category.
        keyCode - key stroke used for invoking action category.
      • MenuAction

        public MenuAction​(@CheckForNull
                          java.lang.String id,
                          @CheckForNull
                          java.lang.String name,
                          int keyCode,
                          java.lang.String group)
        Creates menu action with given id, name, and key code.
        Parameters:
        id - the id of the category.
        name - the name of the category.
        keyCode - key stroke used for invoking action category.
        group - the name of the related commands group.
    • Method Detail

      • menuSelected

        public void menuSelected​(javax.swing.event.MenuEvent e)
        Invoked when a menu is selected.
        Specified by:
        menuSelected in interface javax.swing.event.MenuListener
        Parameters:
        e - an MenuEvent object
      • menuDeselected

        public void menuDeselected​(javax.swing.event.MenuEvent e)
        Specified by:
        menuDeselected in interface javax.swing.event.MenuListener
      • menuCanceled

        public void menuCanceled​(javax.swing.event.MenuEvent e)
        Specified by:
        menuCanceled in interface javax.swing.event.MenuListener
      • popupMenuWillBecomeVisible

        public void popupMenuWillBecomeVisible​(javax.swing.event.PopupMenuEvent e)
        Specified by:
        popupMenuWillBecomeVisible in interface javax.swing.event.PopupMenuListener
      • popupMenuWillBecomeInvisible

        public void popupMenuWillBecomeInvisible​(javax.swing.event.PopupMenuEvent e)
        Specified by:
        popupMenuWillBecomeInvisible in interface javax.swing.event.PopupMenuListener
      • popupMenuCanceled

        public void popupMenuCanceled​(javax.swing.event.PopupMenuEvent e)
        Specified by:
        popupMenuCanceled in interface javax.swing.event.PopupMenuListener