Geertjan's Blog

  • January 22, 2014

Excluding Proposals from Code Completion in NetBeans 8

Geertjan Wielenga
Product Manager
Finding the place in the Options window where you can list the classes you'd like to exclude from the Code Completion box is not easy.

Therefore, in NetBeans 8, you can exclude the classes you don't need right from within the Code Completion box. Below, notice the lightbulb at the far right in the currently selected item in the Code Completion box, which appears the second time you call up code completion:

Press Alt-Enter or click the lightbulb and now you see this:

Press Enter and the item is excluded from the Code Completion box because it has now been added here for you, i.e., instead of going all the way here, the class was registered here for you when you pressed Enter above:

NetBeans 8. Making your coding life simpler all the time.

Join the discussion

Comments ( 2 )
  • Shai Almog Thursday, January 23, 2014

    That's cool!

    Can I do this in the project settings?

    The reason I'm asking is that in the Codename One plugin we have our own bootclasspath but the completion offers up all the J2SE files. I'd love to be able to narrow down code completion while still being compatible to NetBeans 7.x.

  • Geertjan Thursday, January 23, 2014

    No, this is not per-project, but IDE-wide. I can see how useful per-project would be for you, though. On the other hands, you could take the steps described in this blog entry above, then take a look at where that information is saved in the user directory. Then, in your Codename One plugin, detect when the user is working on a Codename One project, at which point that information would be written into the user directory, and removed when the user is working on a different project, i.e., a non-Codename One project. (You can listen to the Lookup for a change in Project and then check if it is your project or not.) Hope that gets you started.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.