Class EclipseVariables
Variables have two components: the variable name, and the parameter. The parameter is not required for all variables.
The proper form for a variable is ${var_name:parameter}, or ${var_name} if a parameter is not necessary.
Many methods in this class refer to the concept of an Eclipse resource, which is an object known to Eclipse, such as a project name.
Finally, the javadocs of methods in this class specify that they return a certain value. This value is the value the variable will return when evaluated. The literal return value of these methods is an Eclipse Variable definition.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildFiles(@Nullable String deltas) Returns the set of absolute file system paths whose modification caused the current build.static StringbuildProject(@Nullable String resource) Returns the absolute file system path of the project currently being built, or the absolute file system path of the resource argument interpreted as a path relative to the project currently being built.static StringReturns the type of build being performed.static StringcontainerLocation(@Nullable String resource) Returns the absolute file system path of a resource's container.static StringcontainerName(@Nullable String resource) Returns the name of a resource's container.static StringcontainerPath(@Nullable String resource) Returns the workspace relative path of a resource's container.static StringcurrentDate(@Nullable String dateFormat) Returns the current system time formatted asyyyyMMdd_HHmm.static StringReturns the location of the base installation for the running platform.static StringReturns the absolute file system path of the JRE home directory corresponding to the specified execution environment.static StringReturns the value of an environment variable.static StringfilePrompt(@Nullable String hint, @Nullable String initialDir) Returns the absolute file system path of a file chosen in a file selection dialog.static StringfolderPrompt(@Nullable String hint, @Nullable String initialDir) Returns the absolute file system path of a directory chosen in a directory selection dialog.static StringReturns the current HEAD in the Git repository that contains the selected or referenced resourcestatic StringReturns the path to the .git directory for the selected or named resourcestatic StringgitRepoRelativePath(@Nullable String resource) Returns the path of a resource relative to the Git repositorystatic StringgitWorkTree(@Nullable String resource) Returns the work tree root of the Git repository for a resource.static StringReturns a regular expression matching registered Java-like file extensionsstatic StringReturns the fully qualified Java type name of the primary type in the selected resource.static StringpasswordPrompt(@Nullable String hint, @Nullable String initial) Returns the text value entered into a password prompt dialog.static StringprojectLocation(@Nullable String resource) Returns the absolute file system path of a resource's project.static StringprojectName(@Nullable String resource) Returns the name of a resource's project.static StringprojectPath(@Nullable String resource) Returns the workspace relative path of a resource's project.static StringReturns the text value entered into a prompt dialog.static StringresourceLocation(@Nullable String resource) Returns the absolute file system path of a resource.static StringresourceName(@Nullable String resource) Returns the name of a resource.static StringresourcePath(@Nullable String resource) Returns the workspace relative path of a resource.static StringReturns the absolute file system path of the selected resource.static StringReturns the name of the selected resource.static StringReturns the workspace relative path of the selected resource.static StringReturns the text currently selected in the active editor.static StringsystemPath(String tool) Returns the absolute file system path of the external tool.static StringsystemProperty(String property) Returns the value of a system property from the Eclipse runtime.static StringReturns the value of an Eclipse system variable.static StringworkspaceLocation(@Nullable String resource) Returns the absolute file system path of the workspace root.
-
Constructor Details
-
EclipseVariables
public EclipseVariables()
-
-
Method Details
-
buildFiles
Returns the set of absolute file system paths whose modification caused the current build. A list of the characters, 'a' (added), 'c' (changed), 'r' (removed), 'f' (files only), 'd' (directories only), can be supplied as an argument to limit the file list to just those types of deltas. Defaults to all deltas.- Parameters:
deltas- A string of deltas for limiting the listed files.
-
buildProject
Returns the absolute file system path of the project currently being built, or the absolute file system path of the resource argument interpreted as a path relative to the project currently being built.- Parameters:
resource- A path relative to the project currently being built, specifying a specific resource.
-
buildType
Returns the type of build being performed. One of "incremental", "full", "auto", or "none". -
containerLocation
Returns the absolute file system path of a resource's container.The target resource is the selected resource when unspecified, or the resource identified by a workspace relative path.
- Parameters:
resource- The target resource, or null to use the selected resource.
-
containerName
Returns the name of a resource's container.The target resource is the selected resource when unspecified, or the resource identified by a workspace relative path.
- Parameters:
resource- The target resource, or null to use the selected resource.
-
containerPath
Returns the workspace relative path of a resource's container.The target resource is the selected resource when unspecified, or the resource identified by a workspace relative path.
- Parameters:
resource- The target resource, or null to use the selected resource.
-
currentDate
Returns the current system time formatted asyyyyMMdd_HHmm.- Parameters:
dateFormat- An optionalSimpleDateFormatpattern.
-
eclipseHome
Returns the location of the base installation for the running platform. -
eeHome
Returns the absolute file system path of the JRE home directory corresponding to the specified execution environment.- Parameters:
id- An execution environment identifier, such asJavaSE-1.8orJavaSE-17.
-
envVar
Returns the value of an environment variable.- Parameters:
name- The name of the environment variable.
-
filePrompt
public static String filePrompt(@Nullable @Nullable String hint, @Nullable @Nullable String initialDir) Returns the absolute file system path of a file chosen in a file selection dialog.If the second argument is provided, the first must be provided.
- Parameters:
hint- A prompt hint on the dialog title.initialDir- The initial path in the selection dialog.
-
folderPrompt
public static String folderPrompt(@Nullable @Nullable String hint, @Nullable @Nullable String initialDir) Returns the absolute file system path of a directory chosen in a directory selection dialog.If the second argument is provided, the first must be provided.
- Parameters:
hint- A prompt hint on the dialog title.initialDir- The initial path in the selection dialog.
-
gitBranch
Returns the current HEAD in the Git repository that contains the selected or referenced resourceThe target resource is the selected resource when unspecified, or the resource identified by a workspace relative path.
- Parameters:
resource- The target resource, or null to use the selected resource.
-
gitDir
Returns the path to the .git directory for the selected or named resourceThe target resource is the selected resource when unspecified, or the resource identified by a workspace relative path.
- Parameters:
resource- The target resource, or null to use the selected resource.
-
gitRepoRelativePath
Returns the path of a resource relative to the Git repositoryThe target resource is the selected resource when unspecified, or the resource identified by a workspace relative path.
- Parameters:
resource- The target resource, or null to use the selected resource.
-
gitWorkTree
Returns the work tree root of the Git repository for a resource.The target resource is the selected resource when unspecified, or the resource identified by a workspace relative path.
- Parameters:
resource- The target resource, or null to use the selected resource.
-
javaExtRegex
Returns a regular expression matching registered Java-like file extensions -
javaTypeName
Returns the fully qualified Java type name of the primary type in the selected resource. -
passwordPrompt
public static String passwordPrompt(@Nullable @Nullable String hint, @Nullable @Nullable String initial) Returns the text value entered into a password prompt dialog.If the second argument is provided, the first must be provided.
- Parameters:
hint- A prompt hint on the input dialog.initial- The initial value in the input dialog.
-
projectLocation
Returns the absolute file system path of a resource's project.The target resource is the selected resource when unspecified, or the resource identified by a workspace relative path.
- Parameters:
resource- The target resource, or null to use the selected resource.
-
projectName
Returns the name of a resource's project.The target resource is the selected resource when unspecified, or the resource identified by a workspace relative path.
- Parameters:
resource- The target resource, or null to use the selected resource.
-
projectPath
Returns the workspace relative path of a resource's project.The target resource is the selected resource when unspecified, or the resource identified by a workspace relative path.
- Parameters:
resource- The target resource, or null to use the selected resource.
-
resourceLocation
Returns the absolute file system path of a resource.The target resource is the selected resource when unspecified, or the resource identified by a workspace relative path.
- Parameters:
resource- The target resource, or null to use the selected resource.
-
resourceName
Returns the name of a resource.The target resource is the selected resource when unspecified, or the resource identified by a workspace relative path.
- Parameters:
resource- The target resource, or null to use the selected resource.
-
resourcePath
Returns the workspace relative path of a resource.The target resource is the selected resource when unspecified, or the resource identified by a workspace relative path.
- Parameters:
resource- The target resource, or null to use the selected resource.
-
selectedResourceLocation
Returns the absolute file system path of the selected resource. -
selectedResourceName
Returns the name of the selected resource. -
selectedResourcePath
Returns the workspace relative path of the selected resource. -
selectedText
Returns the text currently selected in the active editor. -
prompt
Returns the text value entered into a prompt dialog.If the second argument is provided, the first must be provided.
- Parameters:
hint- A prompt hint on the input dialog.initial- The initial value in the input dialog.
-
systemVar
Returns the value of an Eclipse system variable.- Parameters:
varName- The variable name. One of: ARCH, ECLIPSE_HOME, NL, OS, or WS.
-
systemPath
Returns the absolute file system path of the external tool.Resolved by finding the first occurrence of the named tool based on the system path specification
- Parameters:
tool- The name of the tool.
-
systemProperty
Returns the value of a system property from the Eclipse runtime.- Parameters:
property- The property name.
-
workspaceLocation
Returns the absolute file system path of the workspace root.If a resource is specified, the absolute file system path of the resource identified by a workspace relative path is returned.
- Parameters:
resource- The target resource, or null if one is not being targetted.
-