Class NodeMenuPiece

java.lang.Object
bibliothek.gui.dock.support.menu.MenuPiece
bibliothek.gui.dock.facile.menu.NodeMenuPiece
Direct Known Subclasses:
FrontendSettingsMenuPiece, RootMenuPiece

public class NodeMenuPiece extends MenuPiece
A piece which uses a set of other pieces to create a composite.
Author:
Benjamin Sigg
  • Constructor Details

    • NodeMenuPiece

      public NodeMenuPiece()
  • Method Details

    • add

      public void add(MenuPiece piece)
      Adds a new child to the end of this piece.
      Parameters:
      piece - the new child
    • insert

      public void insert(int index, MenuPiece piece)
      Inserts a new child in this piece.
      Parameters:
      index - the location of the child
      piece - the new child
    • remove

      public void remove(MenuPiece piece)
      Removes a child from this piece.
      Parameters:
      piece - the child to remove
    • remove

      public void remove(int index)
      Removes a child from this piece.
      Parameters:
      index - the index of the child
    • getChildrenCount

      public int getChildrenCount()
      Gets the number of children this piece has.
      Returns:
      the number of children
    • getChild

      public MenuPiece getChild(int index)
      Gets the index'th child of this piece.
      Parameters:
      index - the location of the child
      Returns:
      the child
    • 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
    • bind

      public void bind()
      Description copied from class: MenuPiece
      This method is called if there is a possibility for the user to see this menu. The menu should register listeners, update its text etc. to be ready for that event. This method must never be called twice in a row.
      Overrides:
      bind in class MenuPiece
      See Also:
    • unbind

      public void unbind()
      Description copied from class: MenuPiece
      This method is called if the user has no longer any possibility to see this menu. The menu should unregister its listeners. This method must never be called twice in a row.
      Overrides:
      unbind in class MenuPiece
      See Also: