|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbibliothek.gui.dock.support.menu.MenuPiece
public abstract class MenuPiece
Describes a part of a JMenu, can add or remove JMenuItems
or other JComponents at any time to the menu.
| Constructor Summary | |
|---|---|
MenuPiece()
|
|
| Method Summary | |
|---|---|
void |
addListener(MenuPieceListener listener)
Adds a listener to this piece, the listener will get informed when the children of this piece change. |
abstract void |
fill(List<Component> items)
Inserts all items of this piece into items. |
protected void |
fireInsert(int index,
Component... items)
Informs all listeners that new items were inserted. |
protected void |
fireRemove(int index,
int length)
Informs all listeners that items were deleted. |
abstract int |
getItemCount()
Gets the number of items this MenuPiece added to its menu. |
JMenu |
getMenu()
Gets the menu into which this MenuPiece adds its items. |
MenuPiece |
getParent()
Gets the parent of this piece. |
Component[] |
items()
Gets all items that are shown by this piece. |
void |
removeListener(MenuPieceListener listener)
Removes listener from this piece. |
void |
setParent(MenuPiece parent)
Sets the parent of this piece. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MenuPiece()
| Method Detail |
|---|
public void addListener(MenuPieceListener listener)
listener - the new listenerpublic void removeListener(MenuPieceListener listener)
listener from this piece.
listener - the listener to remove
protected void fireInsert(int index,
Component... items)
index - the index of the first new itemitems - the new items
protected void fireRemove(int index,
int length)
index - the index of the first deleted itemlength - the number of deleted itemspublic JMenu getMenu()
MenuPiece adds its items.
public MenuPiece getParent()
null for the root or for a piece
which is not yet integrated.public void setParent(MenuPiece parent)
parent - the parent, might be nullpublic abstract int getItemCount()
MenuPiece added to its menu.
public abstract void fill(List<Component> items)
items.
items - the list which has to be filled in the same order as the items
will appear on the menupublic Component[] items()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||