Search in sources :

Example 1 with HierarchicalTreeExpandCollapseCommand

use of org.eclipse.nebula.widgets.nattable.hierarchical.command.HierarchicalTreeExpandCollapseCommand in project nebula.widgets.nattable by eclipse.

the class HierarchicalTreeExpandCollapseAction method run.

@Override
public void run(NatTable natTable, MouseEvent event) {
    int c = natTable.getColumnPositionByX(event.x);
    int r = natTable.getRowPositionByY(event.y);
    ILayerCell cell = natTable.getCellByPosition(c, r);
    int rowIndex = cell.getLayer().getRowIndexByPosition(cell.getOriginRowPosition());
    int columnIndex = cell.getLayer().getColumnIndexByPosition(cell.getOriginColumnPosition());
    HierarchicalTreeExpandCollapseCommand command = new HierarchicalTreeExpandCollapseCommand(rowIndex, columnIndex, this.toLevel);
    natTable.doCommand(command);
}
Also used : HierarchicalTreeExpandCollapseCommand(org.eclipse.nebula.widgets.nattable.hierarchical.command.HierarchicalTreeExpandCollapseCommand) ILayerCell(org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell)

Aggregations

HierarchicalTreeExpandCollapseCommand (org.eclipse.nebula.widgets.nattable.hierarchical.command.HierarchicalTreeExpandCollapseCommand)1 ILayerCell (org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell)1