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

java.lang.Object
  extended by bibliothek.gui.dock.station.toolbar.menu.AbstractCustomizationMenu
      extended by bibliothek.gui.dock.station.toolbar.menu.DefaultCustomizationMenu
All Implemented Interfaces:
CustomizationMenu

@Todo(compatibility=COMPATIBLE,
      target=VERSION_1_1_1,
      priority=MINOR,
      description="This class is almost identical with \'DialogWindow\' from Common, maybe these two classes can be merged?")
public class DefaultCustomizationMenu
extends AbstractCustomizationMenu

The default CustomizationMenu makes use of a JDialog to show its contents.

Author:
Benjamin Sigg

Constructor Summary
DefaultCustomizationMenu()
           
 
Method Summary
protected  JDialog createDialog(Component owner)
          Creates a new dialog with the ancestor window of owner as owner.
protected  void doClose()
          Closes this menu.
protected  void doOpen(int x, int y, Component content)
          Shows this menu.
 boolean isCloseOnFocusLost()
          Whether the menu automatically is closed if it loses focus.
 boolean isUndecorated()
          Tells whether the JDialog of this menu is undecorated.
 void setCloseOnFocusLost(boolean closeOnFocusLost)
          Automatically closes this menu if the dialog loses focus.
 void setUndecorated(boolean undecorated)
          Makes the dialog that is used by this menu undecorated.
protected  Rectangle validateBounds(Rectangle bounds, GraphicsConfiguration configuration)
          Should be called before this window is made visible, ensure that the boundaries are valid.
 
Methods inherited from class bibliothek.gui.dock.station.toolbar.menu.AbstractCustomizationMenu
close, closed, getCallback, getContent, getController, isOpen, open, setContent, setController
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCustomizationMenu

public DefaultCustomizationMenu()
Method Detail

setUndecorated

public void setUndecorated(boolean undecorated)
Makes the dialog that is used by this menu undecorated. Calling this method has no effect if the menu is already visible.

Parameters:
undecorated - whether to undecorate the dialog

isUndecorated

public boolean isUndecorated()
Tells whether the JDialog of this menu is undecorated.

Returns:
the result of Dialog.isUndecorated()

setCloseOnFocusLost

public void setCloseOnFocusLost(boolean closeOnFocusLost)
Automatically closes this menu if the dialog loses focus.

Parameters:
closeOnFocusLost - whether to automatically close the menu

isCloseOnFocusLost

public boolean isCloseOnFocusLost()
Whether the menu automatically is closed if it loses focus.

Returns:
whether to automatically close the menu

doOpen

protected void doOpen(int x,
                      int y,
                      Component content)
Description copied from class: AbstractCustomizationMenu
Shows this menu. This method is only called if the menu is not yet open. Note that the Component content will never be replaced while the menu is open.

Specified by:
doOpen in class AbstractCustomizationMenu
Parameters:
x - the preferred x coordinate of the menu
y - the preferred y coordinate of the menu
content - the content of the menu, not null

doClose

protected void doClose()
Description copied from class: AbstractCustomizationMenu
Closes this menu. There are no calls to the CustomizationMenuCallback required. Subclasses should not call this method directly, instead they should always call AbstractCustomizationMenu.close()

Specified by:
doClose in class AbstractCustomizationMenu

validateBounds

protected Rectangle validateBounds(Rectangle bounds,
                                   GraphicsConfiguration configuration)
Should be called before this window is made visible, ensure that the boundaries are valid.

Parameters:
bounds - the proposed boundaries
configuration - the screen on which this window is going to be visible, might be null
Returns:
the actual boundaries, can be null to indicate that bounds is valid

createDialog

protected JDialog createDialog(Component owner)
Creates a new dialog with the ancestor window of owner as owner.

Parameters:
owner - some component
Returns:
the new dialog