Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Templates and imports
Templates and imports [message #175510] Thu, 19 October 2006 14:28 Go to next message
Eclipse UserFriend
Originally posted by: wojtek.a.com

If I have a code template such as:
----------------------------------------
catch( SQLException e )
{
${cursor}// TODO handle bad SQL execution
}
finally
{
try
{
conn.close();
}
catch( SQLException e )
{
// oh well ....
}
}
----------------------------------------

When this code is inserted, then the SQLException is flagged as not being found. I need to place the cursor after SQLException then CTRL-SPACE which
inserts the import statement.

Is there some setting which will automatically insert imports for code templates? There is no variable right now where I can place the correct import
statement.
Re: Templates and imports [message #175529 is a reply to message #175510] Thu, 19 October 2006 15:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wayne.beaton._NOSPAM_eclipse.org

Wojtek wrote:
> If I have a code template such as:
> ----------------------------------------
> catch( SQLException e )
> {
> ${cursor}// TODO handle bad SQL execution
> }
> finally
> {
> try
> {
> conn.close();
> }
> catch( SQLException e )
> {
> // oh well ....
> }
> }
> ----------------------------------------
>
> When this code is inserted, then the SQLException is flagged as not
> being found. I need to place the cursor after SQLException then
> CTRL-SPACE which inserts the import statement.
>
> Is there some setting which will automatically insert imports for code
> templates? There is no variable right now where I can place the correct
> import statement.

This appears to be addressed in Eclipse 3.3.

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=10694

I haven't tried it out yet, but I'd love to hear about your experience
if you decide to give it a look (be sure to comment on the bug if you
have anything to add).

Wayne
Re: Templates and imports [message #175679 is a reply to message #175529] Thu, 19 October 2006 22:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wojtek.a.com

Wayne Beaton wrote:
> This appears to be addressed in Eclipse 3.3.
>
> See https://bugs.eclipse.org/bugs/show_bug.cgi?id=10694

OK, thanks. I added my comments.
Re: Templates and imports [message #175894 is a reply to message #175679] Mon, 23 October 2006 14:25 Go to previous message
Eclipse UserFriend
Originally posted by: wojtek.a.com

Wojtek wrote:
> Wayne Beaton wrote:
>> This appears to be addressed in Eclipse 3.3.
>>
>> See https://bugs.eclipse.org/bugs/show_bug.cgi?id=10694
>
> OK, thanks. I added my comments.

New bug 161949
Previous Topic:cvs and locally changed files
Next Topic:Importing plugins from Eclipse 3.1 to 3.2
Goto Forum:
  


Current Time: Fri Apr 26 03:50:23 GMT 2024

Powered by FUDForum. Page generated in 0.08816 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top