org.pietschy.command.delegate
Class DelegateManager

java.lang.Object
  extended by org.pietschy.command.delegate.DelegateManager

public class DelegateManager
extends java.lang.Object

DelegateManager class acts as a singleton factory for all DelegateMediator instances. DelegateMediators are created using the currently installed DelegateMediatorFactory.

Version:
$Revision: 1.12 $
Author:
andrewp
See Also:
getMediatorFor(java.awt.Window), DelegatingCommand.trackDelegateIn(String, java.awt.Window)

Constructor Summary
DelegateManager()
           
 
Method Summary
static DelegateMediator getMediatorFor(java.awt.Component component)
          This is a convenience method that gets the DelegateMediator based on the specified components window ancestor.
static DelegateMediator getMediatorFor(java.awt.Window window)
          Gets the DelegateMediator for the specified window.
static void setDelegateMediatorFactory(DelegateMediatorFactory delegateMediatorFactory)
          Sets the factory to use to create DelegateMediator instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegateManager

public DelegateManager()
Method Detail

getMediatorFor

public static DelegateMediator getMediatorFor(java.awt.Window window)
Gets the DelegateMediator for the specified window. If the mediator doesn't exist it will be created using the current DelegateMediatorFactory.

Parameters:
window - the window of interest.
Returns:
the DelegateMediator for the specified window.
See Also:
getMediatorFor(java.awt.Component), setDelegateMediatorFactory(DelegateMediatorFactory)

getMediatorFor

public static DelegateMediator getMediatorFor(java.awt.Component component)
This is a convenience method that gets the DelegateMediator based on the specified components window ancestor.

Parameters:
component -
Returns:
the DelegateMediator for the specified component.
Throws:
java.lang.IllegalStateException - if the component is not contained within a window ancestor.

setDelegateMediatorFactory

public static void setDelegateMediatorFactory(DelegateMediatorFactory delegateMediatorFactory)
Sets the factory to use to create DelegateMediator instances.

Parameters:
delegateMediatorFactory - the new factory to use.