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:33

CTRL+3 brings up a type-ahead list of any menu command.

查看更多
无色无味的生活
3楼-- · 2019-01-01 14:34

Breakpoint on Exception

Eclipse let you set breakpoints based on where an Exception occurs.
You access the option via the "j!" alt text http://help.eclipse.org/stable/topic/org.eclipse.jdt.doc.user/images/org.eclipse.jdt.debug.ui/elcl16/exc_catch.png icon in the debugging window.

alt text http://blogs.bytecode.com.au/glen/2007/04/06/images/2007/AddExceptionWindow.png

The official help topic "Add Java Exception Breakpoint " has more on this.

  • The Uncaught Exception option is to suspend execution when an exception of the same type as the breakpoint is thrown in an uncaught location.
  • The Caught Exception option is to suspend execution when an exception of the same type as the breakpoint is thrown in a caught location.
  • do not forget the Exception Breakpoint Suspend on Subclass of this Exception:
    to suspend execution when subclasses of the exception type are encountered.
    For example, if an exception breakpoint for RuntimeException is configured to suspend on subclasses, it will also be triggered by a NullPointerException.

alt text http://help.eclipse.org/stable/topic/org.eclipse.jdt.doc.user/reference/breakpoints/images/ref-breakpoint_suspendsubclass.PNG

查看更多
看风景的人
4楼-- · 2019-01-01 14:34

Not so Hidden but IMO the best Trick.

Assuming Default Settings (and you have'nt added new snippets)

Highlight (or select) a Text (String or Variable)...Press Ctrl+Space. Hit End+Enter. the "sysout" snippet is triggered which wraps the selection around as its parameter.

eg.

 "hello world!"

becomes
System.out.println("hello world!");

I love it so much that i've implemented a similar snippet for Android's Toast and Log.i() HUGE Time saver during Manual Debugging....

查看更多
怪性笑人.
5楼-- · 2019-01-01 14:35

Absolutely, Ctrl+Q to go to last edit location. It is very useful just after being interrupted by phone, boss or others.

查看更多
余生请多指教
6楼-- · 2019-01-01 14:36

Ctrl+Alt+UP or Ctrl+Alt+DOWN to copy lines

查看更多
听够珍惜
7楼-- · 2019-01-01 14:36

Code completion supports CamelCase, e.g., typing CWAR will show a result for ClassWithAReallyLongName. Start using this feature and you'll never type another long classname again.

(parts copied from another answer because i think answers w/ just one hint/tip are best for polling)

查看更多
登录 后发表回答