Search in sources :

Example 1 with ClearAllFiltersCommand

use of net.sourceforge.nattable.filterrow.command.ClearAllFiltersCommand in project translationstudio8 by heartsome.

the class MenuItemProviders method clearAllFiltersMenuItemProvider.

public static IMenuItemProvider clearAllFiltersMenuItemProvider(final String menuLabel) {
    return new IMenuItemProvider() {

        public void addMenuItem(final NatTable natTable, final Menu popupMenu) {
            MenuItem menuItem = new MenuItem(popupMenu, SWT.PUSH);
            menuItem.setText(menuLabel);
            menuItem.setImage(GUIHelper.getImage("remove_filter"));
            menuItem.setEnabled(true);
            menuItem.addSelectionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                    natTable.doCommand(new ClearAllFiltersCommand());
                }
            });
        }
    };
}
Also used : ClearAllFiltersCommand(net.sourceforge.nattable.filterrow.command.ClearAllFiltersCommand) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) NatTable(net.sourceforge.nattable.NatTable) MenuItem(org.eclipse.swt.widgets.MenuItem) Menu(org.eclipse.swt.widgets.Menu)

Aggregations

NatTable (net.sourceforge.nattable.NatTable)1 ClearAllFiltersCommand (net.sourceforge.nattable.filterrow.command.ClearAllFiltersCommand)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 Menu (org.eclipse.swt.widgets.Menu)1 MenuItem (org.eclipse.swt.widgets.MenuItem)1