Search in sources :

Example 1 with ShowAllColumnsCommand

use of net.sourceforge.nattable.hideshow.command.ShowAllColumnsCommand in project translationstudio8 by heartsome.

the class MenuItemProviders method showAllColumnMenuItemProvider.

public static IMenuItemProvider showAllColumnMenuItemProvider() {
    return new IMenuItemProvider() {

        public void addMenuItem(final NatTable natTable, Menu popupMenu) {
            MenuItem showAllColumns = new MenuItem(popupMenu, SWT.PUSH);
            showAllColumns.setText("Show all columns");
            showAllColumns.setImage(GUIHelper.getImage("show_column"));
            showAllColumns.setEnabled(true);
            showAllColumns.addSelectionListener(new SelectionAdapter() {

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

Aggregations

NatTable (net.sourceforge.nattable.NatTable)1 ShowAllColumnsCommand (net.sourceforge.nattable.hideshow.command.ShowAllColumnsCommand)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