Uses Generation at Netbeans

I wonder if there is a way to get Netbeans to work like Eclipse the way you select a class name from the autocomplete list, and if the use statement for that class does not exist, then Netbeans will generate use and use the class name without the full namespace?

Let me show you what I mean. We have a basic image with autocomplete.

Base image

Netbeans current behavior when pressing Enter

Current behavior

Netbeans Desired Behavior

Desired behavior

+7
source share
1 answer

While doing a short research using Google, I found that it could be CTRL + SHIFT + I to invoke an operation similar to Eclipse SHIFT + O in Java (to restore import if I remember it correctly).

Check the link for the operation.

In your example, it should be nice to write:

 $object = new ClassLoader; 

And then press CTRL + SHIFT + I to import the ClassLoader namespace as a use statement ...

+7
source

All Articles