|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bushe.swing.event.ContainerEventServiceRegistrar
public class ContainerEventServiceRegistrar
Registers a component with it's Container's EventService while keeping track of the component's container.
Registering with a component's ContainerEventService is tricky since components may not be in their hierarchy when they want to register with it, or components may move (though rarely). This class subscribes a component with it's container event service. If it is unavailable, the registrar waits until the component's Container becomes available and subscribes at that time. If the component changes Containers, the registrar unsubscribes the component from its old container and subscribes it to the new one.
Constructor Summary | |
---|---|
ContainerEventServiceRegistrar(JComponent jComp)
Create a registrar that will keep track of the container event service, typically used in the publish-only cases where the getContainerEventServer() call will be made before publication. |
|
ContainerEventServiceRegistrar(JComponent jComp,
EventSubscriber eventSubscriber,
Class eventClass)
Create a registrar that will keep track of the container event service, and subscribe the subscriber to the eventClass when the ContainerEventService is available and when it changes. |
|
ContainerEventServiceRegistrar(JComponent jComp,
EventSubscriber eventSubscriber,
Class[] eventClasses)
Create a registrar that will keep track of the container event service, and subscribe the subscriber to the event classes when the ContainerEventService is available and when it changes. |
|
ContainerEventServiceRegistrar(JComponent jComp,
EventSubscriber eventSubscriber,
Class[] eventClasses,
EventTopicSubscriber eventTopicSubscriber,
String[] topics)
Create a registrar that will keep track of the container event service, and subscribe the subscriber to the topics and the event classes when the ContainerEventService is available and when it changes. |
|
ContainerEventServiceRegistrar(JComponent jComp,
EventTopicSubscriber eventTopicSubscriber,
String topic)
Create a registrar that will keep track of the container event service, and subscribe the subscriber to the topic when the ContainerEventService is available and when it changes. |
|
ContainerEventServiceRegistrar(JComponent jComp,
EventTopicSubscriber eventTopicSubscriber,
String[] topics)
Create a registrar that will keep track of the container event service, and subscribeStrongly the subscriber to the topics when the ContainerEventService is available and when it changes. |
Method Summary | |
---|---|
EventService |
getContainerEventService()
|
protected void |
updateContainerEventService()
Called by this class when the container may have changed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContainerEventServiceRegistrar(JComponent jComp)
jComp
- the component whose container to monitorpublic ContainerEventServiceRegistrar(JComponent jComp, EventSubscriber eventSubscriber, Class eventClass)
jComp
- the component whose container to monitoreventSubscriber
- the subscriber to register to the Container EventServereventClass
- the class of event to register forpublic ContainerEventServiceRegistrar(JComponent jComp, EventTopicSubscriber eventTopicSubscriber, String topic)
jComp
- the component whose container to monitoreventTopicSubscriber
- the topic subscriber to register to the Container EventServertopic
- the event topic name to register forpublic ContainerEventServiceRegistrar(JComponent jComp, EventSubscriber eventSubscriber, Class[] eventClasses)
jComp
- the component whose container to monitoreventSubscriber
- the subscriber to register to the Container EventServereventClasses
- the classes of event to register forpublic ContainerEventServiceRegistrar(JComponent jComp, EventTopicSubscriber eventTopicSubscriber, String[] topics)
jComp
- the component whose container to monitoreventTopicSubscriber
- the topic subscriber to register to the Container EventServertopics
- the event topic names to register forpublic ContainerEventServiceRegistrar(JComponent jComp, EventSubscriber eventSubscriber, Class[] eventClasses, EventTopicSubscriber eventTopicSubscriber, String[] topics)
jComp
- the component whose container to monitoreventSubscriber
- the subscriber to register to the Container EventServereventClasses
- the classes of event to register foreventTopicSubscriber
- the topic subscriber to keep registered to the topic(s)topics
- the event topic names to register forMethod Detail |
---|
protected void updateContainerEventService()
public EventService getContainerEventService()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |