Package bibliothek.gui.dock.common.menu
Class SingleCDockableListMenuPiece
java.lang.Object
bibliothek.gui.dock.support.menu.MenuPiece
bibliothek.gui.dock.support.menu.BaseMenuPiece
bibliothek.gui.dock.facile.menu.CloseableDockableMenuPiece
bibliothek.gui.dock.common.menu.SingleCDockableListMenuPiece
A piece of a menu that adds an item for each closeable
Please note: this menu shows only
CDockable
that can be found in a CControl. The user can show or hide
CDockables by clicking onto these items.Please note: this menu shows only
CDockables that really do exist,
if a dockable is loaded lazy, then this menu does not show the element!- Author:
- Benjamin Sigg
-
Nested Class Summary
Nested classes/interfaces inherited from class bibliothek.gui.dock.facile.menu.CloseableDockableMenuPiece
CloseableDockableMenuPiece.Item -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbind()This method is called if there is a possibility for the user to see this menu.protected voidEnsures thatdockableis not visible.protected booleanTells whether an item should be inserted into the menu for the givendockableor not.voidsetControl(CControl control) voidsetFrontend(DockFrontend frontend) Sets the frontend which will be observed by this piece.protected voidEnsures thatdockableis visible.voidunbind()This method is called if the user has no longer any possibility to see this menu.Methods inherited from class bibliothek.gui.dock.facile.menu.CloseableDockableMenuPiece
check, create, getFrontend, getOrder, insert, reorder, setOrderMethods inherited from class bibliothek.gui.dock.support.menu.BaseMenuPiece
add, addSeparator, fill, getItem, getItemCount, insert, insertSeparator, remove, remove, removeAllMethods inherited from class bibliothek.gui.dock.support.menu.MenuPiece
addListener, fireInsert, fireRemove, getMenu, getParent, isBound, items, removeListener, setParent
-
Constructor Details
-
SingleCDockableListMenuPiece
Creates a new piece.- Parameters:
control- the control to observe for newDockables, can benull.
-
-
Method Details
-
setControl
- Parameters:
control- the new control to observe, can benull
-
bind
public void bind()Description copied from class:MenuPieceThis method is called if there is a possibility for the user to see this menu. The menu should register listeners, update its text etc. to be ready for that event. This method must never be called twice in a row.- Overrides:
bindin classCloseableDockableMenuPiece- See Also:
-
unbind
public void unbind()Description copied from class:MenuPieceThis method is called if the user has no longer any possibility to see this menu. The menu should unregister its listeners. This method must never be called twice in a row.- Overrides:
unbindin classCloseableDockableMenuPiece- See Also:
-
setFrontend
Description copied from class:CloseableDockableMenuPieceSets the frontend which will be observed by this piece. EveryDockablethat is registered at thefrontendwill get an item in the menu of this piece.- Overrides:
setFrontendin classCloseableDockableMenuPiece- Parameters:
frontend- the list ofDockables, can benull
-
show
Description copied from class:CloseableDockableMenuPieceEnsures thatdockableis visible.- Overrides:
showin classCloseableDockableMenuPiece- Parameters:
dockable- the element to show
-
hide
Description copied from class:CloseableDockableMenuPieceEnsures thatdockableis not visible.- Overrides:
hidein classCloseableDockableMenuPiece- Parameters:
dockable- the element to hide
-
include
Description copied from class:CloseableDockableMenuPieceTells whether an item should be inserted into the menu for the givendockableor not.- Overrides:
includein classCloseableDockableMenuPiece- Parameters:
dockable- the element to check- Returns:
trueif there should be an item added to the menu
-