Class AbstractFlowEditorMenuItem

    • Field Detail

      • m_MenuItem

        protected JMenuItem m_MenuItem
        the underlying menuitem.
      • m_SubMenu

        protected JMenu m_SubMenu
        the underlying submenu.
    • Constructor Detail

      • AbstractFlowEditorMenuItem

        protected AbstractFlowEditorMenuItem()
        Initializes the menu item.
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the menu item.
      • hasAction

        public boolean hasAction()
        Returns whether the menu item is based on an action.
        Default implementation returns true.
        Returns:
        true if action-based
      • newAction

        protected abstract AbstractBaseAction newAction()
        Creates the action to use.
        Returns:
        the action
      • getAction

        public AbstractBaseAction getAction()
        Returns the action to add to the flow editor menu.
        Returns:
        the action to add
        See Also:
        hasAction()
      • hasMenuItem

        public boolean hasMenuItem()
        Returns whether the menu item is based on a menuitem.
        Default implementation returns false.
        Returns:
        true if menuitem-based
      • newMenuItem

        protected JMenuItem newMenuItem()
        Creates the menuitem to use.
        Default implementation returns null.
        Returns:
        the menuitem
      • getMenuItem

        public JMenuItem getMenuItem()
        Returns the menuitem to add to the flow editor menu.
        Returns:
        the menuitem to add
        See Also:
        hasMenuItem()
      • hasSubMenu

        public boolean hasSubMenu()
        Returns whether the menu item is based on a submenu.
        Default implementation returns false.
        Returns:
        true if submenu-based
      • newSubMenu

        protected JMenu newSubMenu()
        Creates the submenu to use.
        Default implementation returns null.
        Returns:
        the submenu
      • getSubMenu

        public JMenu getSubMenu()
        Returns the submenu to add to the flow editor menu.
        Returns:
        the submenu to add
        See Also:
        hasSubMenu()
      • setOwner

        public void setOwner​(FlowEditorPanel value)
        Sets the owning flow editor.
        Parameters:
        value - the owner
      • getOwner

        public FlowEditorPanel getOwner()
        Returns the owner.
        Returns:
        the owner, null if none set
      • update

        public abstract void update()
        Updating the action/menuitem/submenu, based on the current status of the owner.
      • determineCaption

        protected String determineCaption​(AbstractFlowEditorMenuItem item)
        Determines the caption of the menu item.
        Parameters:
        item - the item
        Returns:
        the caption, empty string if unable to find one
      • compareTo

        public int compareTo​(AbstractFlowEditorMenuItem o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

        Uses the name of the menu item text for comparison.
        Specified by:
        compareTo in interface Comparable<AbstractFlowEditorMenuItem>
        Parameters:
        o - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
      • equals

        public boolean equals​(Object o)
        Returns whether the two objects are the same.

        Only compares the menu item text of the two objects.
        Overrides:
        equals in class Object
        Parameters:
        o - the object to be compared
        Returns:
        true if the object is the same as this one
      • getMenuItems

        public static Class[] getMenuItems()
        Returns a list with classnames of menu items.
        Returns:
        the menu item classnames