UltiSnips/UltiSnips/java.snippets
2009-08-17 17:29:06 +02:00

207 lines
2.8 KiB
Plaintext

###########################################################################
# TEXTMATE SNIPPETS #
###########################################################################
snippet ab "abstract" b
abstract
endsnippet
snippet as "assert" b
assert ${1:test}${2/(.+)/(?1: \: ")/}${2:Failure message}${2/(.+)/(?1:")/};$0
endsnippet
snippet br "break"
break;
endsnippet
snippet cs "case" b
case $1:
$2
$0
endsnippet
snippet ca "catch" b
catch (${1:Exception} ${2:e}) {
$0
}
endsnippet
snippet cl "class" b
class ${1:`!p if len(fn):
res = fn.split('.')[-2]
else:
res = "untitled"`} ${2:extends ${3:Parent} }${4:implements ${5:Interface} }{
$0
}
endsnippet
snippet cos "constant string" b
static public final String ${1:var} = "$2";$0
endsnippet
snippet co "constant" b
static public final ${1:String} ${2:var} = $3;$0
endsnippet
snippet de "default" b
default:
$0
endsnippet
snippet elif "else if" b
else if ($1) {
$0
}
endsnippet
snippet el "else" b
else {
$0
}
endsnippet
snippet fi "final" b
final
endsnippet
snippet fore "for (each)" b
for ($1 : $2) {
$0
}
endsnippet
snippet for "for" b
for ($1; $2; $3) {
$0
}
endsnippet
snippet if "if" b
if ($1) {
$0
}
endsnippet
snippet imt "import junit_framework_TestCase;" b
import junit.framework.TestCase;
$0
endsnippet
snippet im "import" b
import
endsnippet
snippet in "interface" b
interface ${1:`!p if len(fn):
res = fn.split('.')[-2]
else:
res = "untitled"`} ${2:extends ${3:Parent} }{
$0
}
endsnippet
snippet j.b "java_beans_" i
java.beans.
endsnippet
snippet j.i "java_io" i
java.io.
endsnippet
snippet j.m "java_math" i
java.math.
endsnippet
snippet j.n "java_net_" i
java.net.
endsnippet
snippet j.u "java_util_" i
java.util.
endsnippet
snippet main "method (main)" b
public static void main(String[] args) {
$0
}
endsnippet
snippet m "method" b
${1:void} ${2:method}($3) ${4:throws $5 }{
$0
}
endsnippet
snippet pa "package" b
package
endsnippet
snippet p "print" b
System.out.print($1);$0
endsnippet
snippet pl "println" b
System.out.println($1);$0
endsnippet
snippet pr "private" b
private
endsnippet
snippet po "protected" b
protected
endsnippet
snippet pu "public" b
public
endsnippet
snippet re "return" b
return
endsnippet
snippet st "static"
static
endsnippet
snippet sw "switch" b
switch ($1) {
$0
}
endsnippet
snippet sy "synchronized"
synchronized
endsnippet
snippet tc "test case"
public class ${1:`!p if len(fn):
res = fn.split('.')[-2]
else:
res = "untitled"`} extends ${2:TestCase} {
$0
}
endsnippet
snippet t "test" b
public void test${1:Name}() throws Exception {
$0
}
endsnippet
snippet th "throw" b
throw $0
endsnippet
snippet v "variable" b
${1:String} ${2:var}${3: = ${0:null}};
endsnippet
snippet wh "while" b
while ($1) {
$0
}
endsnippet