Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » prevent automatic import-statements
prevent automatic import-statements [message #93128] Mon, 08 September 2003 08:53 Go to next message
Eclipse UserFriend
Hello, when I type a unused type in the editor, the codegenerator adds the
required import-statemant automatically. But I don`t want that. I want to
control what and when I import by myself. I think in a previous version of
eclipse a lightbulb with a red sign appeared and when I clicked on it, it
suggest me to import. Thats the way I would prefer it to work. Can I
change it somehow ?
Re: prevent automatic import-statements [message #93143 is a reply to message #93128] Mon, 08 September 2003 08:59 Go to previous messageGo to next message
Eclipse UserFriend
Window->Preferences->Java->Editor->Code Assist->Insert single proposals
automatically

Jerome

"Robert Ludwig" <SCHWERTFISCHTROMBOSE@GMX.DE> wrote in message
news:bjhu4q$9j3$1@eclipse.org...
> Hello, when I type a unused type in the editor, the codegenerator adds the
> required import-statemant automatically. But I don`t want that. I want to
> control what and when I import by myself. I think in a previous version of
> eclipse a lightbulb with a red sign appeared and when I clicked on it, it
> suggest me to import. Thats the way I would prefer it to work. Can I
> change it somehow ?
>
Re: prevent automatic import-statements [message #93156 is a reply to message #93143] Mon, 08 September 2003 09:01 Go to previous messageGo to next message
Eclipse UserFriend
Sorry I meant: Window->Preferences->Java->Editor->Code Assist->Automatically
add import instead of qualified name

"Jerome Lanneluc" <jerome_lanneluc@fr.ibm.com> wrote in message
news:bjhud8$a04$1@eclipse.org...
> Window->Preferences->Java->Editor->Code Assist->Insert single proposals
> automatically
>
> Jerome
>
> "Robert Ludwig" <SCHWERTFISCHTROMBOSE@GMX.DE> wrote in message
> news:bjhu4q$9j3$1@eclipse.org...
> > Hello, when I type a unused type in the editor, the codegenerator adds
the
> > required import-statemant automatically. But I don`t want that. I want
to
> > control what and when I import by myself. I think in a previous version
of
> > eclipse a lightbulb with a red sign appeared and when I clicked on it,
it
> > suggest me to import. Thats the way I would prefer it to work. Can I
> > change it somehow ?
> >
>
>
Re: prevent automatic import-statements [message #93186 is a reply to message #93156] Mon, 08 September 2003 09:05 Go to previous messageGo to next message
Eclipse UserFriend
err, no, when I uncheck that one, eclipse adds the complete qualified name
instead of the import statement. But I onkly want to prevent the AUTOMATIC
import-statment-gneration. I want to be asked before, wether I want to
import or not. Like it was with that light-bulb thingy.
Re: prevent automatic import-statements [message #93230 is a reply to message #93186] Mon, 08 September 2003 10:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hcs33.egon.gyaloglo.hu

Hi,

The 2.1.1 version of Eclipse does not add the import automatically. It adds
when you use the content assist to get a completion for a class name. If you
write the whole class name without using completion the "light-bulb thingy"
appears and add a quick-fix possibility to import the class.
Personally: I think the completion *must* import (or use the full name)
because without that a compiler error occurs in the code (and because I like
the 'compile on save' functionality it would really hurt and slow me down).
Also you cannot get any content assist information for that class (and
variables of that type) until you import it manually.

HTH,
Regards,
Csaba

"Robert Ludwig" <SCHWERTFISCHTROMBOSE@GMX.DE> wrote in message
news:bjhuq2$ahc$1@eclipse.org...
> err, no, when I uncheck that one, eclipse adds the complete qualified name
> instead of the import statement. But I onkly want to prevent the AUTOMATIC
> import-statment-gneration. I want to be asked before, wether I want to
> import or not. Like it was with that light-bulb thingy.
>
Re: prevent automatic import-statements [message #93441 is a reply to message #93230] Tue, 09 September 2003 04:32 Go to previous messageGo to next message
Eclipse UserFriend
Is there any way to, like in IDEA, press eg ALT+ENTER to import the
package instead of getting your mouse, pointing it at the ligh bulb,
clicking, selecting...

thanks

Ronald


Horváth, Csaba wrote:

> Hi,

> The 2.1.1 version of Eclipse does not add the import automatically. It adds
> when you use the content assist to get a completion for a class name. If you
> write the whole class name without using completion the "light-bulb thingy"
> appears and add a quick-fix possibility to import the class.
> Personally: I think the completion *must* import (or use the full name)
> because without that a compiler error occurs in the code (and because I like
> the 'compile on save' functionality it would really hurt and slow me down).
> Also you cannot get any content assist information for that class (and
> variables of that type) until you import it manually.

> HTH,
> Regards,
> Csaba

> "Robert Ludwig" <SCHWERTFISCHTROMBOSE@GMX.DE> wrote in message
> news:bjhuq2$ahc$1@eclipse.org...
> > err, no, when I uncheck that one, eclipse adds the complete qualified name
> > instead of the import statement. But I onkly want to prevent the AUTOMATIC
> > import-statment-gneration. I want to be asked before, wether I want to
> > import or not. Like it was with that light-bulb thingy.
> >
Re: prevent automatic import-statements [message #93471 is a reply to message #93441] Tue, 09 September 2003 05:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hcs33.egon.gyaloglo.hu

You can do any of the following with keyboard shortcuts:

1. Use content assist (ctrl+space) when type the class name (or right after
it): this will add the necessary import
2. Use quick-fix (ctrl+1) when the cursor is in the type you want to create
the import to: it will show you the same possibilities as clicking on the
light bulb
3. You can use 'Organize Imports' to synchronize all import statements to
the code (ctrl+shift+o)

HTH,
Regards,
Csaba

"Ronald Vanschoren" <ronald.vanschoren@wol.be> wrote in message
news:bjk364$dev$1@eclipse.org...
> Is there any way to, like in IDEA, press eg ALT+ENTER to import the
> package instead of getting your mouse, pointing it at the ligh bulb,
> clicking, selecting...
>
> thanks
>
> Ronald
>
>
> Horv
Re: prevent automatic import-statements [message #94238 is a reply to message #93128] Thu, 11 September 2003 03:58 Go to previous message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Robert,.

following your other message you neither want an import nor full
qualification. Can you describe the use case for such a behavior?

Dani

Robert Ludwig wrote:

>Hello, when I type a unused type in the editor, the codegenerator adds the
>required import-statemant automatically. But I don`t want that. I want to
>control what and when I import by myself. I think in a previous version of
>eclipse a lightbulb with a red sign appeared and when I clicked on it, it
>suggest me to import. Thats the way I would prefer it to work. Can I
>change it somehow ?
>
>
Following your other comments you neither want an import nor full
qualification. Can you describe the use case for such a behavior?

Dani
Previous Topic:Package Explorer View Drop Action
Next Topic:hierarchy linked to correct editor?
Goto Forum:
  


Current Time: Mon May 12 12:05:20 EDT 2025

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

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

Back to the top