|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openide.util.Task org.netbeans.api.vcs.commands.CommandTask
This class represents the actual command, that is executed to acually perform a VCS action.
Field Summary | |
static int |
STATUS_FAILED
|
static int |
STATUS_INTERRUPTED
|
static int |
STATUS_NOT_STARTED
|
static int |
STATUS_RUNNING
|
static int |
STATUS_SUCCEEDED
|
Fields inherited from class org.openide.util.Task |
EMPTY |
Constructor Summary | |
protected |
CommandTask()
|
Method Summary | |
protected boolean |
canExecute()
Tell, whether the task can be executed now. |
protected abstract int |
execute()
Put the actual execution of this task here. |
abstract String |
getDisplayName()
Get the display name of the command. |
int |
getExitStatus()
Get the exit status of the command. |
abstract FileObject[] |
getFiles()
Get files this task acts on. |
abstract String |
getName()
Get the name of the command. |
int |
getPriority()
Get the priority of this task. |
boolean |
isRunning()
Say whether the command is running just now. |
void |
run()
Schedules the command task for being executed. |
void |
stop()
Stop the command's execution. |
void |
waitFinished(int timeout)
Wait for the task to finish while allowing interruption. |
Methods inherited from class org.openide.util.Task |
addTaskListener, isFinished, notifyFinished, notifyRunning, removeTaskListener, toString, waitFinished, waitFinished |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int STATUS_NOT_STARTED
public static final int STATUS_RUNNING
public static final int STATUS_SUCCEEDED
public static final int STATUS_FAILED
public static final int STATUS_INTERRUPTED
Constructor Detail |
protected CommandTask()
Method Detail |
public abstract String getName()
public abstract String getDisplayName()
null
, the command will not be visible on the popup menu.
public abstract FileObject[] getFiles()
public int getPriority()
Currently only binary priority is distinguished by the CommandProcessor:
priority == 0
and priority != 0
. When
priority != 0
, the task can be run sooner than other tasks
with priority == 0
. After the task is running, it's performance
does not depend on the priority.
0
.protected boolean canExecute()
true
if the task is to be executed immediately. This is the
default implementation.
false
if the task should not be executed at this time.
In this case the method will be called later to check
whether the task can be executed already.public final void run()
protected abstract int execute()
public final boolean isRunning()
public void stop()
public final int getExitStatus()
public void waitFinished(int timeout) throws InterruptedException
timeout
- The maximum time to wait in milliseconds.
InterruptedException
- when the current thread is interrupted while
waiting.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |