public interface IStringVariableManager
Modifier and Type | Field and Description |
---|---|
static String |
EXTENSION_POINT_DYNAMIC_VARIABLES
Simple identifier constant (value
"dynamicVariables" ) for the
dynamic variables extension point. |
static String |
EXTENSION_POINT_VALUE_VARIABLES
Simple identifier constant (value
"valueVariables" ) for the
value variables extension point. |
Modifier and Type | Method and Description |
---|---|
void |
addValueVariableListener(IValueVariableListener listener)
Registers the given listener for value variable notifications.
|
void |
addVariables(IValueVariable[] variables)
Adds the given variables to the variable registry.
|
String |
generateVariableExpression(String varName,
String arg)
Convenience method that returns an expression referencing the given
variable and optional argument.
|
String |
getContributingPluginId(IStringVariable variable)
Returns the plug-in identifier of the plug-in that contributed the
given variable via extension or
null if the given
variable wasn't contributed via extension. |
IDynamicVariable |
getDynamicVariable(String name)
Returns the dynamic variable with the given name or
null
if none. |
IDynamicVariable[] |
getDynamicVariables()
Returns all registered dynamic variables.
|
IValueVariable |
getValueVariable(String name)
Returns the value variable with the given name, or
null
if none. |
IValueVariable[] |
getValueVariables()
Returns all registered value variables.
|
IStringVariable[] |
getVariables()
Returns all registered variables.
|
IValueVariable |
newValueVariable(String name,
String description)
Returns a new read-write value variable with the given name and description
with a
null value. |
IValueVariable |
newValueVariable(String name,
String description,
boolean readOnly,
String value)
Returns a new value variable with the given properties.
|
String |
performStringSubstitution(String expression)
Recursively resolves and replaces all variable references in the given
expression with their corresponding values.
|
String |
performStringSubstitution(String expression,
boolean reportUndefinedVariables)
Recursively resolves and replaces all variable references in the given
expression with their corresponding values.
|
void |
removeValueVariableListener(IValueVariableListener listener)
Removes the given listener from the list of registered value variable
listeners.
|
void |
removeVariables(IValueVariable[] variables)
Removes the given variables from the registry.
|
void |
validateStringVariables(String expression)
Validates variables references in the given expression and reports errors
for references to undefined variables.
|
static final String EXTENSION_POINT_DYNAMIC_VARIABLES
"dynamicVariables"
) for the
dynamic variables extension point.static final String EXTENSION_POINT_VALUE_VARIABLES
"valueVariables"
) for the
value variables extension point.IStringVariable[] getVariables()
IValueVariable[] getValueVariables()
IValueVariable getValueVariable(String name)
null
if none.name
- variable namenull
if noneIDynamicVariable[] getDynamicVariables()
IDynamicVariable getDynamicVariable(String name)
null
if none.name
- variable namenull
if noneString getContributingPluginId(IStringVariable variable)
null
if the given
variable wasn't contributed via extension.variable
- the variablenull
String performStringSubstitution(String expression) throws CoreException
performStringSubstitution(expression, true)
).expression
- expression referencing variablesCoreException
- if unable to resolve the value of one or more variablesString performStringSubstitution(String expression, boolean reportUndefinedVariables) throws CoreException
expression
- expression referencing variablesreportUndefinedVariables
- whether a reference to an undefined variable
is to be considered an error (i.e. throw an exception)CoreException
- if unable to resolve the value of one or more variablesvoid validateStringVariables(String expression) throws CoreException
expression
- expression referencing variablesCoreException
- if one or more referenced variables do not existIValueVariable newValueVariable(String name, String description)
null
value.name
- variable name, cannot be null
description
- variable description, possibly null
IValueVariable newValueVariable(String name, String description, boolean readOnly, String value)
name
- variable name, cannot be null
description
- variable description, possibly null
readOnly
- whether this variable is to be a read only variablevalue
- the string value to initialize this variable to - should
not be null
for read-only variablesvoid addVariables(IValueVariable[] variables) throws CoreException
variables
- the variables to addCoreException
- if one or more variables to add has a name collision with
an existing variablevoid removeVariables(IValueVariable[] variables)
variables
- variables to removevoid addValueVariableListener(IValueVariableListener listener)
listener
- value variable listener to addvoid removeValueVariableListener(IValueVariableListener listener)
listener
- value variable listener to removeString generateVariableExpression(String varName, String arg)
varName
of my_var
and an argument
of my_arg
results in the string $(my_var:my_arg}
.varName
- variable namearg
- argument text or null
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.