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

Variables (NetBeans VCS API) - NetBeans API Javadoc 4.1.0

 

org.netbeans.modules.vcscore
Class Variables

java.lang.Object
  extended byorg.netbeans.modules.vcscore.Variables

public class Variables
extends Object

This class contains static methods for variable expansion.

Expand Bash style variables, e.g. ${USER}, with some additional gramatic.


Field Summary
static String DIR
          Relative path (from MODULE) to particular file.
static String FILE
          The name of a variable, whose value is set to the selected file name.
static String FILE_IS_FOLDER
           
static String FILES
          The name of a variable, whose value is set to the selected file names.
static String FILES_IS_FOLDER
           
static String MAX_CMD_LENGTH
          If this variable is defined, than it's value (should be integer) is supposed to be the maximum length of a command in the system.
static String MIMETYPE
           
static String MODULE
          Greatest common parent (GCP) of selected files.
static String MPATHS
           
static String MSG_PROMPT_FOR_AUTO_EDIT
          The content of this variable is taken as a message, that is used to ask whether the EDIT command should be executed.
static String MSG_PROMPT_FOR_AUTO_LOCK
          The content of this variable is taken as a message, that is used to ask whether the LOCK command should be executed.
static String MULTIPLE_FILES
           
static String NUM_FILES
           
static String NUM_IMPORTANT_FILES
           
static String PATH
           
static String PATHS
           
static String QFILE
          The name of a variable, whose value is set to the selected file name quoted by the value of the QUOTING variable.
static String QFILES
          The name of a variable, whose value is set to the selected file names each quoted by the value of the QUOTING variable and delimeted by spaces.
static String QMPATHS
           
static String QPATH
           
static String QPATHS
           
static String SHOW_DEAD_FILES
          When non-empty, the directory reader should read also files, which were deleted from the version control system, but their old revisions exist.
static String TEMPORARY_FILE
          This variable is defined only when used in the execution string and is filled with the full path to a temporary file, that is created and exists ONLY while the command is running.
 
Method Summary
static String expand(Map tab, String cmd, boolean warnUndefVars)
          Expand all occurences of ${} repeatetively.
static String expandConditional(Map tab, String cmd, boolean warnUndefVars)
           
static String expandFast(Map tab, String cmd, boolean warnUndefVars)
          Expand all occurences of ${VARIABLE_NAME}.
static String expandKnownOnly(Map tab, String cmd)
          Expand (once) ${VARIABLE} variables in command only if they are known.
static String expandOnce(Map tab, String cmd, boolean warnUndefVars)
          Expand (once) ${VARIABLE} variables in command.
static String expandVariable(Map tab, String name, boolean warnUndefVars)
           
static Set getContextVariablesNames()
          Variable names that forms actual command execution target.
static Map getDefaultVariablesMap()
           
static boolean needFurtherExpansion(String cmd)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE

public static final String FILE
The name of a variable, whose value is set to the selected file name. When more than one file is selected, the first one is taken.

See Also:
Constant Field Values

QFILE

public static final String QFILE
The name of a variable, whose value is set to the selected file name quoted by the value of the QUOTING variable. When more than one file is selected, the first one is taken.

See Also:
Constant Field Values

FILES

public static final String FILES
The name of a variable, whose value is set to the selected file names. They are delimeted by the path separator.

See Also:
Constant Field Values

QFILES

public static final String QFILES
The name of a variable, whose value is set to the selected file names each quoted by the value of the QUOTING variable and delimeted by spaces.

See Also:
Constant Field Values

DIR

public static final String DIR
Relative path (from MODULE) to particular file.

See Also:
Constant Field Values

MODULE

public static final String MODULE
Greatest common parent (GCP) of selected files. Relative path to ROOTDIR (defined at FS)

See Also:
Constant Field Values

PATH

public static final String PATH
See Also:
Constant Field Values

QPATH

public static final String QPATH
See Also:
Constant Field Values

PATHS

public static final String PATHS
See Also:
Constant Field Values

QPATHS

public static final String QPATHS
See Also:
Constant Field Values

MPATHS

public static final String MPATHS
See Also:
Constant Field Values

QMPATHS

public static final String QMPATHS
See Also:
Constant Field Values

MIMETYPE

public static final String MIMETYPE
See Also:
Constant Field Values

NUM_FILES

public static final String NUM_FILES
See Also:
Constant Field Values

