Task.Support.EnhancedListeners
Class EnhancedListener
java.lang.Object
Task.Support.EnhancedListeners.EnhancedListener
- Direct Known Subclasses:
- TaskListChangeListener
public class EnhancedListener
- extends java.lang.Object
EnhancedListener is a base class that makes it easy to create event listeners that have an "autoremove"
flag set on them. This can be used to auto-prune listeners, think "soft listener registration", like "soft
reference".
Also, an enhanced listener can request to be executed in the EDT or a background thread. It works with
EnhancedListenerUpdater to make this happen. The updater respects a listener's requirement to run
in the EDT or NOT.
- Since:
- Feb 26, 2008, 2:00:33 PM
- Version:
- 1.0
- Author:
- Nazmul Idris
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EnhancedListener
public EnhancedListener()
setRunInEDTPolicy
public void setRunInEDTPolicy(EnhancedListener.EDTPolicy policy)
throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
mustRunInEDT
public boolean mustRunInEDT()
isSoftListener
public boolean isSoftListener()
setSoftListener
public void setSoftListener(boolean flag)
pruneSoftListeners
public static final void pruneSoftListeners(java.util.List<? extends EnhancedListener> list)
- a simple utility method that removes all the listeners that have
isSoftListener() set to true.
- Parameters:
list - this list is mutated if any of the listeners have isSoftListener () set to true.
Copyright © 2011. All Rights Reserved.