File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse: try-catch code completion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse: try-catch code completion" Watch "Eclipse: try-catch code completion" New topic
Author

Eclipse: try-catch code completion

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
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

Joined: Jan 23, 2004
Posts: 78
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,


formerly known as Cnu
Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
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 .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse: try-catch code completion