More Power to Code Completion

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):

es

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.

Comments:

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.

Posted by Tor Norbye on December 25, 2007 at 01:21 AM PST #

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.

Posted by Geertjan on December 25, 2007 at 01:41 AM PST #

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 :(

Posted by Dyego Souza do Carmo on December 26, 2007 at 06:47 PM PST #

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.

Posted by Geertjan on December 26, 2007 at 08:06 PM PST #

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.

Posted by Cleveland Software Developer on December 29, 2007 at 09:57 AM PST #

http://blogs.sun.com/geertjan/resource/org-netbeans-modules-textfileccexample.nbm

Posted by Geertjan on December 29, 2007 at 11:50 AM PST #

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

Posted by Geertjan on December 29, 2007 at 11:53 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today