Package bibliothek.gui.dock.support.menu
Class BaseMenuPiece
java.lang.Object
bibliothek.gui.dock.support.menu.MenuPiece
bibliothek.gui.dock.support.menu.BaseMenuPiece
- Direct Known Subclasses:
CloseableDockableMenuPiece,CPreferenceMenuPiece,FreeMenuPiece,FrontendSettingsList,LookAndFeelMenuPiece,PreferenceMenuPiece,ThemeMenuPiece
A very simple piece, subclasses can add or remove items from this piece
at any time.
- Author:
- Benjamin Sigg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAddsitemat the end of this piece.protected voidAdds a separator at the end of this piece.voidInserts all items of this piece intoitems.protected ComponentgetItem(int index) Gets the index'th item of this piece.intprotected voidInserts a new item into the menu.protected voidinsertSeparator(int index) Inserts a separator into this piece.protected voidremove(int index) Removes the index'th item of this piece.protected voidRemovesitemfrom the menu.protected voidRemoves all items of this piece.Methods inherited from class bibliothek.gui.dock.support.menu.MenuPiece
addListener, bind, fireInsert, fireRemove, getMenu, getParent, isBound, items, removeListener, setParent, unbind
-
Constructor Details
-
BaseMenuPiece
public BaseMenuPiece()
-
-
Method Details
-
fill
Description copied from class:MenuPieceInserts all items of this piece intoitems. -
getItemCount
public int getItemCount()Description copied from class:MenuPiece- Specified by:
getItemCountin classMenuPiece- Returns:
- the number of items
-
getItem
Gets the index'th item of this piece.- Parameters:
index- the location of the item- Returns:
- the item
-
addSeparator
protected void addSeparator()Adds a separator at the end of this piece. -
insertSeparator
protected void insertSeparator(int index) Inserts a separator into this piece.- Parameters:
index- the location of the separator
-
insert
Inserts a new item into the menu.- Parameters:
index- the location of the new item, measured in the coordinate space of this piece.item- the new item.
-
add
Addsitemat the end of this piece.- Parameters:
item- the item to add.
-
remove
Removesitemfrom the menu.- Parameters:
item- the item to remove
-
remove
protected void remove(int index) Removes the index'th item of this piece.- Parameters:
index- the location of the item to remove.
-
removeAll
protected void removeAll()Removes all items of this piece.
-