Search in sources :

Example 1 with ColumnHideCommand

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

the class MenuItemProviders method hideColumnMenuItemProvider.

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

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

                @Override
                public void widgetSelected(SelectionEvent event) {
                    int columnPosition = getNatEventData(event).getColumnPosition();
                    natTable.doCommand(new ColumnHideCommand(natTable, columnPosition));
                }
            });
        }
    };
}
Also used : ColumnHideCommand(net.sourceforge.nattable.hideshow.command.ColumnHideCommand) 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 ColumnHideCommand (net.sourceforge.nattable.hideshow.command.ColumnHideCommand)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