Search in sources :

Example 11 with DiscardDataChangesCommand

use of org.eclipse.nebula.widgets.nattable.datachange.command.DiscardDataChangesCommand in project nebula.widgets.nattable by eclipse.

the class DefaultDataChangeConfiguration method configureUiBindings.

@Override
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1, 's'), new IKeyAction() {

        @Override
        public void run(NatTable natTable, KeyEvent event) {
            natTable.doCommand(new SaveDataChangesCommand());
        }
    });
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1, 'd'), new IKeyAction() {

        @Override
        public void run(NatTable natTable, KeyEvent event) {
            natTable.doCommand(new DiscardDataChangesCommand());
        }
    });
}
Also used : KeyEvent(org.eclipse.swt.events.KeyEvent) DiscardDataChangesCommand(org.eclipse.nebula.widgets.nattable.datachange.command.DiscardDataChangesCommand) KeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher) IKeyAction(org.eclipse.nebula.widgets.nattable.ui.action.IKeyAction) SaveDataChangesCommand(org.eclipse.nebula.widgets.nattable.datachange.command.SaveDataChangesCommand) NatTable(org.eclipse.nebula.widgets.nattable.NatTable)

Aggregations

DiscardDataChangesCommand (org.eclipse.nebula.widgets.nattable.datachange.command.DiscardDataChangesCommand)11 UpdateDataCommand (org.eclipse.nebula.widgets.nattable.edit.command.UpdateDataCommand)7 Test (org.junit.Test)7 NatTable (org.eclipse.nebula.widgets.nattable.NatTable)4 SaveDataChangesCommand (org.eclipse.nebula.widgets.nattable.datachange.command.SaveDataChangesCommand)4 Person (org.eclipse.nebula.widgets.nattable.dataset.person.Person)4 HashMap (java.util.HashMap)3 DefaultNatTableStyleConfiguration (org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration)3 IDataProvider (org.eclipse.nebula.widgets.nattable.data.IDataProvider)3 DefaultColumnHeaderDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultColumnHeaderDataProvider)3 DefaultCornerDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultCornerDataProvider)3 DefaultRowHeaderDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultRowHeaderDataProvider)3 ColumnHeaderLayer (org.eclipse.nebula.widgets.nattable.grid.layer.ColumnHeaderLayer)3 CornerLayer (org.eclipse.nebula.widgets.nattable.grid.layer.CornerLayer)3 GridLayer (org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer)3 RowHeaderLayer (org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer)3 DataLayer (org.eclipse.nebula.widgets.nattable.layer.DataLayer)3 ILayer (org.eclipse.nebula.widgets.nattable.layer.ILayer)3 IMenuItemProvider (org.eclipse.nebula.widgets.nattable.ui.menu.IMenuItemProvider)3 PopupMenuBuilder (org.eclipse.nebula.widgets.nattable.ui.menu.PopupMenuBuilder)3