Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013

ch.elexis.actions
Class DelayableJob

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.core.internal.jobs.InternalJob
          extended by org.eclipse.core.runtime.jobs.Job
              extended by ch.elexis.actions.DelayableJob
All Implemented Interfaces:
java.lang.Comparable, org.eclipse.core.runtime.IAdaptable

public class DelayableJob
extends org.eclipse.core.runtime.jobs.Job

A job that does not execute immediately on launch but waits if there comes another call - e.g a key press of the user. The time the job waits is configurable but can also be adaptive - it remembers the time between earlier calls and decides accordingly, how long it should wait next time. The use if this class is to prevent lengthy operations to run unnecessarily - only the last of a series of calls will be executed


Nested Class Summary
static interface DelayableJob.IWorker
           
 
Field Summary
static int DELAY_ADAPTIVE
           
 
Fields inherited from class org.eclipse.core.runtime.jobs.Job
ASYNC_FINISH, BUILD, DECORATE, INTERACTIVE, LONG, NONE, RUNNING, SHORT, SLEEPING, WAITING
 
Fields inherited from class org.eclipse.core.internal.jobs.InternalJob
manager
 
Constructor Summary
DelayableJob(java.lang.String name, DelayableJob.IWorker worker)
           
 
Method Summary
 java.lang.Object getRuntimeData(java.lang.String key)
          retrieve a formerly set data object
 void launch(int delayMillis)
          Launch the job after a specified delay.
protected  org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 void setRuntimeData(java.lang.String key, java.lang.Object value)
          set arbitrary data that can be retrieved at run time
 
Methods inherited from class org.eclipse.core.runtime.jobs.Job
addJobChangeListener, belongsTo, cancel, canceling, done, getJobManager, getName, getPriority, getProperty, getResult, getRule, getState, getThread, isBlocking, isSystem, isUser, join, removeJobChangeListener, schedule, schedule, setName, setPriority, setProgressGroup, setProperty, setRule, setSystem, setThread, setUser, shouldRun, shouldSchedule, sleep, toString, wakeUp, wakeUp, yieldRule
 
Methods inherited from class org.eclipse.core.internal.jobs.InternalJob
compareTo
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

DELAY_ADAPTIVE

public static final int DELAY_ADAPTIVE
See Also:
Constant Field Values
Constructor Detail

DelayableJob

public DelayableJob(java.lang.String name,
                    DelayableJob.IWorker worker)
Method Detail

launch

public void launch(int delayMillis)
Launch the job after a specified delay. If a re-launch occurs within the delay time, the counter is reset and will wait for the specified time again. If the Job was already launched when a re-launch occurs, the Job will be stopped if possible. If the delay is DELAY_ADAPTIVE, the Job will try to find the optimal delay by analyzing earlier calls. So different typing speeds of different users can be handled.

Parameters:
delayMillis -

setRuntimeData

public void setRuntimeData(java.lang.String key,
                           java.lang.Object value)
set arbitrary data that can be retrieved at run time

Parameters:
key - a unique key
value - an arbitrary object

getRuntimeData

public java.lang.Object getRuntimeData(java.lang.String key)
retrieve a formerly set data object

Parameters:
key - the unique key
Returns:
the object associated with this key. This can be null if no such object exists, or if null was associated with this key

run

protected org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
Specified by:
run in class org.eclipse.core.runtime.jobs.Job

Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013