fori live template
authorDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Mon, 16 Jan 2012 13:46:18 +0000 (17:46 +0400)
committerDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Mon, 16 Jan 2012 13:48:24 +0000 (17:48 +0400)
resources/src/liveTemplates/iterations.xml

index 4e43a9b9cda53e8ea4448f786db31f8b5d678934..8d0d3ad5518df70a2924e75096eb37bf8c6ad858 100644 (file)
@@ -1,5 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <templateSet group="iterations">
+  <template name="fori" value="for(int $INDEX$ = 0; $INDEX$ &lt; $LIMIT$; $INDEX$++) {&#10;  $END$&#10;}" description="Create iteration loop" toReformat="true" toShortenFQNames="true">
+    <variable name="INDEX" expression="suggestIndexName()" defaultValue="" alwaysStopAt="true" />
+    <variable name="LIMIT" expression="" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="JAVA_STATEMENT" value="true" />
+      <option name="GROOVY_STATEMENT" value="true" />
+    </context>
+  </template>
+
   <template name="itar" value="for(int $INDEX$ = 0; $INDEX$ &lt; $ARRAY$.length; $INDEX$++) {&#10;  $ELEMENT_TYPE$ $VAR$ = $ARRAY$[$INDEX$];&#10;  $END$&#10;}"
             resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.itar" toReformat="true" toShortenFQNames="true">
     <variable name="INDEX" expression="suggestIndexName()" defaultValue="" alwaysStopAt="true" />