Templates and imports [message #175510] |
Thu, 19 October 2006 14:28 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05188 seconds