|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.support.menu.MenuPiece
public abstract class MenuPiece
Describes a part of a JMenu
, can add or remove JMenuItem
s
or other JComponent
s 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. |
void |
bind()
This method is called if there is a possibility for the user to see this menu. |
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. |
boolean |
isBound()
Whether bind() was called but unbind() not yet. |
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. |
void |
unbind()
This method is called if the user has no longer any possibility to see this menu. |
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 removeprotected void fireInsert(int index, Component... items)
index
- the index of the first new itemitems
- the new itemsprotected 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 null
public void bind()
unbind()
public void unbind()
bind()
public boolean isBound()
bind()
was called but unbind()
not yet.
public 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 |