use of net.sourceforge.nattable.selection.SelectionLayer in project translationstudio8 by heartsome.
the class HsMultiActiveCellEditor method activateCellEditors.
/**
* @param cellEditors
*/
public static void activateCellEditors(HsMultiCellEditor srcCellEditor, HsMultiCellEditor tgtCellEditor, NatTable natTable) {
parent = natTable;
sourceEditor = srcCellEditor;
sourceRowIndex = srcCellEditor.getRowIndex();
sourceRowPosition = srcCellEditor.getRowPosition();
targetEditor = tgtCellEditor;
targetRowIndex = tgtCellEditor.getRowIndex();
targetRowPosition = tgtCellEditor.getRowPosition();
sourceEditor.activeCurrentEditor(natTable);
targetEditor.activeCurrentEditor(natTable);
SelectionLayer sLayer = LayerUtil.getLayer(natTable, SelectionLayer.class);
PositionCoordinate p = sLayer.getLastSelectedCellPosition();
int colPosition = p.columnPosition;
if (colPosition == targetEditor.getColumnIndex()) {
targetEditor.forceFocus();
} else if (colPosition == sourceEditor.getColumnIndex()) {
sourceEditor.forceFocus();
}
}
Aggregations