Class JComponentList.LabelListItem

    • Constructor Detail

      • LabelListItem

        public LabelListItem​(JComponentList list)
        Initializes the item.
        Parameters:
        list - the list this item belongs to
    • Method Detail

      • getList

        public JComponentList getList()
        Returns the list this item belongs to.
        Returns:
        the list
      • isEnabled

        public boolean isEnabled​(JComponentList.LabelListItem.Actions action)
        Checks whether the given action is enabled.
        Parameters:
        action - the action to check
        Returns:
        true if the action is enabled
      • setEnabled

        public void setEnabled​(JComponentList.LabelListItem.Actions action,
                               boolean enabled)
        Sets the enabled/disabled state of an action, i.e., whether it shows up in the menu or not. By default, all actions are enabled.
        Parameters:
        action - the action to set the state for
        enabled - if true the action will be displayed in the menu
      • hasDisplayOverride

        public boolean hasDisplayOverride​(JComponentList.LabelListItem.Actions action)
        Checks whether the given action's display string is overridden.
        Parameters:
        action - the action to check
        Returns:
        true if the action has an override
      • addDisplayOverride

        public void addDisplayOverride​(JComponentList.LabelListItem.Actions action,
                                       String display)
        Sets an override for the display string for the given action.
        Parameters:
        action - the action to set an override for
        display - the override
      • removeDisplayOverride

        public void removeDisplayOverride​(JComponentList.LabelListItem.Actions action)
        Removes the display override for the given action.
        Parameters:
        action - the action to remove the override for
      • getDisplayOverride

        public String getDisplayOverride​(JComponentList.LabelListItem.Actions action)
        Returns the display override for the given action.
        Parameters:
        action - the action to get the override for
        Returns:
        the override string
      • hasPopupMenu

        public boolean hasPopupMenu()
        Returns whether this particular list item has a popup menu at the moment.
        Specified by:
        hasPopupMenu in interface JComponentList.PopupMenuProvider
        Returns:
        true if the provider has a popup menu