tags:

views:

51

answers:

2

In a Eclipse RCP application, is there any way I can have text field (for search) on menu bar? For example I have menu:

File Edit ...                                          Search: |___text field___|

The text field is located at the right end of the menu bar.

A: 

I don't think that is easily possible. But you could use the CoolBar to create this functionality.

drstupid
A: 

You can place an SWT control on the toolbar, but it doesn't work for menus. Here is the toolbar way:

  1. Open the extensions tab in plugin.xml file

  2. Add a menuContribution extension to org.eclipse.ui.menus and set it as a toolbar (toolbar:ID)

  3. Add a toolbar to this menuContribution

  4. Add a control to this toolbar

  5. Double click and create the class which extends WorkbenchWindowControlContribution and fill the createControl(...) function using the desired SWT controls.

After setting the menuContribution as a menu, it is still possible to add a control, but unfortunately, it does not show any controls.

nerduban

related questions