Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.pietschy.command.delegate.DelegateMediator
org.pietschy.command.delegate.FocusTrackingDelegateMediator
public class FocusTrackingDelegateMediator
extends DelegateMediator
DelegateContainer
heirarchy by traversing up
the component hierarchy from the currently focused component. The final container
list consists of any static constainers (see setStaticContainers(DelegateContainer[])
) and
those compulted from the focus hierarchy. Those found from the focus hierarchy are
given precedence over the static containers.
This mediator is used when you install the FocusTrackingDelegateMediatorFactory
into the
DelegateManager
. There are also convenience methods for getting the current mediator
from the DelegateManager
without explicitly casting.
setDelegateContainers(DelegateContainer[])
, setDelegateContainer(DelegateContainer)
, getMediatorFor(java.awt.Window)
, getMediatorFor(java.awt.Component)
, DelegateManager.setDelegateMediatorFactory(DelegateMediatorFactory)
Field Summary |
Fields inherited from class org.pietschy.command.delegate.DelegateMediator | |
EMPTY_CONTAINER_ARRAY |
Constructor Summary | |
|
Method Summary | |
static FocusTrackingDelegateMediator |
|
static FocusTrackingDelegateMediator |
|
void |
|
void |
|
void |
|
Methods inherited from class org.pietschy.command.delegate.DelegateMediator | |
addDelegateTrackerListener , fireDelegatesChanged , getDelegateContainers , nullSafeArray , nullSafeArray , removeDelegateTrackerListener , setDelegateContainer , setDelegateContainers |
public FocusTrackingDelegateMediator(Window window, RelatedWindowDiscriminator discriminator)
Creates a new DelegateManager for the specified window.
- Parameters:
window
- the window of interest.
public static FocusTrackingDelegateMediator getMediatorFor(Component component)
Conveinence method forDelegateManager.getMediatorFor(java.awt.Component)
for when theFocusTrackingDelegateMediatorFactory
is being used.
- Parameters:
component
- the component of interest.
- Returns:
public static FocusTrackingDelegateMediator getMediatorFor(Window window)
Conveinence method forDelegateManager.getMediatorFor(java.awt.Window)
for when theFocusTrackingDelegateMediatorFactory
is being used.
- Parameters:
window
- the window of interest.
- Returns:
public void setRelatedWindowDiscriminator(RelatedWindowDiscriminator relatedWindowDiscriminator)
Sets the discriminator to use when tracking focus events. The discriminator is used to determine if the currently focused window should be tracked for delegates pertaining to DelegatingCommands bound to the parent window. The default discriminator only tracks delegates in the same window as the DelegatingCommand.
- Parameters:
relatedWindowDiscriminator
- the discriminator to use.
public void setStaticContainer(DelegateContainer staticContainer)
Sets the current static container list to be the specified container. This method will removed all focus specific containers until the next focus change. If the container isnull
then the static container list will be emptied, thus clearing all delegates until the next focus event.
- Parameters:
staticContainer
- the container to use ornull
to clear the static container list.
public void setStaticContainers(DelegateContainer[] containers)
Sets the current static container list to the specified list. This method will removed all focus specific containers until the next focus change. If containers isnull
then the container list will be emptied, thus clearing all delegates until the next focus event.
- Parameters:
containers
- the containers to use ornull
to clear the container list.