summaryrefslogtreecommitdiff
path: root/resources/src/liveTemplates/other.xml
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2013-01-08 11:11:20 -0800
committerJean-Baptiste Queru <jbq@google.com>2013-01-08 11:11:20 -0800
commitb56ea2a18f232d79481e778085fd64e8ae486fc3 (patch)
tree44e1f6eb4864a45033f865b74fe783e3d784dd6a /resources/src/liveTemplates/other.xml
downloadidea-b56ea2a18f232d79481e778085fd64e8ae486fc3.tar.gz
Snapshot of commit d5ec1d5018ed24f1b4f32b1d09df6dbd7e2fc425
from branch master of git://git.jetbrains.org/idea/community.git
Diffstat (limited to 'resources/src/liveTemplates/other.xml')
-rw-r--r--resources/src/liveTemplates/other.xml105
1 files changed, 105 insertions, 0 deletions
diff --git a/resources/src/liveTemplates/other.xml b/resources/src/liveTemplates/other.xml
new file mode 100644
index 000000000000..98025efceb01
--- /dev/null
+++ b/resources/src/liveTemplates/other.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<templateSet group="other">
+ <template resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.inst"
+ name="inst" toReformat="true" toShortenFQNames="true" value="if ($EXPR$ instanceof $TYPE$) {&#13;&#10; $TYPE$ $VAR1$ = ($TYPE$)$EXPR$;&#13;&#10; $END$&#13;&#10;}">
+ <variable alwaysStopAt="true" defaultValue="expr" expression="variableOfType(&quot;Object&quot;)" name="EXPR" />
+ <variable alwaysStopAt="true" defaultValue="" expression="&quot;Object&quot;" name="TYPE" />
+ <variable alwaysStopAt="true" defaultValue="" expression="suggestVariableName()" name="VAR1" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_STATEMENT" value="true" />
+ <option name="GROOVY" value="false" />
+ <option name="GROOVY_STATEMENT" value="true" />
+ </context>
+ </template>
+ <template resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.lst"
+ name="lst" toReformat="true" toShortenFQNames="true" value="$ARRAY$[$ARRAY$.length - 1]">
+ <variable alwaysStopAt="true" defaultValue="array" expression="arrayVariable()" name="ARRAY" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_EXPRESSION" value="true" />
+ <option name="GROOVY" value="false" />
+ <option name="GROOVY_EXPRESSION" value="true" />
+ </context>
+ </template>
+ <template resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.mn"
+ name="mn" toReformat="true" toShortenFQNames="true" value="$VAR$ = Math.min($VAR$, $END$);">
+ <variable alwaysStopAt="true" defaultValue="" expression="variableOfType(&quot;double&quot;)" name="VAR" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_STATEMENT" value="true" />
+ <option name="GROOVY" value="false" />
+ <option name="GROOVY_STATEMENT" value="true" />
+ </context>
+ </template>
+ <template resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.mx"
+ name="mx" toReformat="true" toShortenFQNames="true" value="$VAR$ = Math.max($VAR$, $END$);">
+ <variable alwaysStopAt="true" defaultValue="" expression="variableOfType(&quot;double&quot;)" name="VAR" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_STATEMENT" value="true" />
+ <option name="GROOVY" value="false" />
+ <option name="GROOVY_STATEMENT" value="true" />
+ </context>
+ </template>
+ <template resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.psvm"
+ name="psvm" toReformat="true" toShortenFQNames="true" value="public static void main(String[] args){&#13;&#10; $END$&#13;&#10;}">
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_DECLARATION" value="true" />
+ <option name="GROOVY" value="false" />
+ <option name="GROOVY_DECLARATION" value="true" />
+ </context>
+ </template>
+ <template resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.toar"
+ name="toar" toReformat="true" toShortenFQNames="true" value="$COLLECTION$.toArray(new $COMPONENT_TYPE$[$COLLECTION$.size()])$END$">
+ <variable alwaysStopAt="true" defaultValue="&quot;Object&quot;" expression="componentTypeOf(expectedType())" name="COMPONENT_TYPE" />
+ <variable alwaysStopAt="true" defaultValue="collection" expression="variableOfType(&quot;java.util.Collection&quot;)" name="COLLECTION" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_EXPRESSION" value="true" />
+ </context>
+ </template>
+ <template resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.lazy"
+ name="lazy" value="if ($VAR$ == null) {&#10; $VAR$ = new $TYPE$($END$);&#10;}" toReformat="true" toShortenFQNames="true">
+ <variable name="VAR" expression="variableOfType(&quot;java.lang.Object&quot;)" defaultValue="" alwaysStopAt="true" />
+ <variable name="TYPE" expression="subtypes(typeOfVariable(VAR))" defaultValue="" alwaysStopAt="true" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_STATEMENT" value="true" />
+ <option name="GROOVY" value="false" />
+ <option name="GROOVY_STATEMENT" value="true" />
+ </context>
+ </template>
+ <template resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.if.not.null"
+ name="inn" value="if ($VAR$ != null) {&#10;$END$&#10;}" toReformat="true" toShortenFQNames="true">
+ <variable name="VAR" expression="suggestFirstVariableName(&quot;Object&quot;)" defaultValue="var" alwaysStopAt="true" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_STATEMENT" value="true" />
+ <option name="GROOVY" value="false" />
+ <option name="GROOVY_STATEMENT" value="true" />
+ </context>
+ </template>
+ <template resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.if.null"
+ name="ifn" value="if ($VAR$ == null) {&#10;$END$&#10;}" toReformat="true" toShortenFQNames="true">
+ <variable name="VAR" expression="suggestFirstVariableName(&quot;Object&quot;)" defaultValue="var" alwaysStopAt="true" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_STATEMENT" value="true" />
+ <option name="GROOVY" value="false" />
+ <option name="GROOVY_STATEMENT" value="true" />
+ </context>
+ </template>
+ <template resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.geti"
+ name="geti" toReformat="true" toShortenFQNames="true" value="public static $CLASS_NAME$ getInstance() {&#13;&#10; return $VALUE$;&#13;&#10;}">
+ <variable name="CLASS_NAME" expression="className" defaultValue="" alwaysStopAt="false"/>
+ <variable name="VALUE" expression="variableOfType(CLASS_NAME)" defaultValue="null" alwaysStopAt="true"/>
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_DECLARATION" value="true" />
+ <option name="GROOVY" value="false" />
+ <option name="GROOVY_DECLARATION" value="true" />
+ </context>
+ </template>
+</templateSet>