@Deprecated public class IlpStyleListenerSupport extends Object implements StyleListener
This class also batches style changes, so that it fires its event to the style change listeners only when all the changes have been executed.
This class provides support for registering or unregistering listeners. If a synchronization strategy is given at constructor time, the registered listeners are executed according to the synchronization strategy.
In other words, this class transforms fine grained notification
(StyleListener
notification) to large grained notification
(StyleChangeListener
, StyleChangeEvent
).
Furthermore is moves the execution from the current thread to the
synchronization strategy's target thread (if any).
StyleListener
,
StyleChangeListener
,
StyleChangeEvent
Modifier and Type | Field and Description |
---|---|
protected int |
batchLevel
Deprecated.
|
protected EventListenerList |
listenerList
Deprecated.
|
protected Set<IlpKey> |
modifiedKeys
Deprecated.
|
protected ArrayList<ilog.cpl.style.IlpStyleListenerSupport.QueuedEvent> |
queuedEvents
Deprecated.
List of queued events.
|
protected Object |
source
Deprecated.
|
protected IlSynchronizationContext |
syncContext
Deprecated.
Multi-thread event dispatching support
|
protected Collection<IlpKey> |
watchedKeys
Deprecated.
|
Constructor and Description |
---|
IlpStyleListenerSupport(Object source)
Deprecated.
Please use the constructor with multi-thread support
|
IlpStyleListenerSupport(Object source,
Collection<IlpKey> watchedKeys)
Deprecated.
Please use the constructor with multi-thread support
|
IlpStyleListenerSupport(Object source,
Collection<IlpKey> watchedKeys,
IlSynchronizationContext syncContext)
Deprecated.
Creates a style change support that notifies of changes for a restricted
collection of watched keys.
|
Modifier and Type | Method and Description |
---|---|
void |
addStyleChangeListener(StyleChangeListener l)
Deprecated.
Registers a style change listener.
|
void |
endChangingStyleValues()
Deprecated.
Called after a batch of style change has occurred.
|
protected void |
fireStyleChangeEvent()
Deprecated.
Notify all listeners that have registered interest for
notification on this event type.
|
protected void |
fireStyleChangeEventInTargetThread(ilog.cpl.style.IlpStyleListenerSupport.QueuedEvent qevent)
Deprecated.
Called only during writeLock.
|
protected IlSynchronizationStrategy |
getSynchronizationStrategy()
Deprecated.
Returns the synchronization strategy attached to the synchronization
context for this style listener support.
|
void |
removeAllStyleChangeListeners()
Deprecated.
Unregisters all style change listeners.
|
void |
removeStyleChangeListener(StyleChangeListener l)
Deprecated.
Unregisters a style change listener.
|
void |
startChangingStyleValues()
Deprecated.
Called before a batch of style change occurs.
|
void |
styleValueChanged(IlpAbstractStyle source,
IlpKey key)
Deprecated.
Called each time a key changes.
|
protected Object source
protected Collection<IlpKey> watchedKeys
protected EventListenerList listenerList
protected int batchLevel
protected IlSynchronizationContext syncContext
protected ArrayList<ilog.cpl.style.IlpStyleListenerSupport.QueuedEvent> queuedEvents
@Deprecated public IlpStyleListenerSupport(Object source)
source
- @Deprecated public IlpStyleListenerSupport(Object source, Collection<IlpKey> watchedKeys)
watchedKeys
is null, all key changes are registered.source
- watchedKeys
- Contains the list of keys which will be checked. The
listeners will be called only if one of the watchedKeys was changed.public IlpStyleListenerSupport(Object source, Collection<IlpKey> watchedKeys, IlSynchronizationContext syncContext)
watchedKeys
is null, all key changes are registered.source
- watchedKeys
- Contains the list of keys which will be checked. The
listeners will be called only if one of the watchedKeys was changed.syncContext
- Synchronization context which defines the strategy used
to synchronize the event dispatching and the lock.public void addStyleChangeListener(StyleChangeListener l)
public void removeStyleChangeListener(StyleChangeListener l)
public void removeAllStyleChangeListeners()
protected void fireStyleChangeEvent()
protected void fireStyleChangeEventInTargetThread(ilog.cpl.style.IlpStyleListenerSupport.QueuedEvent qevent)
protected IlSynchronizationStrategy getSynchronizationStrategy()
null
when there is no synchronization context
or the synchronization context fails to provide a synchronization
strategy. This later case occurs in BR #2003.28.public void startChangingStyleValues()
startChangingStyleValues
in interface StyleListener
public void styleValueChanged(IlpAbstractStyle source, IlpKey key)
styleValueChanged
in interface StyleListener
source
- The style in which the event was generated.key
- The key that has changed.public void endChangingStyleValues()
endChangingStyleValues
in interface StyleListener
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.