8

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

message
  • 4,513
  • 2
  • 28
  • 39
  • Anyway, the same was already asked [here](http://stackoverflow.com/questions/6016979/how-can-i-get-netbeans-to-use-import-statements-instead-of-fully-qualified-class)... – shadyyx May 20 '13 at 08:50

1 Answers1

7

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...

shadyyx
  • 15,825
  • 6
  • 60
  • 95