码迷,mamicode.com
首页 > 编程语言 > 详细

java快捷键

时间:2015-11-16 20:55:39      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:

常用快捷键
Shift+Enter:在当前行下插入新行,当光标正在一行的中间时才体现其价值

Ctrl+Shift+Enter:在当前行上插入新行

Ctrl+D:删除整行

Ctrl+Alt+J:合并行,相当于vi中的J

Ctrl+Alt+UP/DOWN:向上/下复制行

Alt+UP/DOWN:行向上/下移动

F2:显示Tip

Ctrl+Shift+F:Format,对文档进行格式整理

Ctrl+Alt+/:word自动完成

Ctrl+1:快速解决(quick fix)

Alt+/:内容帮助(Content Assist),用于激活输入模板等

输入模板(Java)
使用方式:输入模板的名字,然后使用Alt+/快捷键

cast:

${type} ${new_name} = (${type}) ${name};

catch:

catch (${Exception} ${exception_variable_name}) {
${cursor}// ${todo}: handle exception
}

do:

do {
${line_selection}${cursor}
} while (${condition:var(boolean)});

else:

else {
${cursor}
}

 

elseif:

else if (${condition:var(boolean)}) {
${cursor}
}

 

for:

for (int ${index} = 0; ${index} < ${array}.length; ${index}++) {
${line_selection}${cursor}
}

foreach:

for (${iterable_type} ${iterable_element} : ${iterable}) {
${cursor}
}

if:

if (${condition:var(boolean)}) {
${line_selection}${cursor}
}

 

instanceof:

if (${name:var} instanceof ${type}) {
${type} ${new_name} = (${type})${name};
${cursor}
}

 

main:

public static void main(String[] args) {
${cursor}
}

 

new:

${type} ${name} = new ${type}(${arguments});

private_method:

private ${return_type} ${name}(${}) {
${cursor}
}

 

private_static_method:

private static ${return_type} ${name}(${}) {
${cursor}
}

 

protected_method:

protected ${return_type} ${name}(${}) {
${cursor}
}

 

public_method:

public ${return_type} ${name}(${}) {
${cursor}
}

 

runnable:

new Runnable() {
public void run() {
${line_selection}
}
}

 

static_final:

${visibility:link(public,protected,private)} static final ${type:link(String,int)} ${NAME};

switch:

switch (${key}) {
case ${value}:
${cursor}
break;

default:
break;
}

 

synchronized:

synchronized (${mutex:var}) {
${line_selection}
}

 

syserr:

System.err.println(${word_selection}${});${cursor}


sysout:

System.out.println(${word_selection}${});${cursor}

systrace:

System.out.println("${enclosing_type}.${enclosing_method}()");

test:

public void test${name}() throws Exception {
${cursor}
}

 

toarray:

(${type:elemType(collection)}[]) ${collection}.toArray(new ${type}[${collection}.size()])

try:

try {
${line_selection}${cursor}
} catch (${Exception} ${exception_variable_name}) {
// ${todo}: handle exception
}

while:

while (${en:var(java.util.Enumeration)}.hasMoreElements()) {
${type:argType(en)} ${elem:newName(type)} = (${type}) ${en}.nextElement();
${cursor}
}

 

java快捷键

标签:

原文地址:http://www.cnblogs.com/ldphoebe/p/4969824.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!