@ClientOnly public class FreeMenuPiece extends BaseMenuPiece
MenuPiece
that does not add any children by itself. All items
have to be added or removed directly by the client.Constructor and Description |
---|
FreeMenuPiece() |
Modifier and Type | Method and Description |
---|---|
void |
add(Component item)
Adds
item at the end of this piece. |
void |
addSeparator()
Adds a separator at the end of this piece.
|
Component |
getItem(int index)
Gets the index'th item of this piece.
|
int |
getItemCount()
|
void |
insert(int index,
Component item)
Inserts a new item into the menu.
|
void |
insertSeparator(int index)
Inserts a separator into this piece.
|
void |
remove(Component item)
Removes
item from the menu. |
void |
remove(int index)
Removes the index'th item of this piece.
|
fill, removeAll
addListener, bind, fireInsert, fireRemove, getMenu, getParent, isBound, items, removeListener, setParent, unbind
public int getItemCount()
MenuPiece
getItemCount
in class BaseMenuPiece
public Component getItem(int index)
BaseMenuPiece
getItem
in class BaseMenuPiece
index
- the location of the itempublic void add(Component item)
BaseMenuPiece
item
at the end of this piece.add
in class BaseMenuPiece
item
- the item to add.public void addSeparator()
BaseMenuPiece
addSeparator
in class BaseMenuPiece
public void insert(int index, Component item)
BaseMenuPiece
insert
in class BaseMenuPiece
index
- the location of the new item, measured in the coordinate
space of this piece.item
- the new item.public void insertSeparator(int index)
BaseMenuPiece
insertSeparator
in class BaseMenuPiece
index
- the location of the separatorpublic void remove(int index)
BaseMenuPiece
remove
in class BaseMenuPiece
index
- the location of the item to remove.public void remove(Component item)
BaseMenuPiece
item
from the menu.remove
in class BaseMenuPiece
item
- the item to remove