org.gjt.sp.util
Class WorkThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.gjt.sp.util.WorkThread
All Implemented Interfaces:
java.lang.Runnable, ThreadAbortMonitor

public class WorkThread
extends java.lang.Thread
implements ThreadAbortMonitor

Services work requests in the background.


Nested Class Summary
static class WorkThread.Abort
           
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
WorkThread(WorkThreadPool pool, java.lang.ThreadGroup group, java.lang.String name)
           
 
Method Summary
 void abortCurrentRequest()
          Aborts the currently running request, if allowed.
 int getProgressMaximum()
          Returns the progress maximum.
 int getProgressValue()
          Returns the progress value.
 java.lang.String getStatus()
          Returns the status text.
 boolean isAborted()
           
 boolean isRequestRunning()
          Returns if the work thread is currently running a request.
 void run()
           
 void setAbortable(boolean abortable)
          Sets if the current request can be aborted.
 void setProgressMaximum(int progressMaximum)
          Sets the maximum progress value.
 void setProgressValue(int progressValue)
          Sets the progress value.
 void setStatus(java.lang.String status)
          Sets the status text.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WorkThread

public WorkThread(WorkThreadPool pool,
                  java.lang.ThreadGroup group,
                  java.lang.String name)
Method Detail

setAbortable

public void setAbortable(boolean abortable)
Sets if the current request can be aborted. If set to true and already aborted, the thread will be stopped

Parameters:
abortable - true if the WorkThread is abortable
Since:
jEdit 2.6pre1

isRequestRunning

public boolean isRequestRunning()
Returns if the work thread is currently running a request.

Returns:
true if a request is currently running

isAborted

public boolean isAborted()
Specified by:
isAborted in interface ThreadAbortMonitor

getStatus

public java.lang.String getStatus()
Returns the status text.

Returns:
the status label

setStatus

public void setStatus(java.lang.String status)
Sets the status text.

Parameters:
status - the new status of the thread
Since:
jEdit 2.6pre1

getProgressValue

public int getProgressValue()
Returns the progress value.

Returns:
the progress value

setProgressValue

public void setProgressValue(int progressValue)
Sets the progress value.

Parameters:
progressValue - the new progress value
Since:
jEdit 2.6pre1

getProgressMaximum

public int getProgressMaximum()
Returns the progress maximum.

Returns:
the maximum value of the progression

setProgressMaximum

public void setProgressMaximum(int progressMaximum)
Sets the maximum progress value.

Parameters:
progressMaximum - the maximum value of the progression
Since:
jEdit 2.6pre1

abortCurrentRequest

public void abortCurrentRequest()
Aborts the currently running request, if allowed.

Since:
jEdit 2.6pre1

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread