站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 4.1.0

CommandTaskSupport (NetBeans VCS API) - NetBeans API Javadoc 4.1.0

 

org.netbeans.spi.vcs.commands
Class CommandTaskSupport

java.lang.Object
  extended byorg.openide.util.Task
      extended byorg.netbeans.api.vcs.commands.CommandTask
          extended byorg.netbeans.spi.vcs.commands.CommandTaskSupport
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
UserCommandTask, WrappingCommandTask

public class CommandTaskSupport
extends CommandTask

The supported command task. This task delegates all methods to it's command support.


Field Summary
 
Fields inherited from class org.netbeans.api.vcs.commands.CommandTask
STATUS_FAILED, STATUS_INTERRUPTED, STATUS_NOT_STARTED, STATUS_RUNNING, STATUS_SUCCEEDED
 
Fields inherited from class org.openide.util.Task
EMPTY
 
Constructor Summary
CommandTaskSupport(CommandSupport cmdSupport, Command cmd)
          Creates a new instance of CommandTaskSupport.
 
Method Summary
protected  boolean canExecute()
          Tell, whether the task can be executed now.
protected  int execute()
          Put the actual execution of this task here.
 Command getCommand()
           
 String getDisplayName()
          Get the display name of the command.
 FileObject[] getFiles()
          Get files this task acts on.
 String getName()
          Get the name of the command.
 void stop()
          Stop the command's execution.
 
Methods inherited from class org.netbeans.api.vcs.commands.CommandTask
getExitStatus, getPriority, isRunning, run, waitFinished
 
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
 

Constructor Detail

CommandTaskSupport

public CommandTaskSupport(CommandSupport cmdSupport,
                          Command cmd)
Creates a new instance of CommandTaskSupport.

Parameters:
cmdSupport - the CommandSupport instance, that created this task.
cmd - The copy of customized command, that will not change any more.
Method Detail

getCommand

public final Command getCommand()

getName

public String getName()
Get the name of the command.

Specified by:
getName in class CommandTask

getDisplayName

public String getDisplayName()
Get the display name of the command. It will be visible on the popup menu under this name. When null, the command will not be visible on the popup menu.

Specified by:
getDisplayName in class CommandTask

getFiles

public FileObject[] getFiles()
Get files this task acts on.

Specified by:
getFiles in class CommandTask

execute

protected int execute()
Put the actual execution of this task here. This method will be called automatically after process() call. Do NOT call this method.

Specified by:
execute in class CommandTask
Returns:
The exit status. One of STATUS_* constants.

canExecute

protected boolean canExecute()
Tell, whether the task can be executed now. The task may wish to aviod parallel execution with other tasks or other events.

Overrides:
canExecute in class CommandTask
Returns:
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.

stop

public void stop()
Stop the command's execution. The default implementation kills the command's thread by hard.

Overrides:
stop in class CommandTask

 

Built on May 4 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.