bibliothek.gui.dock.facile.menu
Class NodeMenuPiece

java.lang.Object
  extended by bibliothek.gui.dock.support.menu.MenuPiece
      extended by 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 Summary
NodeMenuPiece()
           
 
Method Summary
 void add(MenuPiece piece)
          Adds a new child to the end of this piece.
 void bind()
          This method is called if there is a possibility for the user to see this menu.
 void fill(List<Component> items)
          Inserts all items of this piece into items.
 MenuPiece getChild(int index)
          Gets the index'th child of this piece.
 int getChildrenCount()
          Gets the number of children this piece has.
 int getItemCount()
          Gets the number of items this MenuPiece added to its menu.
 void insert(int index, MenuPiece piece)
          Inserts a new child in this piece.
 void remove(int index)
          Removes a child from this piece.
 void remove(MenuPiece piece)
          Removes a child from this piece.
 void unbind()
          This method is called if the user has no longer any possibility to see this menu.
 
Methods inherited from class bibliothek.gui.dock.support.menu.MenuPiece
addListener, fireInsert, fireRemove, getMenu, getParent, isBound, items, removeListener, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeMenuPiece

public NodeMenuPiece()
Method Detail

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:
MenuPiece.unbind()

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:
MenuPiece.bind()