Geertjan's Blog

  • December 25, 2007

More Power to Code Completion

Geertjan Wielenga
Product Manager
I put a new plugin in the Plugin Portal, under the name Spiced Up Code Completion. It lets you supplement the code completion box (for all file types) with a list of new words. You can decide what the new words are, which could be code or could be actual words, in whatever language you like. The list of supplemental code completion items is set in the Options window. And then the words end up in the code completion box, as shown below for three different file types (in this case the words come from an English dictionary text file):


The third screenshot above shows that the new words end up below all the existing ones (so that they don't get in the way, especially since they're unlikely to be applicable to all file types at the same time). The above is the result of a tutorial I wrote sometime ago, but that hasn't been updated to 6.0 yet. However, aside from its value as a tutorial sample, I think it could also be useful to users in general, i.e., those who don't want to build the whole plugin from scratch via a tutorial. Hope it proves useful. It could be expanded in various ways.

Happy Christmas.

Join the discussion

Comments ( 9 )
  • Tor Norbye Tuesday, December 25, 2007

    Hi Geertjan,

    note also that if you add the words as Code Templates (via the Options) then these are also automatically included in code completion.

  • Geertjan Tuesday, December 25, 2007

    Right, good point. That pretty much makes this plugin superfluous. I've used your approach before as a hack in the Groovy plugin I was working on. I simply copied the Java code templates into the Groovy folders in the XML layer. That way, they were all automatically inherited. The end user could do the same thing, as you describe, via the Options window.

  • Dyego Souza do Carmo Thursday, December 27, 2007

    Where is the Source code ?

    The plugin portal is deficient in this question... there's no button to download the Source Code of plugin... this is very bad :(

  • Geertjan Thursday, December 27, 2007

    Nope. Not a deficiency of the Plugin Portal at all. It would be very easy for all providers of plugins to include the source code of their plugin, if they wanted to. Everyone could create a project template based on the source code of their plugin. The fact that they don't is their own choice, not related to the Plugin Portal at all. Once I have sorted out a few problems with the code of this plugin, I will make the sources available in this way. I will post a message about that in this blog when I have done so.

  • Cleveland Software Developer Saturday, December 29, 2007

    I am new to NetBeans, and I am really interested in it's extensibility. As such, I will be anxiously awaiting the source-code for this plugin so I can learn how to do such things. Thanks for posting it when you do.

  • Geertjan Saturday, December 29, 2007
  • Geertjan Saturday, December 29, 2007

    Install that and then go to the Samples | NetBeans Modules section in the New Project wizard. You'll find the sample there. Also note that code completion is described in the book "Rich Client Programming: Plugging into the NetBeans Platform". All the samples for that book are freely available in the Plugin Manager (search for 'RCP Book Samples').

  • guest Friday, November 14, 2014

    Hi Geertjan,

    I tried to access the sample code of this book via netbeans 6. But unfortunately nb6 won't start on my machine (ubuntu x64 / jdk 8 x64)

    In particular i'm interested in extending the code completion of all text editors as the Spiced Up Code Completion plugin does. Can i access the samples in a different way or do i have to set up a vm or additionally install jdk6/7 to run nb6?

  • guest Friday, November 14, 2014

    addendum: after installing the plugin in NetBeans 8 I did neither get new sample projects nor could i find plugins in the plugin manager after searching for "RCP". but the plugin itself works great.

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