eclipse中的快捷键

1 快速生成get/set方法

选中属性,右键->Source->Generate Getters and Setters...



2 添加行号

在JDT靠左边的位置右键->Show Line Numbers



3 添加单行注释---//(一行或者多行)

第一种方法:选中代码,右键->Source->Toggle Comment

第二种方法:选中代码,Ctrl+/



4 添加多行注释---/*......*/(一行或者多行)

第一种方法:选中代码,右键->Source->Add Block Comment

第二种方法:选中代码,Ctrl+Shift+/



5 撤销多行注释---/*......*/(一行或者多行)

第一种方法:选中代码,右键->Source->Remove Block Comment

第二种方法:选中代码,Ctrl+Shift+/



6 将一段代码使用特定关键字包围起来,如try...catch,do...while,for,while,if,synchornized等等

选中代码,右键->Surround With->try...catch,do...while,for,while,if,synchornized