Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uses generation in Netbeans [duplicate]

I wonder is there any way to make Netbeans work like an Eclipse the way you choose class name from autocompletion list and if use statement for that class does not exist then Netbeans will generate use and will use class name without full namespace?

Let me demonstrate what i mean. We have base image with autocomplete.

Base image

Current behaviour of Netbeans on when we hit Enter

Current behaviour

Desired behaviour of Netbeans

Desired behaviour

like image 291
message Avatar asked May 20 '13 08:05

message


1 Answers

Doing a short research using Google I have found out, that it could be the CTRL + SHIFT + I key combination to invoke operation similar to Eclipse's SHIFT + O within Java (to repair imports, if I remember it right).

Check the link where the operation is described.

It should be fine to write down in Your example:

$object = new ClassLoader;

And then hit CTRL + SHIFT + I to import the ClassLoader's namespace as an use statement...

like image 107
shadyyx Avatar answered Nov 07 '22 04:11

shadyyx