uic.model
Class UICSimpleAction.OnlyLastPolicy

java.lang.Object
  extended by 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.


Constructor Summary
UICSimpleAction.OnlyLastPolicy()
           
 
Method Summary
 void schedule(UICSimpleAction action, Object[] arguments, Object eventSource)
          schedule an action according to policy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UICSimpleAction.OnlyLastPolicy

public UICSimpleAction.OnlyLastPolicy()
Method Detail

schedule

public void schedule(UICSimpleAction action,
                     Object[] arguments,
                     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-2004 Thomas Zander Available under the Free Apache licence