|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jface.text.templates.TemplateVariable
public class TemplateVariable
A TemplateVariable represents a set of positions into a
TemplateBuffer with identical content each. TemplateVariableResolvers
can be used to resolve a template variable to a symbol available from the
TemplateContext. A resolved variable may have one or more possible
values which may be presented to the user as choices. If there is no user
interaction the default value is chosen as textual representation of
the variable.
Clients may instantiate and extend this class.
TemplateVariableResolver,
TemplateBuffer| Constructor Summary | |
|---|---|
TemplateVariable(java.lang.String type,
java.lang.String[] values,
int[] offsets)
Creates a template variable with multiple possible values. |
|
TemplateVariable(java.lang.String type,
java.lang.String defaultValue,
int[] offsets)
Creates a template variable. |
|
TemplateVariable(java.lang.String type,
java.lang.String name,
java.lang.String[] values,
int[] offsets)
Creates a template variable with multiple possible values. |
|
TemplateVariable(java.lang.String type,
java.lang.String name,
java.lang.String defaultValue,
int[] offsets)
Creates a template variable. |
|
TemplateVariable(TemplateVariableType type,
java.lang.String name,
java.lang.String defaultValue,
int[] offsets)
Creates a template variable. |
|
| Method Summary | |
|---|---|
java.lang.String |
getDefaultValue()
Returns the default value of the variable. |
int |
getLength()
Returns the length of the variable's default value. |
java.lang.String |
getName()
Returns the name of the variable. |
int[] |
getOffsets()
Returns the offsets of the variable. |
java.lang.String |
getType()
Returns the type name of the variable. |
java.lang.String[] |
getValues()
Returns the possible values for this variable. |
TemplateVariableType |
getVariableType()
Returns the type of the variable. |
boolean |
isResolved()
Returns true if the variable has been resolved, false
otherwise. |
boolean |
isUnambiguous()
Returns true if the variable is unambiguously resolved, false otherwise. |
void |
setOffsets(int[] offsets)
Sets the offsets of the variable. |
void |
setResolved(boolean resolved)
Sets the resolved flag of the variable. |
void |
setUnambiguous(boolean unambiguous)
Sets the isUnambiguous flag of the variable. |
void |
setValue(java.lang.String value)
Resolves the variable to a single value. |
void |
setValues(java.lang.String[] values)
Resolves the variable to several possible values for this variable, with the first being the default value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TemplateVariable(java.lang.String type,
java.lang.String defaultValue,
int[] offsets)
type - the type of the variabledefaultValue - the default value of the variableoffsets - the array of offsets of the variable
public TemplateVariable(java.lang.String type,
java.lang.String name,
java.lang.String defaultValue,
int[] offsets)
type - the type of the variablename - the name of the variabledefaultValue - the default value of the variableoffsets - the array of offsets of the variable
public TemplateVariable(TemplateVariableType type,
java.lang.String name,
java.lang.String defaultValue,
int[] offsets)
type - the type of the variablename - the name of the variabledefaultValue - the default value of the variableoffsets - the array of offsets of the variable
public TemplateVariable(java.lang.String type,
java.lang.String[] values,
int[] offsets)
type - the type of the template variablevalues - the values available at this variable, non-emptyoffsets - the array of offsets of the variable
public TemplateVariable(java.lang.String type,
java.lang.String name,
java.lang.String[] values,
int[] offsets)
type - the type of the variablename - the name of the variablevalues - the values available at this variable, non-emptyoffsets - the array of offsets of the variable| Method Detail |
|---|
public java.lang.String getType()
public TemplateVariableType getVariableType()
public java.lang.String getName()
public java.lang.String getDefaultValue()
getValues().
public java.lang.String[] getValues()
public int getLength()
public void setOffsets(int[] offsets)
offsets - the new offsets of the variablepublic int[] getOffsets()
public final void setValue(java.lang.String value)
setValues(new String[] { value }).
value - the new default valuepublic void setValues(java.lang.String[] values)
values - a non-empty array of valuespublic void setUnambiguous(boolean unambiguous)
unambiguous - the new unambiguous state of the variablepublic boolean isUnambiguous()
true if the variable is unambiguously resolved, false otherwise.
true if the variable is unambiguously resolved, false otherwisepublic void setResolved(boolean resolved)
resolved - the new resolved statepublic boolean isResolved()
true if the variable has been resolved, false
otherwise.
true if the variable has been resolved, false otherwise
|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.