X

Geertjan's Blog

  • January 22, 2006

Send Text from the Editor to Google

Geertjan Wielenga
Product Manager
One reason why I've been eagerly awaiting Sandip's plug-in module for line tools is that I wanted to explore the sources. When Ludo first blogged about his Google toolbar for NetBeans IDE, I thought: "Hmmm. I wonder if it would be possible to do the search straight from the editor, rather than from a textfield in the toolbar." But, unfortunately, I didn't know enough about the editor to work out how to do it. Then, recently, Sandip made the sources of his line tools available in Contrib (they're also downloadable from his blog, by the way). And so now I've been able to marry Ludo's work with Sandip's. Check out the new "Send Line to Google" toolbar button below:

When you click the toolbar button, the current line (or, if multiple lines are selected, the last line of the current selection) is sent to Google—if the default browser isn't open, it is opened, then the selection is sent to it, and Google returns the search results.

You too can play with this module (if you're using a post-5.0 development build, available from the download page on www.netbeans.org). Go to my Update Center, which is at the location below (see previous blog entries if you don't know how to register my Update Center):

http://blogs.sun.com/roller/resources/geertjan/updates_geertjan.xml

There, in my Update Center, select the brand new Text API Sample:

After installation, you will have a new sample, in the usual place:

After doing the above you will, in addition to installing the Google search extension, be able look at the sources and extend my plug-in module with additional line-manipulation functionality. (You'll notice I've reproduced Sandip's framework in this module, so that extending it is very easy—extend AbstractLineAction and then add your new line operation to the LineOperations class.)

Join the discussion

Comments ( 2 )
  • Deepak Sunday, January 22, 2006
    Hi Geertjan,
    Is there any support for AspectJ compiler or any other compilers supporting Aspect Oriented Programming in NetBeans? If no, Are u planning to support any in the near future ?
    BTW : AspectJ is a part of eclipse project and AOP is gaining momentum as it increases modularity and reusability
    Regards,
    Deepak
  • Geertjan Monday, January 23, 2006
    Sorry, Deepak. I don't know the answer to this question. I suggest that you write to nbusers@netbeans.org... a lot more people read that mailing list than this blog!
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.