public class SingleCDockableListMenuPiece extends CloseableDockableMenuPiece
CDockable
that can be found in a CControl
. The user can show or hide
CDockable
s by clicking onto these items.CDockable
s that really do exist,
if a dockable is loaded lazy, then this menu does not show the element!CloseableDockableMenuPiece.Item
Constructor and Description |
---|
SingleCDockableListMenuPiece(CControl control)
Creates a new piece.
|
Modifier and Type | Method and Description |
---|---|
void |
bind()
This method is called if there is a possibility for the user to see this menu.
|
protected void |
hide(Dockable dockable)
Ensures that
dockable is not visible. |
protected boolean |
include(Dockable dockable)
Tells whether an item should be inserted into the menu for the given
dockable or not. |
void |
setControl(CControl control)
|
void |
setFrontend(DockFrontend frontend)
Sets the frontend which will be observed by this piece.
|
protected void |
show(Dockable dockable)
Ensures that
dockable is visible. |
void |
unbind()
This method is called if the user has no longer any possibility to see this menu.
|
check, create, getFrontend, getOrder, insert, reorder, setOrder
add, addSeparator, fill, getItem, getItemCount, insert, insertSeparator, remove, remove, removeAll
addListener, fireInsert, fireRemove, getMenu, getParent, isBound, items, removeListener, setParent
public void setControl(CControl control)
control
- the new control to observe, can be null
public void bind()
MenuPiece
bind
in class CloseableDockableMenuPiece
MenuPiece.unbind()
public void unbind()
MenuPiece
unbind
in class CloseableDockableMenuPiece
MenuPiece.bind()
public void setFrontend(DockFrontend frontend)
CloseableDockableMenuPiece
Dockable
that is registered at the frontend
will
get an item in the menu of this piece.setFrontend
in class CloseableDockableMenuPiece
frontend
- the list of Dockable
s, can be null
protected void show(Dockable dockable)
CloseableDockableMenuPiece
dockable
is visible.show
in class CloseableDockableMenuPiece
dockable
- the element to showprotected void hide(Dockable dockable)
CloseableDockableMenuPiece
dockable
is not visible.hide
in class CloseableDockableMenuPiece
dockable
- the element to hideprotected boolean include(Dockable dockable)
CloseableDockableMenuPiece
dockable
or not.include
in class CloseableDockableMenuPiece
dockable
- the element to checktrue
if there should be an item added to the menu