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 protected
Task()
-
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.void
cancel()
Cancel the taskjava.lang.String
getLabel()
long
getMaximum()
javax.swing.SwingWorker.StateValue
getState()
java.lang.String
getStatus()
long
getValue()
boolean
isCancellable()
void
run()
void
setCancellable(boolean cancellable)
void
setLabel(java.lang.String label)
void
setMaximum(long maximum)
Update the maximum value.void
setStatus(java.lang.String status)
Update the status label.void
setValue(long value)
Update the progress value.java.lang.String
toString()
-
-
-
Method Detail
-
run
public final void run()
- Specified by:
run
in 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:ProgressObserver
Update the progress value.- Specified by:
setValue
in interfaceProgressObserver
- Parameters:
value
- the new value
-
setMaximum
public final void setMaximum(long maximum)
Description copied from interface:ProgressObserver
Update the maximum value.- Specified by:
setMaximum
in interfaceProgressObserver
- Parameters:
maximum
- the new maximum value
-
setStatus
public void setStatus(java.lang.String status)
Description copied from interface:ProgressObserver
Update the status label.- Specified by:
setStatus
in 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:
toString
in classjava.lang.Object
-
-