Search the Guardian from a NetBeans Platform Application without Coding At All

By default, the Quick Search feature is hidden in NetBeans Platform applications. Below, I show how to enable it in the layer.xml file and also how to enable the web search provider (this provider searches Google and returns pages that match your search string), which is defined in the NetBeans sources but not declared by default in the NetBeans Platform:
<folder name="QuickSearch">

    <!-- Optionally, we've hidden the existing quick search providers: -->
    <file name="Actions_hidden"/>
    <file name="GoToOption_hidden"/>
    <file name="Help_hidden"/>

    <!-- Enabling the WebQuickSearchProviderImpl: -->
    <folder name="Guardian">
        <file name="org-netbeans-modules-quicksearch-web-WebQuickSearchProviderImpl.instance"/>


<!-- Showing the Quick Search feature: -->
<folder name="Toolbars">
    <folder name="QuickSearch">
        <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.guardiansearch.Bundle"/>
        <file name="org-netbeans-modules-quicksearch-QuickSearchAction.shadow">
            <attr name="originalFile" stringvalue="Actions/Edit/org-netbeans-modules-quicksearch-QuickSearchAction.instance"/>

Finally, in our branding folder, we create the folder hierarchy below and set the two properties that you see there (read about these properties at the bottom of this page):

In the IDE, the above properties are hardcoded to the following, but for the NetBeans Platform they are undefined and hence need to be branded as the above:

You've done no coding at all, right? So now run the application and you'll be able to search the Guardian (or whatever you set in the branded Bundle file that you see above):

When you click an item above, the related article opens in your browser.

So here's all I did to be able to search Jon Stewart's show:

And here's the result:

All of the above is possible from 6.5 Milestone 1 onwards.


thank you for imformation !!!

good luck

Posted by tattoo on July 19, 2008 at 10:46 PM PDT #

What about searching wikis? Or sites where there is no extension to the page? It does seem to work....

Posted by Bill Snyder on July 31, 2008 at 12:04 PM PDT #

Uh, meant to say it DOESNT seem to work

Posted by Bill Snyder on July 31, 2008 at 12:04 PM PDT #

What do you mean?

Posted by Geertjan on July 31, 2008 at 04:10 PM PDT #

doesn't seem to work. Though if you google this :

site: icon

it brings up a result.

Am I missing something?

Posted by Bill Snyder on August 02, 2008 at 12:51 AM PDT #

Is it possible to use the Websearch provider in a IDE module? I haven't figured out how to set the quicksearch.web.\* properties (IDE plugins have no branding folder...). (Custom search providers work perfectly of course)

Thank you for the great blog entries.

Posted by mbien on August 11, 2008 at 03:07 AM PDT #


I'm quite a fan of your work. But there is something that's making me loose a lot of time: How do I use netbeans API to search for java files inside the project and get information about these files? I mean, when the user presses some action (code completer, code generator, etc) I need to look inside his project's java files and inform him about this class' methods, annotaions, etc. I can't figure the right API and its usage!!!

Posted by Alejo Ceballos on November 01, 2008 at 08:06 AM PDT #


We are migrating from NetBeans6M10 to NetBeans6.5.
The problem I an facing is that, our application shows QuickSearch on the corner. It is not enable from our layer.xml. WSe want to hide the QuickSearch. any help.


Posted by Bhavik Patel on November 10, 2008 at 05:50 PM PST #

Hello Bhavik Patel!

The Quick Search is a simple toolbar. You can disable the quick search toolbar with this few lines in your layer.xml:

<folder name="Toolbars">
<folder name="QuickSearch_hidden"/>

best regards,

Posted by Aljoscha Rittner on November 24, 2008 at 06:06 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed

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.


« June 2016