bibliothek.gui.dock.facile.menu
Class FreeMenuPiece

java.lang.Object
  extended by bibliothek.gui.dock.support.menu.MenuPiece
      extended by bibliothek.gui.dock.support.menu.BaseMenuPiece
          extended by bibliothek.gui.dock.facile.menu.FreeMenuPiece

@ClientOnly
public class FreeMenuPiece
extends BaseMenuPiece

A MenuPiece that does not add any children by itself. All items have to be added or removed directly by the client.

Author:
Benjamin Sigg

Constructor Summary
FreeMenuPiece()
           
 
Method Summary
 void add(java.awt.Component item)
          Adds item at the end of this piece.
 void addSeparator()
          Adds a separator at the end of this piece.
 java.awt.Component getItem(int index)
          Gets the index'th item of this piece.
 int getItemCount()
          Gets the number of items this MenuPiece added to its menu.
 void insert(int index, java.awt.Component item)
          Inserts a new item into the menu.
 void insertSeparator(int index)
          Inserts a separator into this piece.
 void remove(java.awt.Component item)
          Removes item from the menu.
 void remove(int index)
          Removes the index'th item of this piece.
 
Methods inherited from class bibliothek.gui.dock.support.menu.BaseMenuPiece
fill, removeAll
 
Methods inherited from class bibliothek.gui.dock.support.menu.MenuPiece
addListener, bind, fireInsert, fireRemove, getMenu, getParent, isBound, items, removeListener, setParent, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FreeMenuPiece

public FreeMenuPiece()
Method Detail

getItemCount

public int getItemCount()
Description copied from class: MenuPiece
Gets the number of items this MenuPiece added to its menu.

Overrides:
getItemCount in class BaseMenuPiece
Returns:
the number of items

getItem

public java.awt.Component getItem(int index)
Description copied from class: BaseMenuPiece
Gets the index'th item of this piece.

Overrides:
getItem in class BaseMenuPiece
Parameters:
index - the location of the item
Returns:
the item

add

public void add(java.awt.Component item)
Description copied from class: BaseMenuPiece
Adds item at the end of this piece.

Overrides:
add in class BaseMenuPiece
Parameters:
item - the item to add.

addSeparator

public void addSeparator()
Description copied from class: BaseMenuPiece
Adds a separator at the end of this piece.

Overrides:
addSeparator in class BaseMenuPiece

insert

public void insert(int index,
                   java.awt.Component item)
Description copied from class: BaseMenuPiece
Inserts a new item into the menu.

Overrides:
insert in class BaseMenuPiece
Parameters:
index - the location of the new item, measured in the coordinate space of this piece.
item - the new item.

insertSeparator

public void insertSeparator(int index)
Description copied from class: BaseMenuPiece
Inserts a separator into this piece.

Overrides:
insertSeparator in class BaseMenuPiece
Parameters:
index - the location of the separator

remove

public void remove(int index)
Description copied from class: BaseMenuPiece
Removes the index'th item of this piece.

Overrides:
remove in class BaseMenuPiece
Parameters:
index - the location of the item to remove.

remove

public void remove(java.awt.Component item)
Description copied from class: BaseMenuPiece
Removes item from the menu.

Overrides:
remove in class BaseMenuPiece
Parameters:
item - the item to remove