uic.model
Class UICSimpleAction.OnlyLastPolicy
java.lang.Object
uic.model.UICSimpleAction.OnlyLastPolicy
- All Implemented Interfaces:
- UICSimpleAction.ExecutePolicy
- Enclosing class:
- UICSimpleAction
- public static class UICSimpleAction.OnlyLastPolicy
- extends Object
- implements UICSimpleAction.ExecutePolicy
This policy will enqueue the action; but will remove others that would call the same target method.
In the case of a delayed-initialisation action being executed from one or even
several actions it is unwanted to let the actions queue-up and be executed
serially; this policy will prevent that.
(Example)
Consider having a list of items that will be previed when you click it. The creation
of the preview is a slow process. In this example it is possible for the user to select
5 items in a row which will then be previewed one after another; making the update of
the preview incredably slow.
If you use this policy only the last action will be executed and the other actions
will be discarded. Effect is that only the last preview will be generated and the
first 4 ignored.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UICSimpleAction.OnlyLastPolicy
public UICSimpleAction.OnlyLastPolicy()
schedule
public void schedule(UICSimpleAction action,
Object eventSource)
- Description copied from interface:
UICSimpleAction.ExecutePolicy
- schedule an action according to policy.
- Specified by:
schedule
in interface UICSimpleAction.ExecutePolicy
- Parameters:
action
- the action to be scheduled.eventSource
- the source object that came with an optional event that
caused this action to be executed.
Copyright © 2002,2003 Thomas Zander Available under the Free Apache licence