bibliothek.gui.dock.support.menu
Class FrontendSettingsList

java.lang.Object
  extended by bibliothek.gui.dock.support.menu.MenuPiece
      extended by bibliothek.gui.dock.support.menu.BaseMenuPiece
          extended by bibliothek.gui.dock.support.menu.FrontendSettingsList
Direct Known Subclasses:
FrontendSettingsDeleteList, FrontendSettingsLoadList

public abstract class FrontendSettingsList
extends BaseMenuPiece

A list of settings (=layouts or perspectives) that are available for a DockFrontend. The list contains the elements of DockFrontend.getSettings().

Author:
Benjamin Sigg

Constructor Summary
FrontendSettingsList(DockFrontend frontend)
          Creates a new list.
 
Method Summary
protected abstract  void action(String name)
          Called when the user clicks on an item of this list.
 void bind()
          This method is called if there is a possibility for the user to see this menu.
 DockFrontend getFrontend()
          Gets the frontend which is currently observed
protected  int preferredIndex(String name)
           
 void setFrontend(DockFrontend frontend)
          Changes the frontend which is observed by this list.
 void unbind()
          This method is called if the user has no longer any possibility to see this menu.
 void updateSelection()
          Updates the selection state of the JRadioButtonMenuItems that are used on this menu.
 
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, isBound, items, removeListener, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrontendSettingsList

public FrontendSettingsList(DockFrontend frontend)
Creates a new list.

Parameters:
frontend - the frontend to observe, can be null
Method Detail

getFrontend

public DockFrontend getFrontend()
Gets the frontend which is currently observed

Returns:
the frontend or null

setFrontend

public void setFrontend(DockFrontend frontend)
Changes the frontend which is observed by this list. The list will always show one item for each setting that can be found in DockFrontend.getSettings().

Parameters:
frontend - the frontend to observe, can be null

bind

public void bind()
Description copied from class: MenuPiece
This 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.

Overrides:
bind in class MenuPiece
See Also:
MenuPiece.unbind()

unbind

public void unbind()
Description copied from class: MenuPiece
This 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.

Overrides:
unbind in class MenuPiece
See Also:
MenuPiece.bind()

action

protected abstract void action(String name)
Called when the user clicks on an item of this list.

Parameters:
name - the name of the item

preferredIndex

protected int preferredIndex(String name)

updateSelection

public void updateSelection()
Updates the selection state of the JRadioButtonMenuItems that are used on this menu. Only the one item representing the current layout of the DockFrontend is selected.