Search in sources :

Example 1 with DisplayColumnChooserCommand

use of net.sourceforge.nattable.columnChooser.command.DisplayColumnChooserCommand in project translationstudio8 by heartsome.

the class MenuItemProviders method columnChooserMenuItemProvider.

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

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

                @Override
                public void widgetSelected(SelectionEvent e) {
                    natTable.doCommand(new DisplayColumnChooserCommand(natTable));
                }
            });
        }
    };
}
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) Menu(org.eclipse.swt.widgets.Menu) DisplayColumnChooserCommand(net.sourceforge.nattable.columnChooser.command.DisplayColumnChooserCommand)

Aggregations

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