public class CloseableDockableMenuPiece extends BaseMenuPiece
Dockables 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.
|
Comparator<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(Comparator<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, removeAlladdListener, fireInsert, fireRemove, getMenu, getParent, isBound, items, removeListener, setParentpublic CloseableDockableMenuPiece()
public CloseableDockableMenuPiece(DockFrontend frontend)
frontend - the list of Dockables, can be nullpublic void setOrder(Comparator<String> order)
order - the order, or nullpublic Comparator<String> getOrder()
nullprotected void reorder()
public DockFrontend getFrontend()
nullsetFrontend(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 Dockables, can be nullpublic void bind()
MenuPiecebind in class MenuPieceMenuPiece.unbind()public void unbind()
MenuPieceunbind in class MenuPieceMenuPiece.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 menuCopyright © 2018. All rights reserved.