|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pietschy.command.delegate.DelegateMediator
org.pietschy.command.delegate.FocusTrackingDelegateMediator
public class FocusTrackingDelegateMediator
This mediator derives the 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.
DelegateMediator.setDelegateContainers(DelegateContainer[])
,
DelegateMediator.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 | |
---|---|
FocusTrackingDelegateMediator(java.awt.Window window,
RelatedWindowDiscriminator discriminator)
Creates a new DelegateManager for the specified window. |
Method Summary | |
---|---|
static FocusTrackingDelegateMediator |
getMediatorFor(java.awt.Component component)
Conveinence method for DelegateManager.getMediatorFor(java.awt.Component) for when
the FocusTrackingDelegateMediatorFactory is being used. |
static FocusTrackingDelegateMediator |
getMediatorFor(java.awt.Window window)
Conveinence method for DelegateManager.getMediatorFor(java.awt.Window) for when
the FocusTrackingDelegateMediatorFactory is being used. |
void |
setRelatedWindowDiscriminator(RelatedWindowDiscriminator relatedWindowDiscriminator)
Sets the discriminator to use when tracking focus events. |
void |
setStaticContainer(DelegateContainer staticContainer)
Sets the current static container list to be the specified container. |
void |
setStaticContainers(DelegateContainer[] containers)
Sets the current static container list to the specified list. |
Methods inherited from class org.pietschy.command.delegate.DelegateMediator |
---|
addDelegateTrackerListener, fireDelegatesChanged, getDelegateContainers, nullSafeArray, nullSafeArray, removeDelegateTrackerListener, setDelegateContainer, setDelegateContainers |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FocusTrackingDelegateMediator(java.awt.Window window, RelatedWindowDiscriminator discriminator)
window
- the window of interest.Method Detail |
---|
public static FocusTrackingDelegateMediator getMediatorFor(java.awt.Window window)
DelegateManager.getMediatorFor(java.awt.Window)
for when
the FocusTrackingDelegateMediatorFactory
is being used.
window
- the window of interest.
java.lang.IllegalStateException
- if the mediator isn't an instance of FocusTrackingDelegateMediator
.public static FocusTrackingDelegateMediator getMediatorFor(java.awt.Component component)
DelegateManager.getMediatorFor(java.awt.Component)
for when
the FocusTrackingDelegateMediatorFactory
is being used.
component
- the component of interest.
java.lang.IllegalStateException
- if the mediator isn't an instance of FocusTrackingDelegateMediator
.public void setStaticContainer(DelegateContainer staticContainer)
null
then the static container list will be emptied, thus clearing all
delegates until the next focus event.
staticContainer
- the container to use or null
to clear the static
container list.public void setStaticContainers(DelegateContainer[] containers)
null
then the container list will be emptied, thus clearing all
delegates until the next focus event.
containers
- the containers to use or null
to clear the container list.public void setRelatedWindowDiscriminator(RelatedWindowDiscriminator relatedWindowDiscriminator)
relatedWindowDiscriminator
- the discriminator to use.
java.lang.NullPointerException
- if the discriminator is null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |