Package org.gjt.sp.util
Class Task
- java.lang.Object
-
- org.gjt.sp.util.Task
-
- All Implemented Interfaces:
java.lang.Runnable,ProgressObserver
- Direct Known Subclasses:
CopyFileWorker,IoTask,LocalFileSaveTask,MarkersSaveRequest
public abstract class Task extends java.lang.Object implements java.lang.Runnable, ProgressObserver
A Task is a Runnable with progress.- Since:
- jEdit 4.4pre1
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTask()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void_run()This is the method you have to implement and that will be executed in the thread.voidcancel()Cancel the taskjava.lang.StringgetLabel()longgetMaximum()javax.swing.SwingWorker.StateValuegetState()java.lang.StringgetStatus()longgetValue()booleanisCancellable()voidrun()voidsetCancellable(boolean cancellable)voidsetLabel(java.lang.String label)voidsetMaximum(long maximum)Update the maximum value.voidsetStatus(java.lang.String status)Update the status label.voidsetValue(long value)Update the progress value.java.lang.StringtoString()
-
-
-
Method Detail
-
run
public final void run()
- Specified by:
runin interfacejava.lang.Runnable
-
_run
public abstract void _run()
This is the method you have to implement and that will be executed in the thread.
-
setValue
public final void setValue(long value)
Description copied from interface:ProgressObserverUpdate the progress value.- Specified by:
setValuein interfaceProgressObserver- Parameters:
value- the new value
-
setMaximum
public final void setMaximum(long maximum)
Description copied from interface:ProgressObserverUpdate the maximum value.- Specified by:
setMaximumin interfaceProgressObserver- Parameters:
maximum- the new maximum value
-
setStatus
public void setStatus(java.lang.String status)
Description copied from interface:ProgressObserverUpdate the status label.- Specified by:
setStatusin interfaceProgressObserver- Parameters:
status- the new status label
-
getValue
public long getValue()
-
getStatus
public java.lang.String getStatus()
-
getMaximum
public long getMaximum()
-
getState
public javax.swing.SwingWorker.StateValue getState()
-
getLabel
public java.lang.String getLabel()
-
setLabel
public void setLabel(java.lang.String label)
-
isCancellable
public boolean isCancellable()
-
setCancellable
public void setCancellable(boolean cancellable)
-
cancel
public void cancel()
Cancel the task
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-