this.searchItem = new TextItem();
this.searchItem.setTitle( TextProvider.get().grid_messages_search() );
this.searchItem.setTooltip( TextProvider.get().grid_messages_search_tooltip() );
this.searchItem.setWidth( 250 );
final PickerIcon searchIcon = new PickerIcon( PickerIcon.SEARCH );
final PickerIcon clearIcon = new PickerIcon( PickerIcon.CLEAR );
final PickerIcon filedsIcon = new PickerIcon( PickerIcon.COMBO_BOX );
this.searchItem.setIcons( searchIcon, clearIcon, filedsIcon );
this.searchItem.addIconClickHandler( new IconClickHandler() {
public void onIconClick( IconClickEvent event ) {
FormItemIcon icon = event.getIcon();
if ( icon.getSrc().equals( clearIcon.getSrc() ) ) {
resetFilter();
fireSearchEvent();
}
else if ( icon.getSrc().equals( filedsIcon.getSrc() ) ) {
if ( fieldsDialog == null ) {
fieldsDialog = new FieldsDialog();
}
Rectangle iconRect = searchItem.getIconPageRect( event.getIcon() );
fieldsDialog.setFields( searchFields );