Lines 75-88
Link Here
|
75 |
<codetemplate abbreviation="serr"><code><![CDATA[System.err.println("${cursor}");]]></code></codetemplate> |
75 |
<codetemplate abbreviation="serr"><code><![CDATA[System.err.println("${cursor}");]]></code></codetemplate> |
76 |
<codetemplate abbreviation="sout"><code><![CDATA[System.out.println("${cursor}");]]></code></codetemplate> |
76 |
<codetemplate abbreviation="sout"><code><![CDATA[System.out.println("${cursor}");]]></code></codetemplate> |
77 |
<codetemplate abbreviation="st"><code><![CDATA[static ]]></code></codetemplate> |
77 |
<codetemplate abbreviation="st"><code><![CDATA[static ]]></code></codetemplate> |
78 |
<codetemplate abbreviation="sw"><code><![CDATA[switch (]]></code></codetemplate> |
78 |
<codetemplate abbreviation="sw"><code><![CDATA[switch (${var instanceof="java.lang.Enum"}) { |
|
|
79 |
case ${what}: |
80 |
${cursor} |
81 |
break; |
82 |
default: |
83 |
throw new AssertionError(); |
84 |
} |
85 |
]]></code></codetemplate> |
86 |
<codetemplate abbreviation="cs"><code><![CDATA[case ${what}: |
87 |
${cursor} |
88 |
break; |
89 |
]]></code></codetemplate> |
90 |
<codetemplate abbreviation="tw"><code><![CDATA[throw ${exc instanceof="java.lang.Throwable}]]></code></codetemplate> |
91 |
<codetemplate abbreviation="twn"><code><![CDATA[throw new ${exc default="IllegalStateException"}("${arg}");]]></code></codetemplate> |
92 |
<codetemplate abbreviation="wh"><code><![CDATA[while (${expr instanceof="boolean" default="true"}) { |
93 |
${cursor} |
94 |
} |
95 |
]]></code></codetemplate> |
96 |
|
79 |
<codetemplate abbreviation="sy"><code><![CDATA[synchronized ]]></code></codetemplate> |
97 |
<codetemplate abbreviation="sy"><code><![CDATA[synchronized ]]></code></codetemplate> |
80 |
<codetemplate abbreviation="tds"><code><![CDATA[Thread.dumpStack();]]></code></codetemplate> |
98 |
<codetemplate abbreviation="tds"><code><![CDATA[Thread.dumpStack();]]></code></codetemplate> |
81 |
<codetemplate abbreviation="th"><code><![CDATA[throws ]]></code></codetemplate> |
99 |
<codetemplate abbreviation="th"><code><![CDATA[throws ]]></code></codetemplate> |
82 |
<codetemplate abbreviation="tw"><code><![CDATA[throw ]]></code></codetemplate> |
|
|
83 |
<codetemplate abbreviation="twn"><code><![CDATA[throw new ]]></code></codetemplate> |
84 |
<codetemplate abbreviation="wh"><code><![CDATA[while (]]></code></codetemplate> |
85 |
|
86 |
<codetemplate abbreviation="En"><code><![CDATA[Enumeration]]></code></codetemplate> |
100 |
<codetemplate abbreviation="En"><code><![CDATA[Enumeration]]></code></codetemplate> |
87 |
<codetemplate abbreviation="Ex"><code><![CDATA[Exception]]></code></codetemplate> |
101 |
<codetemplate abbreviation="Ex"><code><![CDATA[Exception]]></code></codetemplate> |
88 |
<codetemplate abbreviation="Ob"><code><![CDATA[Object]]></code></codetemplate> |
102 |
<codetemplate abbreviation="Ob"><code><![CDATA[Object]]></code></codetemplate> |
Lines 246-252
Link Here
|
246 |
|
260 |
|
247 |
<codetemplate abbreviation="bcom"> |
261 |
<codetemplate abbreviation="bcom"> |
248 |
<code> |
262 |
<code> |
249 |
<![CDATA[/*${selection}*/]]> |
263 |
<![CDATA[/*${cursor}*/]]> |
250 |
</code> |
264 |
</code> |
251 |
</codetemplate> |
265 |
</codetemplate> |
252 |
|
266 |
|
Lines 258-261
Link Here
|
258 |
</code> |
272 |
</code> |
259 |
</codetemplate> |
273 |
</codetemplate> |
260 |
|
274 |
|
|
|
275 |
<!-- Added in 6.8 --> |
276 |
|
277 |
<!-- Arrays and List conversion and sorting --> |
278 |
<codetemplate abbreviation="2arr" contexts="BLOCK,CASE" descriptionId="CT_fori"> |
279 |
<code> |
280 |
<![CDATA[${clazz}[] ${var newVarName default="arr"} = (${clazz}[]) ${coll instanceof="java.util.Collection"}.toArray(new ${clazz}[${coll}.size()]); |
281 |
]]> |
282 |
</code> |
283 |
</codetemplate> |
284 |
|
285 |
<codetemplate abbreviation="2l"><code><![CDATA[${ltype type="java.util.List" default="List" editable="false"}<${arrType type="java.lang.String" default="String"}> ${var newVarName default="l"} = ${arrays type="java.util.Arrays" default="Arrays" editable="false"}.asList(${arr array}); |
286 |
]]></code></codetemplate> |
287 |
<codetemplate abbreviation="2nl"><code><![CDATA[${baseType type="java.util.List" default="List" editable="false"} <${type default="String"}> ${var newVarName default="l"} = new ${listType type="java.util.ArrayList" default="ArrayList" editable=false} <${type}>( |
288 |
${arrays type="java.util.Arrays" default="Arrays" editable="false"}.asList(${arr array}); |
289 |
${cursor} |
290 |
]]></code></codetemplate> |
291 |
<codetemplate abbreviation="2s"><code><![CDATA[${baseType type="java.util.Set" default="Set" editable="false"} <${type default="String"}> ${var newVarName default="s"} = new ${listType type="java.util.HashSet" default="HashSet" editable=false} <${type}>(${arrays type="java.util.Arrays" default="Arrays" editable="false"}.asList(${arr array})); |
292 |
${cursor}]]></code></codetemplate> |
293 |
<codetemplate abbreviation="asort"><code><![CDATA[${baseType type="java.util.Arrays" default="Arrays" editable="false"}.sort (${var array}); |
294 |
${cursor}]]></code></codetemplate> |
295 |
<codetemplate abbreviation="csort"><code><![CDATA[${collsType type="java.util.Collections" default="Collections" editable="false"}.sort(${var instanceof="java.util.List"}; |
296 |
${cursor}]]></code></codetemplate> |
297 |
|
298 |
<!-- Instantiating common classes --> |
299 |
|
300 |
<codetemplate abbreviation="map"><code><![CDATA[${map type="java.util.Map" default="Map" editable="false"}<${keytype default="String"},${valtype default="String"}> ${var newVarName default="m"} = new ${mtype type="java.util.HashMap"}<${keytype},${valtype}>(${cursor}); |
301 |
]]></code></codetemplate> |
302 |
<codetemplate abbreviation="set"><code><![CDATA[${stype type="java.util.Set" default="Set" editable="false"}<${paramType default="String"}> ${var newVarName default="s"} = new ${setType type="java.util.HashSet" editable="false"}<${paramType}>(); |
303 |
${cursor}]]></code></codetemplate> |
304 |
<codetemplate abbreviation="arl"><code><![CDATA[${baseType type="java.util.List" default="List" editable="false"} <${type default="String"}> ${var newVarName default="l"} = new ${listType type="java.util.ArrayList" default="ArrayList" editable=false} <${type}>(${arg default=""}); |
305 |
${cursor} |
306 |
]]></code></codetemplate> |
307 |
<codetemplate abbreviation="ll"><code><![CDATA[${stype type="java.util.List" default="Set" editable="false"}<${paramType default="String"}> ${var newVarName default="s"} = new ${setType type="java.util.LinkedList" editable="false"}<${paramType}>(); |
308 |
${cursor}]]></code></codetemplate> |
309 |
<codetemplate abbreviation="al"><code><![CDATA[${stype type="java.util.List" default="Set" editable="false"}<${paramType default="String"}> ${var newVarName default="s"} = new ${setType type="java.util.ArrayList" editable="false"}<${paramType}>(); |
310 |
${cursor}]]></code></codetemplate> |
311 |
|
312 |
<!-- Miscellaneous common code patterns --> |
313 |
<codetemplate abbreviation="rn"><code><![CDATA[return null;]]></code></codetemplate> |
314 |
<codetemplate abbreviation="f"><code><![CDATA[final ]]></code></codetemplate> |
315 |
<codetemplate abbreviation="ps"><code><![CDATA[private static ]]></code></codetemplate> |
316 |
<codetemplate abbreviation="Ps"><code><![CDATA[public static ]]></code></codetemplate> |
317 |
<codetemplate abbreviation="pf"><code><![CDATA[private final ]]></code></codetemplate> |
318 |
<codetemplate abbreviation="Pf"><code><![CDATA[public final ]]></code></codetemplate> |
319 |
<codetemplate abbreviation="spl"><code><![CDATA[ |
320 |
for (String ${str newVarName default="s"} : ${string instanceof="java.lang.String"}.split("${expr default=","}")) { |
321 |
${cursor} |
322 |
} |
323 |
]]></code></codetemplate> |
324 |
<codetemplate abbreviation="n"> |
325 |
<!-- keep newo for people who are used to it, but this is easier --> |
326 |
<code> |
327 |
<![CDATA[${TYPE default="Object"} ${OBJ newVarName default="obj"} = new ${TYPE}(${cursor});]]> |
328 |
</code> |
329 |
</codetemplate> |
330 |
|
331 |
<!-- Public method generation --> |
332 |
|
333 |
<codetemplate abbreviation="Pm"><code><![CDATA[ public ${ret default="void"} ${mname default="method"}(${args}) { |
334 |
${cursor} |
335 |
} |
336 |
]]></code></codetemplate> |
337 |
<codetemplate abbreviation="Pfm"><code><![CDATA[ public final ${ret default="void"} ${mname default="method"}(${args}) { |
338 |
${cursor} |
339 |
} |
340 |
]]></code></codetemplate> |
341 |
<codetemplate abbreviation="Psfm"><code><![CDATA[ public final ${ret default="void"} ${mname default="method"}(${args}) { |
342 |
${cursor} |
343 |
} |
344 |
]]></code></codetemplate> |
345 |
|
346 |
<!-- Protected method generation --> |
347 |
|
348 |
<codetemplate abbreviation="prm"><code><![CDATA[ protected ${ret default="void"} ${mname default="method"}(${args}) { |
349 |
${cursor} |
350 |
} |
351 |
]]></code></codetemplate> |
352 |
<codetemplate abbreviation="prfm"><code><![CDATA[ protected final ${ret default="void"} ${mname default="method"}(${args}) { |
353 |
${cursor} |
354 |
} |
355 |
]]></code></codetemplate> |
356 |
<codetemplate abbreviation="prsfm"><code><![CDATA[ protected static final ${ret default="void"} ${mname default="method"}(${args}) { |
357 |
${cursor} |
358 |
} |
359 |
]]></code></codetemplate> |
360 |
|
361 |
|
362 |
<!-- Private method generation --> |
363 |
|
364 |
<codetemplate abbreviation="pm"><code><![CDATA[ private ${ret default="void"} ${mname default="method"}(${args}) { |
365 |
${cursor} |
366 |
} |
367 |
]]></code></codetemplate> |
368 |
<codetemplate abbreviation="pfm"><code><![CDATA[ private final ${ret default="void"} ${mname default="method"}(${args}) { |
369 |
${cursor} |
370 |
} |
371 |
]]></code></codetemplate> |
372 |
<codetemplate abbreviation="psfm"><code><![CDATA[ private static final ${ret default="void"} ${mname default="method"}(${args}) { |
373 |
${cursor} |
374 |
} |
375 |
]]></code></codetemplate> |
376 |
|
377 |
<codetemplate abbreviation="m"><code><![CDATA[ ${private} ${static} ${final} ${ret default="void"} ${mname default="method"}(${args}) { |
378 |
${cursor} |
379 |
} |
380 |
]]></code></codetemplate> |
381 |
|
382 |
|
383 |
<!-- Inner class generation --> |
384 |
|
385 |
<codetemplate abbreviation="pfc"><code><![CDATA[private final class ${Type} { |
386 |
${Type}() { |
387 |
${cursor} |
388 |
} |
389 |
} |
390 |
]]></code></codetemplate> |
391 |
<codetemplate abbreviation="psfc"><code><![CDATA[private static final class ${Type} { |
392 |
${Type}() { |
393 |
${cursor} |
394 |
} |
395 |
} |
396 |
]]></code></codetemplate> |
397 |
<codetemplate abbreviation="sfc"><code><![CDATA[static final class ${Type} { |
398 |
${Type}() { |
399 |
${cursor} |
400 |
} |
401 |
} |
402 |
]]></code></codetemplate> |
403 |
<codetemplate abbreviation="sc"><code><![CDATA[static class ${Type} { |
404 |
${Type}() { |
405 |
${cursor} |
406 |
} |
407 |
} |
408 |
]]></code></codetemplate> |
409 |
<codetemplate abbreviation="fc"><code><![CDATA[final class ${Type} { |
410 |
${Type}() { |
411 |
${cursor} |
412 |
} |
413 |
} |
414 |
]]></code></codetemplate> |
415 |
<codetemplate abbreviation="ic"><code><![CDATA[class ${Type} { |
416 |
${Type}() { |
417 |
${cursor} |
418 |
} |
419 |
} |
420 |
]]></code></codetemplate> |
421 |
<codetemplate abbreviation="cl"><code><![CDATA[${private} ${static} ${final} class ${Type} { |
422 |
${cursor} |
423 |
} |
424 |
]]></code></codetemplate> |
425 |
<codetemplate abbreviation="cli"><code><![CDATA[${private} ${static} ${final} class ${Type} implements ${Iface} { |
426 |
${cursor} |
427 |
} |
428 |
]]></code></codetemplate> |
429 |
<codetemplate abbreviation="if" contexts="BLOCK,CASE" descriptionId="CT_iff"> |
430 |
<code> |
431 |
<![CDATA[if (${EXP instanceof="boolean" default="exp"}) { |
432 |
${selection}${cursor} |
433 |
} |
434 |
]]> |
435 |
</code> |
436 |
</codetemplate> |
437 |
<codetemplate abbreviation="ife" contexts="BLOCK,CASE" descriptionId="CT_ifelse"> |
438 |
<code> |
439 |
<![CDATA[if (${EXP instanceof="boolean" default="exp"}) { |
440 |
${selection}${cursor} |
441 |
} else { |
442 |
} |
443 |
]]> |
444 |
</code> |
445 |
</codetemplate> |
446 |
|
261 |
</codetemplates> |
447 |
</codetemplates> |