use of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate in project nebula.widgets.nattable by eclipse.
the class TickUpdateCommandHandler method doCommand.
@Override
public boolean doCommand(TickUpdateCommand command) {
PositionCoordinate[] selectedPositions = this.selectionLayer.getSelectedCellPositions();
IConfigRegistry configRegistry = command.getConfigRegistry();
// Tick update for multiple cells in selection
if (selectedPositions.length > 1) {
// Can all cells be updated ?
if (EditUtils.allCellsEditable(this.selectionLayer, configRegistry) && EditUtils.isEditorSame(this.selectionLayer, configRegistry) && EditUtils.isConverterSame(this.selectionLayer, configRegistry)) {
for (PositionCoordinate position : selectedPositions) {
updateSingleCell(command, position);
}
}
} else {
// Tick update for single selected cell
updateSingleCell(command, this.selectionLayer.getLastSelectedCellPosition());
}
return true;
}
use of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate in project nebula.widgets.nattable by eclipse.
the class TreeExpandCollapseKeyAction method run.
@Override
public void run(NatTable natTable, KeyEvent event) {
PositionCoordinate anchorPosition = this.selectionLayer.getSelectionAnchor();
if (anchorPosition.rowPosition != SelectionLayer.NO_SELECTION && anchorPosition.columnPosition != SelectionLayer.NO_SELECTION) {
int rowIndex = this.selectionLayer.getRowIndexByPosition(anchorPosition.rowPosition);
int columnIndex = this.selectionLayer.getColumnIndexByPosition(anchorPosition.columnPosition);
TreeExpandCollapseCommand command = new TreeExpandCollapseCommand(rowIndex, columnIndex);
natTable.doCommand(command);
}
}
Aggregations