Class BaseMenuPiece

java.lang.Object
bibliothek.gui.dock.support.menu.MenuPiece
bibliothek.gui.dock.support.menu.BaseMenuPiece
Direct Known Subclasses:
CloseableDockableMenuPiece, CPreferenceMenuPiece, FreeMenuPiece, FrontendSettingsList, LookAndFeelMenuPiece, PreferenceMenuPiece, ThemeMenuPiece

public class BaseMenuPiece extends MenuPiece
A very simple piece, subclasses can add or remove items from this piece at any time.
Author:
Benjamin Sigg
  • Constructor Details

    • BaseMenuPiece

      public BaseMenuPiece()
  • Method Details

    • fill

      public void fill(List<Component> items)
      Description copied from class: MenuPiece
      Inserts all items of this piece into items.
      Specified by:
      fill in class MenuPiece
      Parameters:
      items - the list which has to be filled in the same order as the items will appear on the menu
    • getItemCount

      public int getItemCount()
      Description copied from class: MenuPiece
      Gets the number of items this MenuPiece added to its menu.
      Specified by:
      getItemCount in class MenuPiece
      Returns:
      the number of items
    • getItem

      protected Component getItem(int index)
      Gets the index'th item of this piece.
      Parameters:
      index - the location of the item
      Returns:
      the item
    • addSeparator

      protected void addSeparator()
      Adds a separator at the end of this piece.
    • insertSeparator

      protected void insertSeparator(int index)
      Inserts a separator into this piece.
      Parameters:
      index - the location of the separator
    • insert

      protected void insert(int index, Component item)
      Inserts a new item into the menu.
      Parameters:
      index - the location of the new item, measured in the coordinate space of this piece.
      item - the new item.
    • add

      protected void add(Component item)
      Adds item at the end of this piece.
      Parameters:
      item - the item to add.
    • remove

      protected void remove(Component item)
      Removes item from the menu.
      Parameters:
      item - the item to remove
    • remove

      protected void remove(int index)
      Removes the index'th item of this piece.
      Parameters:
      index - the location of the item to remove.
    • removeAll

      protected void removeAll()
      Removes all items of this piece.