Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse: try-catch code completion

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Eclipse 3.0.1. When I write coding, for example, I type "try", it will not give all code completion, it will not generate [b]automatically[b] whole try-catch template, and If-else will not, either.

How to set it up ? I think it will be more convenient.
 
Pavan Kumar
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Edward,

When you type try and press Ctrl + spacebar, a popup will appear with options, you could select try-catch block.

Second option, if you want a block of code to be surrounded with a try catch block, select the code that you want to be included in try-catch, right click brings up a popup menu source->surround with try-catch block.

For more options, go to Window-->preferences-->java-->editor-->templates.

This has a list of all quick assists.

Hope that helps,
Cnu,
 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But the problem is , when I type try, and press Ctrl+Space, nothing will pop up. And I change the java template, it will NOT work.

I don't know why.

Thanks .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic