}
}
} );
// Search Toolbar
final ToolBar searchToolBar = new ToolBar( searchFieldInnerComposite, SWT.HORIZONTAL | SWT.FLAT );
// Creating the Search In ToolItem
final ToolItem searchInToolItem = new ToolItem( searchToolBar, SWT.DROP_DOWN );
searchInToolItem.setText( Messages.getString( "SearchView.SearchIn" ) ); //$NON-NLS-1$
// Adding the action to display the Menu when the item is clicked
searchInToolItem.addSelectionListener( new SelectionAdapter()
{
public void widgetSelected( SelectionEvent event )
{
Rectangle rect = searchInToolItem.getBounds();
Point pt = new Point( rect.x, rect.y + rect.height );
pt = searchToolBar.toDisplay( pt );
Menu menu = createSearchInMenu();
menu.setLocation( pt.x, pt.y );
menu.setVisible( true );
}
} );
new ToolItem( searchToolBar, SWT.SEPARATOR );
final ToolItem scopeToolItem = new ToolItem( searchToolBar, SWT.DROP_DOWN );
scopeToolItem.setText( Messages.getString( "SearchView.Scope" ) ); //$NON-NLS-1$
// Adding the action to display the Menu when the item is clicked
scopeToolItem.addSelectionListener( new SelectionAdapter()
{
public void widgetSelected( SelectionEvent event )
{
Rectangle rect = scopeToolItem.getBounds();
Point pt = new Point( rect.x, rect.y + rect.height );
pt = searchToolBar.toDisplay( pt );
Menu menu = createScopeMenu();
menu.setLocation( pt.x, pt.y );
menu.setVisible( true );
}
} );
searchToolBar.setLayoutData( new GridData( SWT.NONE, SWT.CENTER, false, false ) );
// Search Button
searchButton = new Button( searchFieldInnerComposite, SWT.PUSH | SWT.DOWN );
searchButton.setEnabled( false );
searchButton.setImage( Activator.getDefault().getImage( PluginConstants.IMG_SEARCH ) );