Eclipse question re auto insert of import statement [message #259418] |
Fri, 27 June 2008 11:57  |
Eclipse User |
|
|
|
I recall reading somewhere that Eclipse has a feature where you can use
a class in your code and if it is not defined yet, you can hit something
(ctrl-1 ?) and have it automatically know what package to import.
This feature is not working for my packages nor the BlackBerry
packages. Any ideas how to make this work?
Thanks,
Paul
|
|
|
|
|
|
Re: Eclipse question re auto insert of import statement [message #259723 is a reply to message #259435] |
Tue, 01 July 2008 07:04  |
Eclipse User |
|
|
|
Paul Levin wrote:
> Thanks Eric. I had tried Ctrl+Space and it was not offering any
> suggestions for imports.
Right. It should only suggest the types. If you then select the type it
will add the import automatically.
Dani
> But Ctrl+shift+m worked perfectly.
>
> I'll certainly play with the other suggestions you gave.
>
> Thanks,
> Paul
>
>
> Eric Rizzo wrote:
>> Paul Levin wrote:
>>> I got this one solved -
>>>
>>> If you put the cursor on an undefined class and hit ctrl-shift-m
>>> (Windows) then Eclipse should pull in the required import, as long
>>> as it can find it.
>>
>> Note that Ctrl+Shift+o (Organize Imports) will also insert missing
>> import statements (it will prompt you if there is ambiguity about
>> which class to import based on the project's build path).
>> Also, Ctrl+Space will offer suggestions for fully-qualified class
>> names and automatically add import statements when you select the
>> exact one you want. Ctrl+Space is a very powerful tool in general -
>> it does a lot more than that.
>>
>> Hope this helps,
>> Eric
>>
>>
>>> Paul Levin wrote:
>>>> I recall reading somewhere that Eclipse has a feature where you can
>>>> use a class in your code and if it is not defined yet, you can hit
>>>> something (ctrl-1 ?) and have it automatically know what package to
>>>> import.
>>>>
>>>> This feature is not working for my packages nor the BlackBerry
>>>> packages. Any ideas how to make this work?
>>>>
>>>> Thanks,
>>>> Paul
|
|
|
Powered by
FUDForum. Page generated in 0.10306 seconds