|
||||||||||
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 bibliothek.gui.dock.facile.menu.SubmenuPiece
public class SubmenuPiece
A MenuPiece
which consists only of one JMenu
. There is a
new subtree attached to this SubmenuPiece
.
Constructor Summary | |
---|---|
SubmenuPiece()
Creates a new submenu-piece, using a normal JMenu to inserts
its content. |
|
SubmenuPiece(JMenu menu)
Creates a new submenu-piece. |
|
SubmenuPiece(String text,
boolean disableWhenEmpty,
MenuPiece... pieces)
Creates a new submenu-piece, using a normal JMenu . |
Method Summary | |
---|---|
void |
bind()
This method is called if there is a possibility for the user to see this menu. |
void |
fill(List<Component> items)
Inserts all items of this piece into items . |
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. |
RootMenuPiece |
getRoot()
Gets the root of this subtree. |
boolean |
isDisableWhenEmpty()
Whether to disable the menu when it is empty or not. |
boolean |
isEnabled()
Tells whether the submenu could be enabled. |
void |
setDisableWhenEmpty(boolean disableWhenEmpty)
Disables the menu if there are no items in the menu. |
void |
setEnabled(boolean enabled)
Sets whether the submenu can be enabled. |
void |
unbind()
This method is called if the user has no longer any possibility to see this menu. |
Methods inherited from class bibliothek.gui.dock.support.menu.MenuPiece |
---|
addListener, fireInsert, fireRemove, getParent, isBound, items, removeListener, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SubmenuPiece()
JMenu
to inserts
its content.
public SubmenuPiece(String text, boolean disableWhenEmpty, MenuPiece... pieces)
JMenu
.
text
- the text of the menudisableWhenEmpty
- whether to disable the menu when it is emptypieces
- the elements of this piecepublic SubmenuPiece(JMenu menu)
menu
- the menu into which this piece will insert its contentMethod Detail |
---|
public void bind()
MenuPiece
bind
in class MenuPiece
MenuPiece.unbind()
public void unbind()
MenuPiece
unbind
in class MenuPiece
MenuPiece.bind()
public void fill(List<Component> items)
MenuPiece
items
.
fill
in class MenuPiece
items
- the list which has to be filled in the same order as the items
will appear on the menupublic int getItemCount()
MenuPiece
MenuPiece
added to its menu
.
getItemCount
in class MenuPiece
public void setDisableWhenEmpty(boolean disableWhenEmpty)
disableWhenEmpty
- true
if the menu should be
disabled when emptypublic boolean isDisableWhenEmpty()
true
if the menu gets disabledpublic void setEnabled(boolean enabled)
isDisableWhenEmpty()
.
enabled
- whether the submenu can be enabledpublic boolean isEnabled()
isDisableWhenEmpty()
public JMenu getMenu()
MenuPiece
MenuPiece
adds its items.
getMenu
in class MenuPiece
public RootMenuPiece getRoot()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |