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

UserCommandTask (NetBeans VCS API) - NetBeans API Javadoc 4.1.0

 

org.netbeans.modules.vcscore.cmdline
Class UserCommandTask

java.lang.Object
  extended byorg.openide.util.Task
      extended byorg.netbeans.api.vcs.commands.CommandTask
          extended byorg.netbeans.spi.vcs.commands.CommandTaskSupport
              extended byorg.netbeans.modules.vcscore.cmdline.UserCommandTask
All Implemented Interfaces:
ProvidedCommand, Runnable, org.netbeans.modules.vcscore.runtime.RuntimeCommandTask, VcsDescribedTask

public class UserCommandTask
extends CommandTaskSupport
implements VcsDescribedTask, org.netbeans.modules.vcscore.runtime.RuntimeCommandTask, ProvidedCommand


Field Summary
static String VAR_USE_PARENT_VISUALIZER
          If this variable is true, the visualizer of the parent task is used as a visualizer of this task as well.
 
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
UserCommandTask(UserCommandSupport cmdSupport, VcsDescribedCommand cmd)
          Creates a new instance of UserCommandTask
 
Method Summary
protected  boolean canExecute()
          Tell, whether the task can be executed now.
protected  int execute()
          Put the actual execution of this task here.
 String getDisplayName()
          Get the display name of the command.
 VcsCommandExecutor getExecutor()
          Get the executor of the command.
 FileObject[] getFiles()
          Get files this task acts on.
 int getPriority()
          Get the priority of this task.
 VcsCommandsProvider getProvider()
          Get the VCS commands provider, that provided this Command or CommandTask.
 org.netbeans.modules.vcscore.runtime.RuntimeCommand getRuntimeCommand(CommandTaskInfo info)
           
 Map getVariables()
          Get variables that are used for the task execution.
 VcsCommand getVcsCommand()
          Get the VcsCommand instance associated with this command.
 VcsCommandVisualizer getVisualizer(boolean gui)
          Get the visualizer of the command.
 boolean hasGUIVisualizer()
          Test whether this task has a GUI visualizer.
 void setProvider(VcsCommandsProvider provider)
          Set the VCS commands provider, that provided this Command or CommandTask.
 
Methods inherited from class org.netbeans.spi.vcs.commands.CommandTaskSupport
getCommand, getName, stop
 
Methods inherited from class org.netbeans.api.vcs.commands.CommandTask
getExitStatus, 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
 

Field Detail

VAR_USE_PARENT_VISUALIZER

public static final String VAR_USE_PARENT_VISUALIZER
If this variable is true, the visualizer of the parent task is used as a visualizer of this task as well. This is necessary for visualizers which need to wrap more sub-commands.

See Also:
Constant Field Values
Constructor Detail

UserCommandTask

public UserCommandTask(UserCommandSupport cmdSupport,
                       VcsDescribedCommand cmd)
Creates a new instance of UserCommandTask

Method Detail

getDisplayName

public String getDisplayName()
Description copied from class: CommandTaskSupport
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.

Overrides:
getDisplayName in class CommandTaskSupport

getExecutor

public VcsCommandExecutor getExecutor()
Description copied from interface: VcsDescribedTask
Get the executor of the command.

Specified by:
getExecutor in interface VcsDescribedTask

getPriority

public int getPriority()
Description copied from class: CommandTask
Get the priority of this task. This can be taken into account by the task processor.

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.

Overrides:
getPriority in class CommandTask
Returns:
The task's priority. The default implementation returns 0.

getFiles

public FileObject[] getFiles()
Description copied from class: CommandTaskSupport
Get files this task acts on.

Overrides:
getFiles in class CommandTaskSupport

getVariables

public Map getVariables()
Get variables that are used for the task execution.

Specified by:
getVariables in interface VcsDescribedTask
Returns:
the map of variable names and values.

getVcsCommand

public VcsCommand getVcsCommand()
Get the VcsCommand instance associated with this command.

Specified by:
getVcsCommand in interface VcsDescribedTask
Returns:
The VcsCommand.

getRuntimeCommand

public org.netbeans.modules.vcscore.runtime.RuntimeCommand getRuntimeCommand(CommandTaskInfo info)
Specified by:
getRuntimeCommand in interface org.netbeans.modules.vcscore.runtime.RuntimeCommandTask

getVisualizer

public VcsCommandVisualizer getVisualizer(boolean gui)
Description copied from interface: VcsDescribedTask
Get the visualizer of the command.

Specified by:
getVisualizer in interface VcsDescribedTask
Parameters:
gui - Whether a GUI visualizer or plain text is requested.
Returns:
The visualizer. If GUI visualizer is not defined for this task a plain text visualizer can be returned even when GUI is requested. Whether GUI visualizer is defined can be tested by method VcsDescribedTask.hasGUIVisualizer().

hasGUIVisualizer

public boolean hasGUIVisualizer()
Description copied from interface: VcsDescribedTask
Test whether this task has a GUI visualizer.

Specified by:
hasGUIVisualizer in interface VcsDescribedTask

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. This method is to be used for this purpose.

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

execute

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

Overrides:
execute in class CommandTaskSupport

getProvider

public VcsCommandsProvider getProvider()
Get the VCS commands provider, that provided this Command or CommandTask.

Specified by:
getProvider in interface ProvidedCommand

setProvider

public void setProvider(VcsCommandsProvider provider)
Set the VCS commands provider, that provided this Command or CommandTask. This method should be called just by the implementator.

Specified by:
setProvider in interface ProvidedCommand

 

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