Skip to main content



      Home
Home » Newcomers » Newcomers » import code completion
import code completion [message #158965] Thu, 29 June 2006 14:29 Go to next message
Eclipse UserFriend
Originally posted by: attila_mh.yahoo.com

I am not sure how to explain this so please bare with me:

When I start typing in Eclipse an import declaration like:

import javax.se

the editor promptly gives me the available possibilites. However only
package imports are offered (they all end in .*). If I would like to use a
class I either have to type out the whole package name or I can hit "enter"
and then delete the .* and insert the class name. Is there a way to have the
code completion to insert only the package name and wait for further
keyboard inputs?

Like:
import javax.sec + keyboard command would complete it to: import
javax.security so I can type "." and have again the choice between * and
all available classes.

Right now, the only command I know is "enter". But if I hit enter I get
import javax.security.*;

thanks in advance,
Attila
Re: import code completion [message #158973 is a reply to message #158965] Thu, 29 June 2006 15:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wegener.cboenospam.com

Attila wrote:

> I am not sure how to explain this so please bare with me:

> When I start typing in Eclipse an import declaration like:

> import javax.se

> the editor promptly gives me the available possibilites. However only
> package imports are offered (they all end in .*). If I would like to use a
> class I either have to type out the whole package name or I can hit "enter"
> and then delete the .* and insert the class name. Is there a way to have the
> code completion to insert only the package name and wait for further
> keyboard inputs?

> Like:
> import javax.sec + keyboard command would complete it to: import
> javax.security so I can type "." and have again the choice between * and
> all available classes.

> Right now, the only command I know is "enter". But if I hit enter I get
> import javax.security.*;

> thanks in advance,
> Attila

If you know the class name, begin typing that instead of the package name.
Eclipse will automatically add the package name onto the front for you.
For example, if you are wanting to import java.util.HashMap, enter 'import
hash' and hit Ctrl-Space. The popup should list HashMap as the first
item. Select this and hit enter. Eclipse will change hash into
java.util.HashMap for you.

If you have the Content Assist option of Add import instead of qualified
name checked, you can have imports automatically added for you. You just
enter the class name (without the package) and hit Ctrl-Space. Eclipse
will offer a list of classes that match the name typed. If you select
one, Eclipse will add an import for the class and use the unqualified
class in your code.
Re: import code completion [message #159028 is a reply to message #158965] Fri, 30 June 2006 08:40 Go to previous messageGo to next message
Eclipse UserFriend
Attila wrote:

>I am not sure how to explain this so please bare with me:
>
>When I start typing in Eclipse an import declaration like:
>
>import javax.se
>
>the editor promptly gives me the available possibilites. However only
>package imports are offered (they all end in .*). If I would like to use a
>class I either have to type out the whole package name or I can hit "enter"
>and then delete the .* and insert the class name. Is there a way to have the
>code completion to insert only the package name and wait for further
>keyboard inputs?
>
>
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=41004

Dani

>Like:
>import javax.sec + keyboard command would complete it to: import
>javax.security so I can type "." and have again the choice between * and
>all available classes.
>
>Right now, the only command I know is "enter". But if I hit enter I get
>import javax.security.*;
>
>thanks in advance,
>Attila
>
>
>
>
Re: import code completion [message #159338 is a reply to message #158973] Mon, 03 July 2006 09:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: attila_mh.yahoo.com

Thanks, that is what I was looking for :)
Attila

"Dave Wegener" <wegener@cboenospam.com> wrote in message
news:49b4c7c5884dd4c777edbc3affaebd65$1@www.eclipse.org...
> Attila wrote:
>
> > I am not sure how to explain this so please bare with me:
>
> > When I start typing in Eclipse an import declaration like:
>
> > import javax.se
>
> > the editor promptly gives me the available possibilites. However only
> > package imports are offered (they all end in .*). If I would like to use
a
> > class I either have to type out the whole package name or I can hit
"enter"
> > and then delete the .* and insert the class name. Is there a way to have
the
> > code completion to insert only the package name and wait for further
> > keyboard inputs?
>
> > Like:
> > import javax.sec + keyboard command would complete it to: import
> > javax.security so I can type "." and have again the choice between *
and
> > all available classes.
>
> > Right now, the only command I know is "enter". But if I hit enter I get
> > import javax.security.*;
>
> > thanks in advance,
> > Attila
>
> If you know the class name, begin typing that instead of the package name.
> Eclipse will automatically add the package name onto the front for you.
> For example, if you are wanting to import java.util.HashMap, enter 'import
> hash' and hit Ctrl-Space. The popup should list HashMap as the first
> item. Select this and hit enter. Eclipse will change hash into
> java.util.HashMap for you.
>
> If you have the Content Assist option of Add import instead of qualified
> name checked, you can have imports automatically added for you. You just
> enter the class name (without the package) and hit Ctrl-Space. Eclipse
> will offer a list of classes that match the name typed. If you select
> one, Eclipse will add an import for the class and use the unqualified
> class in your code.
>
>
>
Re: import code completion [message #159345 is a reply to message #159028] Mon, 03 July 2006 09:35 Go to previous message
Eclipse UserFriend
Originally posted by: attila_mh.yahoo.com

Yup, also see Dave's answer to my post. I think it is cool and works for me
even if it is different then what I am used to.

thanks for your reply,
Attila

"Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
news:e8363i$o2u$1@utils.eclipse.org...
> Attila wrote:
>
> >I am not sure how to explain this so please bare with me:
> >
> >When I start typing in Eclipse an import declaration like:
> >
> >import javax.se
> >
> >the editor promptly gives me the available possibilites. However only
> >package imports are offered (they all end in .*). If I would like to use
a
> >class I either have to type out the whole package name or I can hit
"enter"
> >and then delete the .* and insert the class name. Is there a way to have
the
> >code completion to insert only the package name and wait for further
> >keyboard inputs?
> >
> >
> See https://bugs.eclipse.org/bugs/show_bug.cgi?id=41004
>
> Dani
>
> >Like:
> >import javax.sec + keyboard command would complete it to: import
> >javax.security so I can type "." and have again the choice between * and
> >all available classes.
> >
> >Right now, the only command I know is "enter". But if I hit enter I get
> >import javax.security.*;
> >
> >thanks in advance,
> >Attila
> >
> >
> >
> >
Previous Topic:How to tell Eclipse to not use the default java to start itself?
Next Topic:Question on Mono plugin
Goto Forum:
  


Current Time: Sun May 11 14:28:12 EDT 2025

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

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

Back to the top