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

Command (NetBeans VCS API) - NetBeans API Javadoc 4.1.0

 

org.netbeans.api.vcs.commands
Interface Command

All Known Subinterfaces:
AddCommand, AddFolderCommand, ChainingCommand, CheckInCommand, CheckOutCommand, DiffCommand, FileReaderCommand, HistoryCommand, MessagingCommand, PropertiesCommand, RecursionAwareCommand, RegexOutputCommand, RemoveCommand, RemoveFolderCommand, RevisionCommand, TextOutputCommand, UncheckOutCommand, UpdateCommand, VcsDescribedCommand

public interface Command

This interface represents the VCS command, that is executed to acually perform a VCS action.

This interface have sub-interfaces for individual VCS commands. The intended usage is like:

 AddCommand addCmd =
     (AddCommand) VcsManager.getDefault().createCommand(AddCommand.class,
                                    new FileObject[] { fileToAdd });
 addCmd.setMessage("Some new cool stuff");
 addCmd.execute();
 


Method Summary
 CommandTask execute()
          Execute the command.
 FileObject[] getApplicableFiles(FileObject[] files)
          Find, whether this command can act on a set of files.
 String getDisplayName()
          Get the display name of the command.
 FileObject[] getFiles()
          Get files this command acts on.
 String getName()
          Get the name of the command.
 boolean isExpertMode()
          Test whether the command is in expert mode or not.
 boolean isGUIMode()
          Test whether the command is in GUI mode or not.
 void setExpertMode(boolean expert)
          Use this method to set or unset the expert mode for the command execution.
 void setFiles(FileObject[] files)
          Set files to act on.
 void setGUIMode(boolean gui)
          Use this method to set or unset the GUI mode for the command execution.
 

Method Detail

getName

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


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.


setFiles

public void setFiles(FileObject[] files)
Set files to act on. Only files that are applicable to this command can be set. Use getApplicableFiles(org.openide.filesystems.FileObject[]) method to find out which files are applicable.

Parameters:
files - the array of applicable files.
Throws:
an - IllegalArgumentException when one or more files are not applicable.

getFiles

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


getApplicableFiles

public FileObject[] getApplicableFiles(FileObject[] files)
Find, whether this command can act on a set of files.

Parameters:
files - The array of files to inspect
Returns:
an array of files the command can act on or null when it can not act on any file listed.

setGUIMode

public void setGUIMode(boolean gui)
Use this method to set or unset the GUI mode for the command execution. If the GUI mode is set to false, the command tasks are not permitted to open any GUI components. Setting this property does not influence the already running tasks. The default is GUI mode (true).

Parameters:
gui - true for GUI mode, false for non-GUI mode

isGUIMode

public boolean isGUIMode()
Test whether the command is in GUI mode or not.

Returns:
true for GUI mode, false for non-GUI mode

setExpertMode

public void setExpertMode(boolean expert)
Use this method to set or unset the expert mode for the command execution. If the expert mode is set to false, the command customization should be simpler and tasks should present simpler GUI components. Setting this property does not influence the already running tasks. The default is non-expert mode (false).

Parameters:
expert - true for expert mode, false for non-expert mode

isExpertMode

public boolean isExpertMode()
Test whether the command is in expert mode or not.

Returns:
true for expert mode, false for non-expert mode

execute

public CommandTask execute()
Execute the command.


 

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