|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pietschy.command.delegate.DelegateMediator
public class DelegateMediator
DelegateMediators are used by DelegatingCommand
instances to find their delegates.
Each mediator is bound to a specified window and is associated with a command by
invoking DelegatingCommand.trackDelegateIn(String, java.awt.Window)
.
DelegateManager.getMediatorFor(java.awt.Component)
and DelegateManager.getMediatorFor(java.awt.Window)
.
You can customise the creation of mediators by providing a custom DelegateMediatorFactory
to
the DelegateManager
.
Field Summary | |
---|---|
static DelegateContainer[] |
EMPTY_CONTAINER_ARRAY
|
Constructor Summary | |
---|---|
DelegateMediator()
|
Method Summary | |
---|---|
void |
addDelegateTrackerListener(DelegateMediatorListener listener)
|
protected void |
fireDelegatesChanged(DelegateContainer[] containers)
|
DelegateContainer[] |
getDelegateContainers()
|
protected DelegateContainer[] |
nullSafeArray(DelegateContainer container)
Creates an array containing the specified container. |
protected DelegateContainer[] |
nullSafeArray(DelegateContainer[] containers)
Returns the specified array or and empty array if containers was null . |
void |
removeDelegateTrackerListener(DelegateMediatorListener listener)
|
void |
setDelegateContainer(DelegateContainer container)
This method is a convenience for setDelegateContainers(DelegateContainer[]) . |
void |
setDelegateContainers(DelegateContainer[] containers)
Sets the current DelegateContainer to be used by all DelegatingCommand s associated
with this mediator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final DelegateContainer[] EMPTY_CONTAINER_ARRAY
Constructor Detail |
---|
public DelegateMediator()
Method Detail |
---|
public void setDelegateContainer(DelegateContainer container)
setDelegateContainers(DelegateContainer[])
.
container
- the container to use or null
to disable all delegates.public void setDelegateContainers(DelegateContainer[] containers)
DelegateContainer
to be used by all DelegatingCommand
s associated
with this mediator.
containers
- the containers to use, or null
to clear all the containers.public DelegateContainer[] getDelegateContainers()
public void addDelegateTrackerListener(DelegateMediatorListener listener)
public void removeDelegateTrackerListener(DelegateMediatorListener listener)
protected DelegateContainer[] nullSafeArray(DelegateContainer container)
container
- the container.
null
array containing the container or an empty array
if the container was null
.protected DelegateContainer[] nullSafeArray(DelegateContainer[] containers)
null
.
containers
- the DelegateContainer
s to use.
null
.protected void fireDelegatesChanged(DelegateContainer[] containers)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |