bibliothek.gui.dock.facile.menu
Class ThemeMenuPiece

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.ThemeMenuPiece
Direct Known Subclasses:
CThemeMenuPiece

public class ThemeMenuPiece
extends BaseMenuPiece

A MenuPiece that can change the DockTheme.

Author:
Benjamin Sigg

Constructor Summary
ThemeMenuPiece(DockController controller, boolean defaultThemes)
          Creates a new piece.
ThemeMenuPiece(DockController controller, ThemeMap map)
          Creates a new piece using the themes of map.
 
Method Summary
 DockController getController()
          Gets the controller whose theme might be changed by this piece.
 ThemeMap getThemes()
          Gets the set of themes used by this piece.
 boolean isTransferTheme()
          Tells whether this piece is transfers the DockTheme from its map to the controller.
 void setController(DockController controller)
          Sets the controller whose theme might be changed by this piece.
 void setThemes(ThemeMap themes)
          Sets the themes which this piece offers
 void setTransferTheme(boolean transferTheme)
          Instructs this piece whether it should transfer the
 
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

ThemeMenuPiece

public ThemeMenuPiece(DockController controller,
                      boolean defaultThemes)
Creates a new piece. The transfer-flag will be set to true.

Parameters:
controller - the controller whose theme might be changed, can be null
defaultThemes - whether the piece should be filled up with the factories that can be obtained through the DockUI

ThemeMenuPiece

public ThemeMenuPiece(DockController controller,
                      ThemeMap map)
Creates a new piece using the themes of map. The transfer-flag will be set to false.

Parameters:
controller - the controller, will just be stored but not used unless setTransferTheme(boolean) is called with the argument true. Can be null
map - the list of themes, can be null
Method Detail

setTransferTheme

public void setTransferTheme(boolean transferTheme)
Instructs this piece whether it should transfer the

Parameters:
transferTheme -

isTransferTheme

public boolean isTransferTheme()
Tells whether this piece is transfers the DockTheme from its map to the controller.

Returns:
true if this piece transfers the theme
See Also:
setTransferTheme(boolean)

setThemes

public void setThemes(ThemeMap themes)
Sets the themes which this piece offers

Parameters:
themes - the offered themes, can be null

getThemes

public ThemeMap getThemes()
Gets the set of themes used by this piece.

Returns:
the set of themes

getController

public DockController getController()
Gets the controller whose theme might be changed by this piece.

Returns:
the controller

setController

public void setController(DockController controller)
Sets the controller whose theme might be changed by this piece. The theme of the controller is changed if there is a selection on this piece.

Parameters:
controller - the new controller, can be null