Package bibliothek.gui.dock.facile.menu
Class ThemeMenuPiece
java.lang.Object
bibliothek.gui.dock.support.menu.MenuPiece
bibliothek.gui.dock.support.menu.BaseMenuPiece
bibliothek.gui.dock.facile.menu.ThemeMenuPiece
- Direct Known Subclasses:
CThemeMenuPiece
- Author:
- Benjamin Sigg
-
Constructor Summary
ConstructorsConstructorDescriptionThemeMenuPiece(DockController controller, boolean defaultThemes) Creates a new piece.ThemeMenuPiece(DockController controller, ThemeMap map) Creates a new piece using the themes ofmap. -
Method Summary
Modifier and TypeMethodDescriptionvoidbind()This method is called if there is a possibility for the user to see this menu.voiddestroy()Severs all connections of thisThemeMenuPiecewith other objects, allowing the garbage collector to remove this.Gets the controller whose theme might be changed by this piece.Gets the set of themes used by this piece.booleanvoidsetController(DockController controller) Sets the controller whose theme might be changed by this piece.voidSets the themes which this piece offersvoidsetTransferTheme(boolean transferTheme) voidunbind()This method is called if the user has no longer any possibility to see this menu.Methods inherited from class bibliothek.gui.dock.support.menu.BaseMenuPiece
add, addSeparator, fill, getItem, getItemCount, insert, insertSeparator, remove, remove, removeAllMethods inherited from class bibliothek.gui.dock.support.menu.MenuPiece
addListener, fireInsert, fireRemove, getMenu, getParent, isBound, items, removeListener, setParent
-
Constructor Details
-
ThemeMenuPiece
Creates a new piece. Thetransfer-flagwill be set totrue.- Parameters:
controller- the controller whose theme might be changed, can benulldefaultThemes- whether the piece should be filled up with the factories that can be obtained through theDockUI
-
ThemeMenuPiece
- Parameters:
controller- the controller, will just be stored but not used unlesssetTransferTheme(boolean)is called with the argumenttrue. Can benullmap- the list of themes, can benull
-
-
Method Details
-
setTransferTheme
public void setTransferTheme(boolean transferTheme) - Parameters:
transferTheme-trueif this piece should transfer the theme
-
isTransferTheme
public boolean isTransferTheme()- Returns:
trueif this piece transfers the theme- See Also:
-
destroy
public void destroy()Severs all connections of thisThemeMenuPiecewith other objects, allowing the garbage collector to remove this. -
setThemes
Sets the themes which this piece offers- Parameters:
themes- the offered themes, can benull
-
bind
public void bind()Description copied from class:MenuPieceThis method is called if there is a possibility for the user to see this menu. The menu should register listeners, update its text etc. to be ready for that event. This method must never be called twice in a row. -
unbind
public void unbind()Description copied from class:MenuPieceThis method is called if the user has no longer any possibility to see this menu. The menu should unregister its listeners. This method must never be called twice in a row. -
getThemes
Gets the set of themes used by this piece.- Returns:
- the set of themes
-
getController
Gets the controller whose theme might be changed by this piece.- Returns:
- the controller
-
setController
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 benull
-