@ClientOnly public class ThemeMenuPiece extends BaseMenuPiece
Constructor and Description |
---|
ThemeMenuPiece(DockController controller,
boolean defaultThemes)
Creates a new piece.
|
ThemeMenuPiece(DockController controller,
ThemeMap map)
Creates a new piece using the themes of
map . |
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 |
destroy()
Severs all connections of this
ThemeMenuPiece with other objects,
allowing the garbage collector to remove this. |
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()
|
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)
|
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 ThemeMenuPiece(DockController controller, boolean defaultThemes)
transfer-flag
will be set to true
.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
public ThemeMenuPiece(DockController controller, ThemeMap map)
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
public void setTransferTheme(boolean transferTheme)
transferTheme
- true
if this piece should transfer the themepublic boolean isTransferTheme()
true
if this piece transfers the themesetTransferTheme(boolean)
public void destroy()
ThemeMenuPiece
with other objects,
allowing the garbage collector to remove this.public void setThemes(ThemeMap themes)
themes
- the offered themes, can be null
public void bind()
MenuPiece
bind
in class MenuPiece
MenuPiece.unbind()
public void unbind()
MenuPiece
unbind
in class MenuPiece
MenuPiece.bind()
public ThemeMap getThemes()
public DockController getController()
public void setController(DockController controller)
controller
- the new controller, can be null