NUM_IMPORTANT_FILES

public static final String NUM_IMPORTANT_FILES
See Also:
Constant Field Values

FILE_IS_FOLDER

public static final String FILE_IS_FOLDER
See Also:
Constant Field Values

FILES_IS_FOLDER

public static final String FILES_IS_FOLDER
See Also:
Constant Field Values

MULTIPLE_FILES

public static final String MULTIPLE_FILES
See Also:
Constant Field Values

TEMPORARY_FILE

public static final String TEMPORARY_FILE
This variable is defined only when used in the execution string and is filled with the full path to a temporary file, that is created and exists ONLY while the command is running. The file is deleted automatically as soon as the command finish.

See Also:
Constant Field Values

SHOW_DEAD_FILES

public static final String SHOW_DEAD_FILES
When non-empty, the directory reader should read also files, which were deleted from the version control system, but their old revisions exist.

See Also:
Constant Field Values

MSG_PROMPT_FOR_AUTO_EDIT

public static final String MSG_PROMPT_FOR_AUTO_EDIT
The content of this variable is taken as a message, that is used to ask whether the EDIT command should be executed. This message is used only when the execution is caused by typing to a read-oly file.

See Also:
Constant Field Values

MSG_PROMPT_FOR_AUTO_LOCK

public static final String MSG_PROMPT_FOR_AUTO_LOCK
The content of this variable is taken as a message, that is used to ask whether the LOCK command should be executed. This message is used only when the execution is caused by typing to a file, that is not locked by the user.

See Also:
Constant Field Values

MAX_CMD_LENGTH

public static final String MAX_CMD_LENGTH
If this variable is defined, than it's value (should be integer) is supposed to be the maximum length of a command in the system. If the length of the execution string exceeds this value and it's possible to split it (the command takes more than one file as an argument), the execution string is split into two or more execution strings. These are then executed synchronously in the OS.

See Also:
Constant Field Values
Method Detail

getContextVariablesNames

public static Set getContextVariablesNames()
Variable names that forms actual command execution target. These differ from execution to execution.


getDefaultVariablesMap

public static Map getDefaultVariablesMap()

expand

public static String expand(Map tab,
                            String cmd,
                            boolean warnUndefVars)
Expand all occurences of ${} repeatetively. Expand also conditionals like $[? ] [] [].

Parameters:
tab - a map holding (String)VARIABLE, (String)VALUE pairs
cmd - Command with ${VAR} sequences
Returns:
String with all variables expanded

expandVariable

public static String expandVariable(Map tab,
                                    String name,
                                    boolean warnUndefVars)

expandFast

public static String expandFast(Map tab,
                                String cmd,
                                boolean warnUndefVars)
Expand all occurences of ${VARIABLE_NAME}. It makes only one expansion cycle, no variables inside other variables are expanded.

Parameters:
tab - Hashtable holding (String)VARIABLE, (String)VALUE pairs
cmd - Command with ${VAR} sequences
Returns:
String with variables expanded

expandConditional

public static String expandConditional(Map tab,
                                       String cmd,
                                       boolean warnUndefVars)

needFurtherExpansion

public static boolean needFurtherExpansion(String cmd)

expandOnce

public static String expandOnce(Map tab,
                                String cmd,
                                boolean warnUndefVars)
Expand (once) ${VARIABLE} variables in command. It scans 'cmd' string and replaces all occurences of ${VARIABLE} to VALUE=tab.get(VARIABLE). Both VARIABLE and VALUE must be Strings.

Note that 'cmd' string is scanned only once. Use needFurtherExpansion(java.lang.String) function to see if it should be called again.

Parameters:
tab - Hashtable holding (String)VARIABLE=(String)VALUE pairs
cmd - Command in which ${VAR} sequences
Returns:
String with all variables expanded

expandKnownOnly

public static String expandKnownOnly(Map tab,
                                     String cmd)
Expand (once) ${VARIABLE} variables in command only if they are known. It scans 'cmd' string and replaces all occurences of ${VARIABLE} to VALUE=tab.get(VARIABLE). Both VARIABLE and VALUE must be Strings.

Note that 'cmd' string is scanned only once.

Parameters:
tab - Hashtable holding (String)VARIABLE=(String)VALUE pairs
cmd - Command in which ${VAR} sequences
Returns:
String with all known variables expanded

 

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