bibliothek.gui.dock.station.toolbar.menu
Class GroupedCustomizationMenuContent

java.lang.Object
  extended by bibliothek.gui.dock.station.toolbar.menu.GroupedCustomizationMenuContent
All Implemented Interfaces:
CustomizationMenuContent

public class GroupedCustomizationMenuContent
extends Object
implements CustomizationMenuContent

The grouped customization menu is a panel showing groups of other CustomizationMenuContent. The panel can insert titles and separators between its children

Author:
Benjamin Sigg

Nested Class Summary
 class GroupedCustomizationMenuContent.Group
          One group of CustomizationMenuContents
 
Constructor Summary
GroupedCustomizationMenuContent()
           
 
Method Summary
 void addGroup(GroupedCustomizationMenuContent.Group group)
          Adds a new group to this menu.
 GroupedCustomizationMenuContent.Group addGroup(String title)
          Creates a new GroupedCustomizationMenuContent.Group with a new GroupedCustomizationMenuTitle, and adds this group to this menu.
 void bind(CustomizationMenuCallback callback)
          Informs this item that is going to be used.
 GroupedCustomizationMenuContent.Group getGroup(int index)
          Gets the index'th group of this menu.
 int getGroupCount()
          Gets the number of GroupedCustomizationMenuContent.Groups of this menu.
 Component getView()
          Gets a Component which represents this item.
 void removeGroup(GroupedCustomizationMenuContent.Group group)
          Removes group from this menu.
 void removeGroup(int index)
          Removes the index'th group from this menu.
 void setController(bibliothek.gui.DockController controller)
          Informs this content about the DockController in whose realm it is used.
 void unbind()
          Informs this item that it is no longer used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupedCustomizationMenuContent

public GroupedCustomizationMenuContent()
Method Detail

addGroup

public GroupedCustomizationMenuContent.Group addGroup(String title)
Creates a new GroupedCustomizationMenuContent.Group with a new GroupedCustomizationMenuTitle, and adds this group to this menu.

Parameters:
title - the title of the group, can be null
Returns:
the new group

addGroup

public void addGroup(GroupedCustomizationMenuContent.Group group)
Adds a new group to this menu.

Parameters:
group - the new group, not null

getGroupCount

public int getGroupCount()
Gets the number of GroupedCustomizationMenuContent.Groups of this menu.

Returns:
the number of groups

getGroup

public GroupedCustomizationMenuContent.Group getGroup(int index)
Gets the index'th group of this menu.

Parameters:
index - the index of the group
Returns:

removeGroup

public void removeGroup(GroupedCustomizationMenuContent.Group group)
Removes group from this menu. Nothing happens if this menu is currently shown.

Parameters:
group - the group to remove

removeGroup

public void removeGroup(int index)
Removes the index'th group from this menu. Nothing happens if this menu is currently shown.

Parameters:
index - the index of the group to remove

getView

public Component getView()
Description copied from interface: CustomizationMenuContent
Gets a Component which represents this item. If #bind() has not yet been called, or CustomizationMenuContent.unbind() has been called, then a result of null is valid.

Specified by:
getView in interface CustomizationMenuContent
Returns:
the view or null if this item is not bound.

setController

public void setController(bibliothek.gui.DockController controller)
Description copied from interface: CustomizationMenuContent
Informs this content about the DockController in whose realm it is used.

Specified by:
setController in interface CustomizationMenuContent
Parameters:
controller - the controller, can be null

bind

public void bind(CustomizationMenuCallback callback)
Description copied from interface: CustomizationMenuContent
Informs this item that is going to be used. This method must not be called twice in a row.

Specified by:
bind in interface CustomizationMenuContent
Parameters:
callback - access to more detailed information about the DockStation that is showing the menu

unbind

public void unbind()
Description copied from interface: CustomizationMenuContent
Informs this item that it is no longer used. This method must not be called twive in a row, it must be called after a call to #bind().

Specified by:
unbind in interface CustomizationMenuContent