public interface IPathEntryVariableManager
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(IPathEntryVariableChangeListener listener)
Registers the given listener to receive notification of changes to
variables.
|
org.eclipse.core.runtime.IPath |
getValue(String name)
Returns the value of the variable with the given name.
|
String[] |
getVariableNames()
Returns an array containing all defined variable names.
|
boolean |
isDefined(String name)
Returns
true if the given variable is defined and
false otherwise. |
void |
removeChangeListener(IPathEntryVariableChangeListener listener)
Removes the given variable change listener from the listeners list.
|
org.eclipse.core.runtime.IPath |
resolvePath(org.eclipse.core.runtime.IPath path)
Resolves a
String potentially containing a
variable reference, replacing the variable reference
(if any) with the variable's value (which is a concrete absolute path). |
void |
setValue(String name,
org.eclipse.core.runtime.IPath value)
Sets the variable with the given name to be the specified value.
|
void setValue(String name, org.eclipse.core.runtime.IPath value) throws org.eclipse.core.runtime.CoreException
null
.
null
.null
.
null
, or if it is
defined but the given value is equal to its current value.
If a variable is effectively changed, created or removed by a call to this method, notification will be sent to all registered listeners.
name
- the name of the variablevalue
- the value for the variable (may be null
)org.eclipse.core.runtime.CoreException
- if this method fails. Reasons include:
org.eclipse.core.runtime.IPath getValue(String name)
null
.name
- the name of the variable to return the value fornull
if there is no
variable defined with the given nameString[] getVariableNames()
void addChangeListener(IPathEntryVariableChangeListener listener)
listener
- the listenerIPathEntryVariableChangeListener
void removeChangeListener(IPathEntryVariableChangeListener listener)
listener
- the listenerIPathEntryVariableChangeListener
org.eclipse.core.runtime.IPath resolvePath(org.eclipse.core.runtime.IPath path)
String
potentially containing a
variable reference, replacing the variable reference
(if any) with the variable's value (which is a concrete absolute path).
If the given String is null
then null
will be
returned. In all other cases the result will be non-null
.
For example, consider the following collection of path variables:
The following paths would be resolved as:
c:/bin => c:/bin
c:${TEMP} => c:/temp
/TEMP => /TEMP
${TEMP}/foo => /temp/foo
${BACKUP} => /tmp/backup
${BACKUP}/bar.txt => /tmp/backup/bar.txt
SOMEPATH/foo => SOMEPATH/foo
path
- the path to be resolvednull
boolean isDefined(String name)
true
if the given variable is defined and
false
otherwise. Returns false
if the given
name is not a valid path variable name.name
- the variable's nametrue
if the variable exists, false
otherwiseCopyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.