| <?xml version="1.0" encoding="UTF-8"?> |
| <templateSet group="iterations"> |
| <template name="fori" value="for(int $INDEX$ = 0; $INDEX$ < $LIMIT$; $INDEX$++) { $END$ }" 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$ < $ARRAY$.length; $INDEX$++) { $ELEMENT_TYPE$ $VAR$ = $ARRAY$[$INDEX$]; $END$ }" |
| resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.itar" toReformat="true" toShortenFQNames="true"> |
| <variable name="INDEX" expression="suggestIndexName()" defaultValue="" alwaysStopAt="true" /> |
| <variable name="ARRAY" expression="arrayVariable()" defaultValue=""array"" alwaysStopAt="true" /> |
| <variable name="ELEMENT_TYPE" expression="componentTypeOf(ARRAY)" defaultValue="" alwaysStopAt="false" /> |
| <variable name="VAR" expression="suggestVariableName()" 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 name="itco" value="for($ITER_TYPE$ $ITER$ = $COLLECTION$.iterator(); $ITER$.hasNext(); ) { $ELEMENT_TYPE$ $VAR$ =$CAST$ $ITER$.next(); $END$ }" |
| resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.itco" toReformat="true" toShortenFQNames="true"> |
| <variable name="ITER" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" /> |
| <variable name="COLLECTION" expression="variableOfType("java.util.Collection")" defaultValue=""collection"" alwaysStopAt="true" /> |
| <variable name="ELEMENT_TYPE" expression="guessElementType(COLLECTION)" defaultValue=""Object"" alwaysStopAt="true" /> |
| <variable name="VAR" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" /> |
| <variable name="ITER_TYPE" expression="rightSideType()" defaultValue=""java.util.Iterator"" alwaysStopAt="false" /> |
| <variable name="CAST" expression="castToLeftSideType()" defaultValue="" alwaysStopAt="false" /> |
| <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 name="iten" value="while($ENUM$.hasMoreElements()){ $TYPE$ $VAR$ = $CAST$ $ENUM$.nextElement(); $END$ }" |
| resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.iten" toReformat="true" toShortenFQNames="true"> |
| <variable name="ENUM" expression="variableOfType("java.util.Enumeration")" defaultValue=""enumeration"" alwaysStopAt="true" /> |
| <variable name="TYPE" expression="rightSideType()" defaultValue=""Object"" alwaysStopAt="true" /> |
| <variable name="VAR" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" /> |
| <variable name="CAST" expression="castToLeftSideType()" defaultValue="" alwaysStopAt="false" /> |
| <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 name="itit" value="while($ITER$.hasNext()){ $TYPE$ $VAR$ = $CAST$ $ITER$.next(); $END$ }" |
| resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.itit" toReformat="true" toShortenFQNames="true"> |
| <variable name="ITER" expression="variableOfType("java.util.Iterator")" defaultValue=""iterator"" alwaysStopAt="true"/> |
| <variable name="TYPE" expression="rightSideType()" defaultValue=""Object"" alwaysStopAt="true"/> |
| <variable name="VAR" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true"/> |
| <variable name="CAST" expression="castToLeftSideType()" defaultValue="" alwaysStopAt="false"/> |
| <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 name="itli" value="for (int $INDEX$ = 0; $INDEX$ < $LIST$.size(); $INDEX$++) { $ELEMENT_TYPE$ $VAR$ = $CAST$ $LIST$.get($INDEX$); $END$ }" |
| resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.itli" toReformat="true" toShortenFQNames="true"> |
| <variable name="INDEX" expression="suggestIndexName()" defaultValue="" alwaysStopAt="true" /> |
| <variable name="LIST" expression="variableOfType("java.util.List")" defaultValue=""list"" alwaysStopAt="true" /> |
| <variable name="ELEMENT_TYPE" expression="guessElementType(LIST)" defaultValue=""Object"" alwaysStopAt="true" /> |
| <variable name="VAR" expression="suggestVariableName()" defaultValue=""o"" alwaysStopAt="true" /> |
| <variable name="CAST" expression="castToLeftSideType()" defaultValue="" alwaysStopAt="false" /> |
| <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 name="ittok" value="for (java.util.StringTokenizer $TOKENIZER$ = new java.util.StringTokenizer($STRING$); $TOKENIZER$.hasMoreTokens(); ) { String $VAR$ = $TOKENIZER_COPY$.nextToken(); $END$ } " |
| resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.ittok" toReformat="true" toShortenFQNames="true"> |
| <variable name="TOKENIZER" expression="suggestVariableName()" defaultValue=""tokenizer"" alwaysStopAt="true" /> |
| <variable name="STRING" expression="variableOfType("java.lang.String")" defaultValue="" alwaysStopAt="true" /> |
| <variable name="VAR" expression="suggestVariableName()" defaultValue=""token"" alwaysStopAt="true" /> |
| <variable name="TOKENIZER_COPY" expression="TOKENIZER " defaultValue="" alwaysStopAt="false" /> |
| <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 name="itve" value="for(int $INDEX$ = 0; $INDEX$ < $VECTOR$.size(); $INDEX$++) { $ELEMENT_TYPE$ $VAR$ = $CAST$ $VECTOR$.elementAt($INDEX$); $END$ }" |
| resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.itve" toReformat="true" toShortenFQNames="true"> |
| <variable name="INDEX" expression="suggestIndexName()" defaultValue="" alwaysStopAt="true" /> |
| <variable name="VECTOR" expression="variableOfType("java.util.Vector")" defaultValue=""vector"" alwaysStopAt="true" /> |
| <variable name="ELEMENT_TYPE" expression="guessElementType(VECTOR)" defaultValue=""Object"" alwaysStopAt="true" /> |
| <variable name="VAR" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" /> |
| <variable name="CAST" expression="castToLeftSideType()" defaultValue="" alwaysStopAt="false" /> |
| <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 name="ritar" value="for(int $INDEX$ = $ARRAY$.length - 1; $INDEX$ >= 0; $INDEX$--) { $ELEMENT_TYPE$ $VAR$ = $ARRAY$[$INDEX$]; $END$ }" |
| resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.ritar" toReformat="true" toShortenFQNames="true"> |
| <variable name="INDEX" expression="suggestIndexName()" defaultValue="" alwaysStopAt="true" /> |
| <variable name="ARRAY" expression="arrayVariable()" defaultValue=""array"" alwaysStopAt="true" /> |
| <variable name="ELEMENT_TYPE" expression="componentTypeOf(ARRAY)" defaultValue="" alwaysStopAt="false" /> |
| <variable name="VAR" expression="suggestVariableName()" 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 name="iter" value="for ($ELEMENT_TYPE$ $VAR$ : $ITERABLE_TYPE$) { $END$ }" |
| resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.iter" toReformat="true" toShortenFQNames="true"> |
| <variable name="ITERABLE_TYPE" expression="iterableVariable()" defaultValue="" alwaysStopAt="true" /> |
| <variable name="ELEMENT_TYPE" expression="iterableComponentType(ITERABLE_TYPE)" defaultValue=""java.lang.Object"" alwaysStopAt="false" /> |
| <variable name="VAR" expression="suggestVariableName()" 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> |
| </templateSet> |