Hidden features of Eclipse [closed]

2019-01-01 14:09发布

Alright it can be a lame question, but everybody uses these things differently. What's some of the best time savers out there for this IDE.

Tom

标签: java eclipse ide
30条回答
笑指拈花
2楼-- · 2019-01-01 14:36

Alt+Up or Alt+Down to move lines

查看更多
浅入江南
3楼-- · 2019-01-01 14:37

ctrl-shift-r and its buddy, ctrl-shift-t, to open a resource or type, respectively. Resources includes all files in your open projects (including non-java files), and types includes java types either in your projects, or in a library included in the projects.

查看更多
若你有天会懂
4楼-- · 2019-01-01 14:41
  • CTRL-SHIFT-g : finds usages of the method or field under the cursor, absolutely necessary for understanding code
  • CTRL-F6 : navigate between the list of open editor windows, if you just type it once and let go you toggle back to the previous editor window, doing this successively is a nice way to jump back and forth
  • CTRL-t : on a class or method will show you the type hierarchy, very useful for finding implementations of an interface method for example
查看更多
后来的你喜欢了谁
5楼-- · 2019-01-01 14:41

Alt-Shift-R stands for rename, not refactor. Refactoring is a more general term (as defined by the book).

Nevertheless, it is one of my favorite refactorings. Others include:

Extract Local Variable is especially useful when I don't remember (or bother to type) the result type of a method. Assuming you have a method JdbcTemplate createJdbcTemplate() in your class, write some code such as this:

void someQuery() {
    createJdbcTemplate()
}

Select the expression createJdbcTemplate(), click Alt-Shift-L, type the name of variable and press enter.

void someQuery() {
    JdbcTemplate myTemplate = createJdbcTemplate();
}
查看更多
只靠听说
6楼-- · 2019-01-01 14:41

Alt+Shift+Up Arrow does escalating selection. Alt+Shift+Down does the opposite.

查看更多
笑指拈花
7楼-- · 2019-01-01 14:42

CTRL + D - to delete current line

查看更多
登录 后发表回答