public class CloseableDockableMenuPiece extends BaseMenuPiece
Dockable
s that
are registered in a DockFrontend
.Modifier and Type | Class and Description |
---|---|
protected class |
CloseableDockableMenuPiece.Item
An item showing the visibility state of one
Dockable . |
Constructor and Description |
---|
CloseableDockableMenuPiece()
Creates a new piece
|
CloseableDockableMenuPiece(DockFrontend frontend)
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.
|
void |
check(Dockable dockable)
Ensures that
dockable has an item if it is included ,
and does not have otherwise. |
protected CloseableDockableMenuPiece.Item |
create(Dockable dockable)
Creates a new item for the menu.
|
DockFrontend |
getFrontend()
Gets the frontend which is observed by this piece.
|
java.util.Comparator<java.lang.String> |
getOrder()
Gets the order of the menu items.
|
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. |
protected void |
insert(CloseableDockableMenuPiece.Item item)
Adds an earlier created item into the menu, subclasses might override
this method to add the item at a different location.
|
protected void |
reorder()
Asynchronously order the menu items
|
void |
setFrontend(DockFrontend frontend)
Sets the frontend which will be observed by this piece.
|
void |
setOrder(java.util.Comparator<java.lang.String> order)
Sets the order of the menu items.
|
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.
|
add, addSeparator, fill, getItem, getItemCount, insert, insertSeparator, remove, remove, removeAll
addListener, fireInsert, fireRemove, getMenu, getParent, isBound, items, removeListener, setParent
public CloseableDockableMenuPiece()
public CloseableDockableMenuPiece(DockFrontend frontend)
frontend
- the list of Dockable
s, can be null
public void setOrder(java.util.Comparator<java.lang.String> order)
order
- the order, or null
public java.util.Comparator<java.lang.String> getOrder()
null
protected void reorder()
public DockFrontend getFrontend()
null
setFrontend(DockFrontend)
public void setFrontend(DockFrontend frontend)
Dockable
that is registered at the frontend
will
get an item in the menu of this piece.frontend
- the list of Dockable
s, can be null
public void bind()
MenuPiece
bind
in class MenuPiece
MenuPiece.unbind()
public void unbind()
MenuPiece
unbind
in class MenuPiece
MenuPiece.bind()
protected CloseableDockableMenuPiece.Item create(Dockable dockable)
dockable
- the element which will be shown/hidden when the user
clicks onto the item.protected void insert(CloseableDockableMenuPiece.Item item)
item
- the item to insertsetOrder(Comparator)
protected void show(Dockable dockable)
dockable
is visible.dockable
- the element to showprotected void hide(Dockable dockable)
dockable
is not visible.dockable
- the element to hideprotected boolean include(Dockable dockable)
dockable
or not.dockable
- the element to checktrue
if there should be an item added to the menu