bibliothek.gui.dock.common.menu
Class SingleCDockableListMenuPiece

java.lang.Object
  extended by bibliothek.gui.dock.support.menu.MenuPiece
      extended by bibliothek.gui.dock.support.menu.BaseMenuPiece
          extended by bibliothek.gui.dock.facile.menu.CloseableDockableMenuPiece
              extended by bibliothek.gui.dock.common.menu.SingleCDockableListMenuPiece

public class SingleCDockableListMenuPiece
extends CloseableDockableMenuPiece

A piece of a menu that adds an item for each closeable CDockable that can be found in a CControl. The user can show or hide CDockables by clicking onto these items.

Author:
Benjamin Sigg

Nested Class Summary
 
Nested classes/interfaces inherited from class bibliothek.gui.dock.facile.menu.CloseableDockableMenuPiece
CloseableDockableMenuPiece.Item
 
Constructor Summary
SingleCDockableListMenuPiece(CControl control)
          Creates a new piece.
 
Method Summary
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)
          Exchanges the CControl whose CDockables are observed by this piece.
 void setFrontend(DockFrontend frontend)
          Sets the frontend which will be observed by this piece.
protected  void show(Dockable dockable)
          Ensures that dockable is visible.
 
Methods inherited from class bibliothek.gui.dock.facile.menu.CloseableDockableMenuPiece
check, create, getFrontend, insert
 
Methods inherited from class bibliothek.gui.dock.support.menu.BaseMenuPiece
add, addSeparator, fill, getItem, getItemCount, insert, insertSeparator, remove, remove, removeAll
 
Methods inherited from class bibliothek.gui.dock.support.menu.MenuPiece
addListener, fireInsert, fireRemove, getMenu, getParent, items, removeListener, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleCDockableListMenuPiece

public SingleCDockableListMenuPiece(CControl control)
Creates a new piece.

Parameters:
control - the control to observe for new Dockables, can be null.
Method Detail

setControl

public void setControl(CControl control)
Exchanges the CControl whose CDockables are observed by this piece.

Parameters:
control - the new control to observe, can be null

setFrontend

public void setFrontend(DockFrontend frontend)
Description copied from class: CloseableDockableMenuPiece
Sets the frontend which will be observed by this piece. Every Dockable that is registered at the frontend will get an item in the menu of this piece.

Overrides:
setFrontend in class CloseableDockableMenuPiece
Parameters:
frontend - the list of Dockables, can be null

show

protected void show(Dockable dockable)
Description copied from class: CloseableDockableMenuPiece
Ensures that dockable is visible.

Overrides:
show in class CloseableDockableMenuPiece
Parameters:
dockable - the element to show

hide

protected void hide(Dockable dockable)
Description copied from class: CloseableDockableMenuPiece
Ensures that dockable is not visible.

Overrides:
hide in class CloseableDockableMenuPiece
Parameters:
dockable - the element to hide

include

protected boolean include(Dockable dockable)
Description copied from class: CloseableDockableMenuPiece
Tells whether an item should be inserted into the menu for the given dockable or not.

Overrides:
include in class CloseableDockableMenuPiece
Parameters:
dockable - the element to check
Returns:
true if there should be an item added to the menu