bibliothek.gui.dock.facile.menu
Class FrontendSettingsMenuPiece

java.lang.Object
  extended by bibliothek.gui.dock.support.menu.MenuPiece
      extended by bibliothek.gui.dock.facile.menu.NodeMenuPiece
          extended by bibliothek.gui.dock.facile.menu.FrontendSettingsMenuPiece
Direct Known Subclasses:
CLayoutChoiceMenuPiece

@ClientOnly
public class FrontendSettingsMenuPiece
extends NodeMenuPiece

A piece of a menu that allows to save, load and delete settings from a DockFrontend.

Author:
Benjamin Sigg

Constructor Summary
FrontendSettingsMenuPiece(DockFrontend frontend, boolean loadAsSubmenu)
          Creates a new piece.
 
Method Summary
 void bind()
          This method is called if there is a possibility for the user to see this menu.
 DockFrontend getFrontend()
          Gets the frontend which might be modified by this menu.
 void save(java.awt.Component owner)
          Saves the current setting.
 void saveAs(java.awt.Component owner)
          Saves the current setting under a new name.
 void setFrontend(DockFrontend frontend)
          Sets the frontend which might be modified by this menu.
 void unbind()
          This method is called if the user has no longer any possibility to see this menu.
 
Methods inherited from class bibliothek.gui.dock.facile.menu.NodeMenuPiece
add, fill, getChild, getChildrenCount, getItemCount, insert, remove, remove
 
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

FrontendSettingsMenuPiece

public FrontendSettingsMenuPiece(DockFrontend frontend,
                                 boolean loadAsSubmenu)
Creates a new piece.

Parameters:
frontend - the frontend which might be modified by this piece, can be null
loadAsSubmenu - whether the list of loadable settings should be in a submenu
Method Detail

getFrontend

public DockFrontend getFrontend()
Gets the frontend which might be modified by this menu.

Returns:
the frontend, an be null

setFrontend

public void setFrontend(DockFrontend frontend)
Sets the frontend which might be modified by this menu.

Parameters:
frontend - the frontend, 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 shoudl 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 NodeMenuPiece
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 NodeMenuPiece
See Also:
MenuPiece.bind()

save

public void save(java.awt.Component owner)
Saves the current setting.

Parameters:
owner - the component which should be used as owner of any necessary dialog

saveAs

public void saveAs(java.awt.Component owner)
Saves the current setting under a new name.

Parameters:
owner - which should be used as owner of any necessary dialog