Search in sources :

Example 11 with SelectionLayer

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();
    }
}
Also used : SelectionLayer(net.sourceforge.nattable.selection.SelectionLayer) PositionCoordinate(net.sourceforge.nattable.coordinate.PositionCoordinate)

Aggregations

SelectionLayer (net.sourceforge.nattable.selection.SelectionLayer)11 PositionCoordinate (net.sourceforge.nattable.coordinate.PositionCoordinate)5 XLIFFEditorImplWithNatTable (net.heartsome.cat.ts.ui.xliffeditor.nattable.editor.XLIFFEditorImplWithNatTable)3 ILayer (net.sourceforge.nattable.layer.ILayer)3 SelectCellCommand (net.sourceforge.nattable.selection.command.SelectCellCommand)2 ViewportLayer (net.sourceforge.nattable.viewport.ViewportLayer)2 MessageFormat (java.text.MessageFormat)1 ArrayList (java.util.ArrayList)1 XLFHandler (net.heartsome.cat.ts.core.file.XLFHandler)1 StyledTextCellEditor (net.heartsome.cat.ts.ui.xliffeditor.nattable.editor.StyledTextCellEditor)1 HorizontalViewportLayer (net.heartsome.cat.ts.ui.xliffeditor.nattable.layer.HorizontalViewportLayer)1 VerticalViewportLayer (net.heartsome.cat.ts.ui.xliffeditor.nattable.layer.VerticalViewportLayer)1 LayerCell (net.sourceforge.nattable.layer.cell.LayerCell)1 DefaultBodyLayerStack (net.sourceforge.nattable.layer.stack.DefaultBodyLayerStack)1 ICellPainter (net.sourceforge.nattable.painter.cell.ICellPainter)1 RowSelectionEvent (net.sourceforge.nattable.selection.event.RowSelectionEvent)1 Point (org.eclipse.swt.graphics.Point)1 IEditorInput (org.eclipse.ui.IEditorInput)1 IEditorPart (org.eclipse.ui.IEditorPart)1 IURIEditorInput (org.eclipse.ui.IURIEditorInput)1