Search in sources :

Example 1 with DisplayColumnRenameDialogCommand

use of net.sourceforge.nattable.columnRename.DisplayColumnRenameDialogCommand in project translationstudio8 by heartsome.

the class MenuItemProviders method renameColumnMenuItemProvider.

public static IMenuItemProvider renameColumnMenuItemProvider(final String label) {
    return new IMenuItemProvider() {

        public void addMenuItem(final NatTable natTable, final Menu popupMenu) {
            MenuItem menuItem = new MenuItem(popupMenu, SWT.PUSH);
            menuItem.setText(label);
            menuItem.setEnabled(true);
            menuItem.addSelectionListener(new SelectionAdapter() {

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