public class BaseMenuPiece extends MenuPiece
Constructor and Description |
---|
BaseMenuPiece() |
Modifier and Type | Method and Description |
---|---|
protected void |
add(java.awt.Component item)
Adds
item at the end of this piece. |
protected void |
addSeparator()
Adds a separator at the end of this piece.
|
void |
fill(java.util.List<java.awt.Component> items)
Inserts all items of this piece into
items . |
protected java.awt.Component |
getItem(int index)
Gets the index'th item of this piece.
|
int |
getItemCount()
|
protected void |
insert(int index,
java.awt.Component item)
Inserts a new item into the menu.
|
protected void |
insertSeparator(int index)
Inserts a separator into this piece.
|
protected void |
remove(java.awt.Component item)
Removes
item from the menu. |
protected void |
remove(int index)
Removes the index'th item of this piece.
|
protected void |
removeAll()
Removes all items of this piece.
|
addListener, bind, fireInsert, fireRemove, getMenu, getParent, isBound, items, removeListener, setParent, unbind
public void fill(java.util.List<java.awt.Component> items)
MenuPiece
items
.public int getItemCount()
MenuPiece
getItemCount
in class MenuPiece
protected java.awt.Component getItem(int index)
index
- the location of the itemprotected void addSeparator()
protected void insertSeparator(int index)
index
- the location of the separatorprotected void insert(int index, java.awt.Component item)
index
- the location of the new item, measured in the coordinate
space of this piece.item
- the new item.protected void add(java.awt.Component item)
item
at the end of this piece.item
- the item to add.protected void remove(java.awt.Component item)
item
from the menu.item
- the item to removeprotected void remove(int index)
index
- the location of the item to remove.protected void removeAll()