|
org.netbeans.modules.editor.codetemplates/1 1.2.31 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.netbeans.lib.editor.codetemplates.spi.CodeTemplateParameter
public final class CodeTemplateParameter
Code template parameter describes parsed parameter in the template's text.
A first occurrence of the parameter in the parametrized text of the code template
define a master parameter. All other occurrences of the parameter
with the same name will become slave parameters.
The value of the master parameter
will be used for the slaves as well automatically and document modifications
to master parameter's value will be propagated to slaves as well.
Master parameters can have additional hints in the form
${param hint=value [hint2=value2] ... } ${param hint="string-literal" ... } ${param hint ... }The hints give additional specification of what the parameter's value should be.
=value
are assigned with string value "true".
Field Summary | |
---|---|
static String |
CURSOR_PARAMETER_NAME
Name of the parameter corresponding to the caret position parameter. |
static String |
DEFAULT_VALUE_HINT_NAME
Name of the hint that defines an explicit default value of a parameter. |
static String |
EDITABLE_HINT_NAME
Name of the hint that defines whether the given parameter is editable by the user or not. |
Method Summary | |
---|---|
Map |
getHints()
Get map of the [String,String] hints in the parameter. |
int |
getInsertTextOffset()
Get starting offset of this parameter in the CodeTemplateInsertRequest.getInsertText() . |
CodeTemplateParameter |
getMaster()
Get the master parameter of this parameter. |
String |
getName()
Get name of this parameter as parsed from the code template description's text. |
int |
getParametrizedTextEndOffset()
Get the ending offset of this parameter in the parametrized text. |
int |
getParametrizedTextStartOffset()
Get starting offset of this parameter in the parametrized text. |
Collection |
getSlaves()
Get unmodifiable collection of the slave parameters. |
String |
getValue()
Get the present value of this parameter. |
boolean |
isEditable()
Check whether this parameter is editable by the user. |
boolean |
isSlave()
Check whether this parameter is slave or not. |
boolean |
isUserModified()
Check whether the value of this parameter was modified by the user. |
void |
setValue(String newValue)
Set a new value for this parameter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CURSOR_PARAMETER_NAME
public static final String DEFAULT_VALUE_HINT_NAME
public static final String EDITABLE_HINT_NAME
${param editable=false}
Method Detail |
---|
public String getName()
public String getValue()
DEFAULT_VALUE_HINT_NAME
then the default value
is taken from the hint.
Once the code template gets inserted into the document
(can be checked by CodeTemplateInsertRequest.isInserted()
)
then the user may modify the parameter's value explicitly and this method
will reflect these changes.
public void setValue(String newValue)
public boolean isEditable()
public boolean isUserModified()
public int getInsertTextOffset()
CodeTemplateInsertRequest.getInsertText()
.
CodeTemplateInsertRequest.isReleased()
.public int getParametrizedTextStartOffset()
CodeTemplateInsertRequest.getParametrizedText()
.
getParametrizedTextEndOffset()
public int getParametrizedTextEndOffset()
CodeTemplateInsertRequest.getParametrizedText()
.
getParametrizedTextStartOffset()
public Map getHints()
${param hint1 hint2="defaultValue"}
will contain ["hint1","true"] and ["hint2","defaultValue"].
public CodeTemplateParameter getMaster()
public Collection getSlaves()
public boolean isSlave()
|
org.netbeans.modules.editor.codetemplates/1 1.2.31 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |