|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.core.internal.resources.PathVariableManager
public class PathVariableManager
Core's implementation of IPathVariableManager.
| Constructor Summary | |
|---|---|
PathVariableManager()
Constructor for the class. |
|
| Method Summary | |
|---|---|
void |
addChangeListener(IPathVariableChangeListener listener)
Registers the given listener to receive notification of changes to path variables. |
java.lang.String[] |
getPathVariableNames()
Returns an array containing all defined path variable names. |
org.eclipse.core.runtime.IPath |
getValue(java.lang.String varName)
Note that if a user changes the key in the preferences file to be invalid and then calls #getValue using that key, they will get the value back for that. |
boolean |
isDefined(java.lang.String varName)
Returns true if the given variable is defined and
false otherwise. |
void |
removeChangeListener(IPathVariableChangeListener listener)
Removes the given path variable change listener from the listeners list. |
org.eclipse.core.runtime.IPath |
resolvePath(org.eclipse.core.runtime.IPath path)
Resolves a relative IPath object potentially containing a
variable reference as its first segment, replacing the variable reference
(if any) with the variable's value (which is a concrete absolute path). |
java.net.URI |
resolveURI(java.net.URI uri)
Resolves a relative URI object potentially containing a
variable reference as its first segment, replacing the variable reference
(if any) with the variable's value (which is a concrete absolute URI). |
void |
setValue(java.lang.String varName,
org.eclipse.core.runtime.IPath newValue)
Sets the path variable with the given name to be the specified value. |
void |
shutdown(org.eclipse.core.runtime.IProgressMonitor monitor)
|
void |
startup(org.eclipse.core.runtime.IProgressMonitor monitor)
|
org.eclipse.core.runtime.IStatus |
validateName(java.lang.String name)
Validates the given name as the name for a path variable. |
org.eclipse.core.runtime.IStatus |
validateValue(org.eclipse.core.runtime.IPath value)
Validates the given path as the value for a path variable. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PathVariableManager()
| Method Detail |
|---|
public void addChangeListener(IPathVariableChangeListener listener)
IPathVariableManager
addChangeListener in interface IPathVariableManagerlistener - the listenerIPathVariableManager#addChangeListener(IPathVariableChangeListener)public java.lang.String[] getPathVariableNames()
IPathVariableManager
getPathVariableNames in interface IPathVariableManagerIPathVariableManager.getPathVariableNames()public org.eclipse.core.runtime.IPath getValue(java.lang.String varName)
getValue in interface IPathVariableManagervarName - the name of the variable to return the value for
null if there is no
variable defined with the given nameIPathVariableManager.getValue(String)public boolean isDefined(java.lang.String varName)
IPathVariableManagertrue if the given variable is defined and
false otherwise. Returns false if the given
name is not a valid path variable name.
isDefined in interface IPathVariableManagervarName - the variable's name
true if the variable exists, false
otherwiseIPathVariableManager.isDefined(String)public void removeChangeListener(IPathVariableChangeListener listener)
IPathVariableManager
removeChangeListener in interface IPathVariableManagerlistener - the listenerIPathVariableManager#removeChangeListener(IPathVariableChangeListener)public org.eclipse.core.runtime.IPath resolvePath(org.eclipse.core.runtime.IPath path)
IPathVariableManagerIPath object potentially containing a
variable reference as its first segment, replacing the variable reference
(if any) with the variable's value (which is a concrete absolute path).
If the given path is absolute or has a non- null device then
no variable substitution is done and that path is returned as is. If the
given path is relative and has a null device, but the first
segment does not correspond to a defined variable, then the path is
returned as is.
If the given path 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 => c:/temp
TEMP/foo => c:/temp/foo
BACKUP => /tmp/backup
BACKUP/bar.txt => /tmp/backup/bar.txt
SOMEPATH/foo => SOMEPATH/foo
resolvePath in interface IPathVariableManagerpath - the path to be resolved
nullIPathVariableManager.resolvePath(IPath)public java.net.URI resolveURI(java.net.URI uri)
IPathVariableManagerURI object potentially containing a
variable reference as its first segment, replacing the variable reference
(if any) with the variable's value (which is a concrete absolute URI).
If the given URI is absolute or has a non- null device then
no variable substitution is done and that URI is returned as is. If the
given URI is relative and has a null device, but the first
segment does not correspond to a defined variable, then the URI is
returned as is.
If the given URI is null then null will be
returned. In all other cases the result will be non-null.
resolveURI in interface IPathVariableManageruri - the URI to be resolved
null
public void setValue(java.lang.String varName,
org.eclipse.core.runtime.IPath newValue)
throws org.eclipse.core.runtime.CoreException
IPathVariableManager
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.
setValue in interface IPathVariableManagervarName - the name of the variablenewValue - the value for the variable (may be null)
org.eclipse.core.runtime.CoreException - if this method fails. Reasons include:
IPathVariableManager.setValue(String, IPath)public void shutdown(org.eclipse.core.runtime.IProgressMonitor monitor)
shutdown in interface IManagerIManager.shutdown(IProgressMonitor)public void startup(org.eclipse.core.runtime.IProgressMonitor monitor)
startup in interface IManagerIManager.startup(IProgressMonitor)public org.eclipse.core.runtime.IStatus validateName(java.lang.String name)
IPathVariableManager
validateName in interface IPathVariableManagername - a possibly valid path variable name
IStatus.OK if
the given name is a valid path variable name, otherwise a status
object indicating what is wrong with the stringIPathVariableManager.validateName(String)public org.eclipse.core.runtime.IStatus validateValue(org.eclipse.core.runtime.IPath value)
IPathVariableManager
validateValue in interface IPathVariableManagervalue - a possibly valid path variable value
IStatus.OK if the given
path is a valid path variable value, otherwise a status object indicating
what is wrong with the valueIPathVariableManager.validateValue(IPath)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||