Interface MenuItem

    • Method Detail

      • getLabel

        java.lang.String getLabel()
        The Label of the menu item.
        Returns:
        The label of the menu item.
      • isVisible

        boolean isVisible​(java.util.List<VertexRef> targets,
                          OperationContext operationContext)
        Defines if the current MenuItem is visible.
        Parameters:
        targets - The current targets (e.g. the selection)
        operationContext - The current OperationContext.
        Returns:
        True if visible, false otherwise.
      • isChecked

        boolean isChecked​(java.util.List<VertexRef> targets,
                          OperationContext operationContext)
        Defines if the current MenuItem is checked. If isCheckable() returns false, this is never called.
        Parameters:
        targets - The current targets (e.g. the selection)
        operationContext - The current OperationContext.
        Returns:
        True if it is checked, false otherwise.
      • setOrder

        void setOrder​(int order)
      • getOrder

        int getOrder()
      • isCheckable

        boolean isCheckable()
        Defines if the current MenuItem is a checkable item.
        Returns:
        true if checkable, false otherwise
        See Also:
        MenuBar.MenuItem.isCheckable()
      • getChildren

        java.util.List<MenuItem> getChildren()
        The MenuItems can be cascaded (allowing a tree).
        Returns:
        the children, or an empty list if no children exits. Must not be null.
      • addChildren

        void addChildren​(MenuItem menuItem)
        Adds a children to the current MenuItem
        Parameters:
        menuItem - the child to add.
      • getCommand

        MenuCommand getCommand()
        Returns the command to execute if the MenuItem is selected. Please Note, that it MUST return null if getChildren() is NOT empty.
        Returns:
        the command to execute if the MenuItem is selected, or null if getChildren() is NOT empty.
      • compareTo

        default int compareTo​(MenuItem other)
        Specified by:
        compareTo in interface java.lang.Comparable<MenuItem>