Search in sources :

Example 11 with ILayer

use of net.sourceforge.nattable.layer.ILayer in project translationstudio8 by heartsome.

the class GridSearchStrategy method executeSearch.

public PositionCoordinate executeSearch(Object valueToMatch) {
    ILayer contextLayer = getContextLayer();
    if (!(contextLayer instanceof SelectionLayer)) {
        throw new RuntimeException("For the GridSearchStrategy to work it needs the selectionLayer to be passed as the contextLayer.");
    }
    SelectionLayer selectionLayer = (SelectionLayer) contextLayer;
    PositionCoordinate selectionAnchor = selectionLayer.getSelectionAnchor();
    boolean hadSelectionAnchor = true;
    if (selectionAnchor.columnPosition < 0 || selectionAnchor.rowPosition < 0) {
        selectionAnchor.columnPosition = 0;
        selectionAnchor.rowPosition = 0;
        hadSelectionAnchor = false;
    }
    int anchorColumnPosition = selectionAnchor.columnPosition;
    int startingRowPosition;
    int[] columnsToSearch = null;
    final int columnCount = selectionLayer.getColumnCount();
    if (searchDirection.equals(ISearchDirection.SEARCH_FORWARD)) {
        int rowPosition = hadSelectionAnchor ? selectionAnchor.rowPosition + 1 : selectionAnchor.rowPosition;
        if (rowPosition > (contextLayer.getRowCount() - 1)) {
            rowPosition = wrapSearch ? 0 : contextLayer.getRowCount() - 1;
        }
        int rowCount = selectionLayer.getRowCount();
        startingRowPosition = rowPosition < rowCount ? rowPosition : 0;
        if (selectionAnchor.rowPosition + 1 >= rowCount && anchorColumnPosition + 1 >= columnCount && hadSelectionAnchor) {
            if (wrapSearch) {
                anchorColumnPosition = 0;
            } else {
                return null;
            }
        } else if (selectionAnchor.rowPosition == rowCount - 1 && anchorColumnPosition < columnCount - 1) {
            anchorColumnPosition++;
        }
        columnsToSearch = getColumnsToSearchArray(columnCount, anchorColumnPosition);
    } else {
        int rowPosition = selectionAnchor.rowPosition - 1;
        if (rowPosition < 0) {
            rowPosition = wrapSearch ? contextLayer.getRowCount() - 1 : 0;
        }
        startingRowPosition = rowPosition > 0 ? rowPosition : 0;
        if (selectionAnchor.rowPosition - 1 < 0 && anchorColumnPosition - 1 < 0 && hadSelectionAnchor) {
            if (wrapSearch) {
                anchorColumnPosition = columnCount - 1;
            } else {
                return null;
            }
        } else if (selectionAnchor.rowPosition == 0 && anchorColumnPosition > 0) {
            anchorColumnPosition--;
        }
        columnsToSearch = getDescendingColumnsToSearchArray(anchorColumnPosition);
    }
    PositionCoordinate executeSearch = searchGrid(valueToMatch, contextLayer, selectionLayer, anchorColumnPosition, startingRowPosition, columnsToSearch);
    return executeSearch;
}
Also used : SelectionLayer(net.sourceforge.nattable.selection.SelectionLayer) ILayer(net.sourceforge.nattable.layer.ILayer) PositionCoordinate(net.sourceforge.nattable.coordinate.PositionCoordinate)

Example 12 with ILayer

use of net.sourceforge.nattable.layer.ILayer in project translationstudio8 by heartsome.

the class XLIFFEditorImplWithNatTable method changeLayout.

public void changeLayout(boolean isHorizontalLayout) {
    // 同步布局状态
    this.isHorizontalLayout = isHorizontalLayout;
    // 如果当前的 table 已经存在,销毁后再重新创建。
    if (table != null && !table.isDisposed()) {
        table.dispose();
        for (Control control : parent.getChildren()) {
            control.dispose();
        }
    }
    // 构建 NatTable 的数据提供者
    bodyDataProvider = setupBodyDataProvider(isHorizontalLayout);
    // 构建 NatTable 列头的数据提供者
    DefaultColumnHeaderDataProvider colHeaderDataProvider = new DefaultColumnHeaderDataProvider(propertyNames, propertyToLabels);
    // 构建 NatTable 的 body layer stack
    bodyLayer = new BodyLayerStack(bodyDataProvider, isHorizontalLayout);
    // 构建 NatTable 的 column header layout stack
    ColumnHeaderLayerStack columnHeaderLayer = new ColumnHeaderLayerStack(colHeaderDataProvider);
    // 构建 NatTable 之下的 composite layer,不使用默认的 configuration(默认的 configuration 是在点击可编辑单元格时,直接进入编辑状态)。
    CompositeLayer compositeLayer = new CompositeLayer(1, 2);
    compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER, columnHeaderLayer, 0, 0);
    compositeLayer.setChildLayer(GridRegion.BODY, bodyLayer, 0, 1);
    // 标识 BodyLayer 在 CompositeLayer 上的位置
    LayerUtil.setBodyLayerPosition(0, 1);
    /* 给 composite layer 添加编辑相关的命令和 handler */
    // 添加行背景色(奇数行和偶数行不同)
    addRowBackgroundColor(compositeLayer);
    // 构建 NatTable
    table = new NatTable(parent, compositeLayer, false);
    Language srcLang = LocaleService.getLanguageConfiger().getLanguageByCode(srcColumnName);
    Language tgtLang = LocaleService.getLanguageConfiger().getLanguageByCode(tgtColumnName);
    if (srcLang.isBidi() || tgtLang.isBidi()) {
        table.setOrientation(SWT.RIGHT_TO_LEFT);
    }
    // 去除默认绘画器
    table.removePaintListener(table);
    // 使用自定义绘画器,此绘画器,具有自动计算行高功能。
    table.addPaintListener(paintListenerWithAutoRowSize);
    Listener[] ls = table.getListeners(SWT.Resize);
    for (Listener l : ls) {
        table.removeListener(SWT.Resize, l);
    }
    table.addListener(SWT.Resize, resizeListenerWithColumnResize);
    table.addDisposeListener(new DisposeListener() {

        public void widgetDisposed(DisposeEvent e) {
            // ActiveCellEditor.commit(); // 关闭编辑时,先提交未提交的单元格,避免造成内容丢失。Bug #2685
            HsMultiActiveCellEditor.commit(true);
            table.removeListener(SWT.Resize, resizeListenerWithColumnResize);
            table.removePaintListener(paintListenerWithAutoRowSize);
        }
    });
    table.setLayoutData(new GridData(GridData.FILL_BOTH));
    // 给 NatTable 添加相应的配置
    DefaultNatTableStyleConfiguration configuration = new DefaultNatTableStyleConfiguration();
    configuration.hAlign = HorizontalAlignmentEnum.LEFT;
    table.addConfiguration(configuration);
    // To be changed 给NatTable添加选择列的功能 Add By Leakey
    /*
		 * ColumnGroupModel columnGroupModel = new ColumnGroupModel(); DisplayColumnChooserCommandHandler
		 * columnChooserCommandHandler = new DisplayColumnChooserCommandHandler( bodyLayer.getSelectionLayer(),
		 * bodyLayer.getColumnHideShowLayer(), columnHeaderLayer.getColumnHeaderLayer(),
		 * columnHeaderLayer.getColumnHeaderDataLayer(), columnHeaderLayer.getColumnGroupHeaderLayer(), columnGroupModel
		 * ); bodyLayer.registerCommandHandler(columnChooserCommandHandler);
		 */
    /*
		 * 不使用默认的表头菜单,使用自定义的菜单,因此自定义菜单在 corner 中添加了相应的菜单项,所以需要指定这些添加的 command 在哪一层进一处理
		 */
    // 表头中添加自定义菜单会引发一些不可预料的问题,故先去掉
    // table.addConfiguration(new HeaderMenuConfiguration(table));
    /*
		 * 增加表格的自定义右键菜单
		 */
    table.addConfiguration(new BodyMenuConfiguration(this));
    // 注册列头点击监听(处理排序)
    table.addConfiguration(new SingleClickSortConfiguration());
    /*
		 * 初始化“撤销/重做”历史
		 */
    initializeOperationHistory();
    table.setData(IUndoContext.class.getName(), undoContext);
    /* Weachy - 注册修改后保存内容并自适应大小的处理 handler(覆盖默认的handler:UpdateDataCommandHandler) */
    bodyLayer.getBodyDataLayer().registerCommandHandler(new UpdateDataAndAutoResizeCommandHandler(table, bodyLayer.getBodyDataLayer()));
    /* Weachy - 注册当前显示行的行高自适应处理 handler */
    compositeLayer.registerCommandHandler(new AutoResizeCurrentRowsCommandHandler(compositeLayer));
    /* Weachy - 移除系统默认的查找 handler,添加自定义的查找替换 handler */
    bodyLayer.getSelectionLayer().unregisterCommandHandler(SearchCommand.class);
    bodyLayer.getSelectionLayer().registerCommandHandler(new FindReplaceCommandHandler(bodyLayer.getSelectionLayer()));
    /*
		 * 下面给 NatTable 添加可编辑单元格的配置
		 */
    table.addConfiguration(editableGridConfiguration());
    // 添加标记的自定义显示样式
    IConfigRegistry configRegistry = new ConfigRegistry();
    /*
		 * 如果是水平布局,则使用 ColumnOverrideLabelAccumulator 实现指定列都使用相同的显示样式;否则使用 CellOverrideLabelAccumulator 实现根据显示的内容来显示样式。
		 */
    if (isHorizontalLayout) {
        // 第一步:创建一个标签累加器,给需要绘制会不同效果的 cells 添加自定义的标签。在这里是第三列的标签列。
        ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(bodyLayer);
        columnLabelAccumulator.registerColumnOverrides(0, "LINENUMBER_CELL_LABEL");
        columnLabelAccumulator.registerColumnOverrides(1, SOURCE_EDIT_CELL_LABEL);
        columnLabelAccumulator.registerColumnOverrides(2, FLAG_CELL_LABEL);
        columnLabelAccumulator.registerColumnOverrides(3, TARGET_EDIT_CELL_LABEL);
        // 第二步:注册这个标签累加器。
        bodyLayer.setConfigLabelAccumulator(columnLabelAccumulator);
        // 第三步:把自定义的 cell painter,cell style 与自定义的标签进行关联。
        addFlagLableToColumn(configRegistry);
        addLineNumberToColumn(configRegistry);
    } else {
        ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(bodyLayer);
        columnLabelAccumulator.registerColumnOverrides(0, "LINENUMBER_CELL_LABEL");
        columnLabelAccumulator.registerColumnOverrides(1, FLAG_CELL_LABEL);
        columnLabelAccumulator.registerColumnOverrides(VerticalNatTableConfig.TARGET_COL_INDEX, SOURCE_EDIT_CELL_LABEL);
        columnLabelAccumulator.registerColumnOverrides(VerticalNatTableConfig.TARGET_COL_INDEX, TARGET_EDIT_CELL_LABEL);
        bodyLayer.setConfigLabelAccumulator(columnLabelAccumulator);
        // CellOverrideLabelAccumulator<TransUnitDummy> cellLabelAccumulator = new
        // CellOverrideLabelAccumulator<TransUnitDummy>(
        // (IRowDataProvider) bodyDataProvider);
        // CellOverrideLabelAccumulator<TransUnitBean> cellLabelAccumulator = new
        // CellOverrideLabelAccumulator<TransUnitBean>(
        // (IRowDataProvider) bodyDataProvider);
        // cellLabelAccumulator.registerOverride("flag", VerticalNatTableConfig.SOURCE_COL_INDEX,
        // FOCUS_CELL_LABEL);
        //
        // bodyLayer.getBodyDataLayer().setConfigLabelAccumulator(cellLabelAccumulator);
        addFlagLableToColumn(configRegistry);
        addLineNumberToColumn(configRegistry);
    }
    table.setConfigRegistry(configRegistry);
    // configure manually
    table.configure();
    /* Weachy - 垂直布局下,注册使键盘方向键以 2 行为一个单位移动选中行的处理 handler(覆盖默认的handler:MoveRowSelectionCommandHandler) */
    if (!isHorizontalLayout) {
    // SelectionLayer selectionLayer = bodyLayer.getSelectionLayer();
    // selectionLayer.registerCommandHandler(new VerticalMoveRowSelectionCommandHandler(selectionLayer));
    }
    if (bodyLayer.selectionLayer.getRowCount() > 0) {
        // 默认选中第一行
        HsMultiActiveCellEditor.commit(true);
        bodyLayer.selectionLayer.doCommand(new SelectCellCommand(bodyLayer.getSelectionLayer(), getTgtColumnIndex(), isHorizontalLayout ? 0 : 1, false, false));
        HsMultiCellEditorControl.activeSourceAndTargetCell(this);
    }
    IWorkbenchPage page = getSite().getPage();
    IViewReference[] viewReferences = page.getViewReferences();
    IViewPart view;
    for (int i = 0; i < viewReferences.length; i++) {
        view = viewReferences[i].getView(false);
        if (view == null) {
            continue;
        }
        // 切换到其他视图,再切换回来,解决NatTable改变布局后其他视图无法监听到的问题。
        view.setFocus();
    // break;
    }
    // 改变布局方式后,把焦点给 NatTable
    table.setFocus();
    RowHeightCalculator rowHeightCalculator = new RowHeightCalculator(bodyLayer, table, 32);
    ILayer lay = bodyLayer.getViewportLayer();
    if (lay instanceof HorizontalViewportLayer) {
        ((HorizontalViewportLayer) bodyLayer.getViewportLayer()).setRowHeightCalculator(rowHeightCalculator);
    } else if (lay instanceof VerticalViewportLayer) {
        ((VerticalViewportLayer) bodyLayer.getViewportLayer()).setRowHeightCalculator(rowHeightCalculator);
    }
    parent.layout();
    NoteToolTip toolTip = new NoteToolTip(table);
    toolTip.setPopupDelay(10);
    toolTip.activate();
    toolTip.setShift(new Point(10, 10));
    StateToolTip stateTip = new StateToolTip(table);
    stateTip.setPopupDelay(10);
    stateTip.activate();
    stateTip.setShift(new Point(10, 10));
    NotSendToTmToolTip notSendToTMToolTip = new NotSendToTmToolTip(table);
    notSendToTMToolTip.setPopupDelay(10);
    notSendToTMToolTip.activate();
    notSendToTMToolTip.setShift(new Point(10, 10));
    HasQustionToolTip hasqustionTooltip = new HasQustionToolTip(table);
    hasqustionTooltip.setPopupDelay(10);
    hasqustionTooltip.activate();
    hasqustionTooltip.setShift(new Point(10, 10));
    // 在状态栏上显示当前文本段的信息。
    updateStatusLine();
}
Also used : DisposeListener(org.eclipse.swt.events.DisposeListener) IViewPart(org.eclipse.ui.IViewPart) PaintListener(org.eclipse.swt.events.PaintListener) IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) DisposeListener(org.eclipse.swt.events.DisposeListener) Listener(org.eclipse.swt.widgets.Listener) IPropertyListener(org.eclipse.ui.IPropertyListener) VerifyListener(org.eclipse.swt.events.VerifyListener) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) FindReplaceCommandHandler(net.heartsome.cat.ts.ui.xliffeditor.nattable.search.command.FindReplaceCommandHandler) DisposeEvent(org.eclipse.swt.events.DisposeEvent) BodyMenuConfiguration(net.heartsome.cat.ts.ui.xliffeditor.nattable.menu.BodyMenuConfiguration) IUndoContext(org.eclipse.core.commands.operations.IUndoContext) IConfigRegistry(net.sourceforge.nattable.config.IConfigRegistry) ConfigRegistry(net.sourceforge.nattable.config.ConfigRegistry) Control(org.eclipse.swt.widgets.Control) Language(net.heartsome.cat.common.locale.Language) DefaultNatTableStyleConfiguration(net.sourceforge.nattable.config.DefaultNatTableStyleConfiguration) IViewReference(org.eclipse.ui.IViewReference) NatTable(net.sourceforge.nattable.NatTable) ColumnOverrideLabelAccumulator(net.sourceforge.nattable.layer.cell.ColumnOverrideLabelAccumulator) UpdateDataAndAutoResizeCommandHandler(net.heartsome.cat.ts.ui.xliffeditor.nattable.handler.UpdateDataAndAutoResizeCommandHandler) SelectCellCommand(net.sourceforge.nattable.selection.command.SelectCellCommand) ILayer(net.sourceforge.nattable.layer.ILayer) Point(org.eclipse.swt.graphics.Point) CompositeLayer(net.sourceforge.nattable.layer.CompositeLayer) Point(org.eclipse.swt.graphics.Point) RowHeightCalculator(net.heartsome.cat.ts.ui.xliffeditor.nattable.layer.RowHeightCalculator) VerticalViewportLayer(net.heartsome.cat.ts.ui.xliffeditor.nattable.layer.VerticalViewportLayer) HorizontalViewportLayer(net.heartsome.cat.ts.ui.xliffeditor.nattable.layer.HorizontalViewportLayer) SingleClickSortConfiguration(net.sourceforge.nattable.sort.config.SingleClickSortConfiguration) IConfigRegistry(net.sourceforge.nattable.config.IConfigRegistry) GridData(org.eclipse.swt.layout.GridData) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) DefaultColumnHeaderDataProvider(net.sourceforge.nattable.grid.data.DefaultColumnHeaderDataProvider) AutoResizeCurrentRowsCommandHandler(net.heartsome.cat.ts.ui.xliffeditor.nattable.handler.AutoResizeCurrentRowsCommandHandler)

Example 13 with ILayer

use of net.sourceforge.nattable.layer.ILayer in project translationstudio8 by heartsome.

the class HorizontalViewportLayer method moveRowPositionIntoViewport.

public void moveRowPositionIntoViewport(int scrollableRowPosition, boolean forceEntireCellIntoViewport) {
    ILayer underlyingLayer = getUnderlyingLayer();
    if (underlyingLayer.getRowIndexByPosition(scrollableRowPosition) >= 0) {
        if (scrollableRowPosition >= getMinimumOriginRowPosition()) {
            // 滚动条滚动过的行数
            int originRowPosition = getOriginRowPosition();
            if (scrollableRowPosition < originRowPosition) {
                // Move up
                setOriginRowPosition(scrollableRowPosition);
            } else {
                // 当前选中行的起始位置(包括滚动过的区域)
                int scrollableRowStartY = underlyingLayer.getStartYOfRowPosition(scrollableRowPosition);
                if (rowHeightCalculator != null)
                    rowHeightCalculator.recaculateRowHeight(scrollableRowPosition);
                int currentRowHeight = underlyingLayer.getRowHeightByPosition(scrollableRowPosition);
                // 当前选中行的结束位置,包括不可见的部分(包括滚动过的区域)
                int scrollableRowEndY = scrollableRowStartY + currentRowHeight;
                // 编辑区的高(不包括滚动过的区域)
                int clientAreaHeight = getClientAreaHeight();
                // 编辑区的高(包括滚动过的区域)
                int viewportEndY = underlyingLayer.getStartYOfRowPosition(originRowPosition) + clientAreaHeight;
                if (viewportEndY < scrollableRowEndY) {
                    // 选中行下半部分没有显示完全时
                    if (currentRowHeight >= clientAreaHeight) {
                        // 当前行高大于等于编辑区的高
                        // Move up:设置起始行为当前行
                        setOriginRowPosition(scrollableRowPosition);
                    } else {
                        //							int targetOriginRowPosition = underlyingLayer.getRowPositionByY(scrollableRowEndY
                        //									- clientAreaHeight) + 1;
                        //							// Move up:将当前选中行显示完全
                        //							setOriginRowPosition(targetOriginRowPosition);
                        int ch = clientAreaHeight;
                        int r = scrollableRowPosition;
                        for (; r > 0; r--) {
                            int h = rowHeightCalculator.recaculateRowHeight(r);
                            ch -= h;
                            if (ch < 0) {
                                break;
                            }
                        }
                        setOriginRowPosition(r + 1);
                    }
                }
            }
        }
    }
}
Also used : ILayer(net.sourceforge.nattable.layer.ILayer)

Example 14 with ILayer

use of net.sourceforge.nattable.layer.ILayer in project translationstudio8 by heartsome.

the class InlineCellEditController method editCellInline.

public static boolean editCellInline(LayerCell cell, Character initialEditValue, Composite parent, IConfigRegistry configRegistry) {
    try {
        ActiveCellEditor.commit();
        final List<String> configLabels = cell.getConfigLabels().getLabels();
        Rectangle cellBounds = cell.getBounds();
        ILayer layer = cell.getLayer();
        int columnPosition = layer.getColumnPositionByX(cellBounds.x);
        int columnIndex = layer.getColumnIndexByPosition(columnPosition);
        int rowPosition = layer.getRowPositionByY(cellBounds.y);
        int rowIndex = layer.getRowIndexByPosition(rowPosition);
        boolean editable = configRegistry.getConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, DisplayMode.EDIT, configLabels).isEditable(columnIndex, rowIndex);
        if (!editable) {
            return false;
        }
        ICellEditor cellEditor = configRegistry.getConfigAttribute(EditConfigAttributes.CELL_EDITOR, DisplayMode.EDIT, configLabels);
        IDisplayConverter displayConverter = configRegistry.getConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, DisplayMode.EDIT, configLabels);
        IStyle cellStyle = new CellStyleProxy(configRegistry, DisplayMode.EDIT, configLabels);
        IDataValidator dataValidator = configRegistry.getConfigAttribute(EditConfigAttributes.DATA_VALIDATOR, DisplayMode.EDIT, configLabels);
        ICellEditHandler editHandler = new SingleEditHandler(cellEditor, layer, columnPosition, rowPosition);
        final Rectangle editorBounds = layer.getLayerPainter().adjustCellBounds(new Rectangle(cellBounds.x, cellBounds.y, cellBounds.width, cellBounds.height));
        Object originalCanonicalValue = cell.getDataValue();
        ActiveCellEditor.activate(cellEditor, parent, originalCanonicalValue, initialEditValue, displayConverter, cellStyle, dataValidator, editHandler, columnPosition, rowPosition, columnIndex, rowIndex);
        Control editorControl = ActiveCellEditor.getControl();
        if (editorControl != null) {
            editorControl.setBounds(editorBounds);
            ILayerListener layerListener = layerListenerMap.get(layer);
            if (layerListener == null) {
                layerListener = new InlineCellEditLayerListener(layer);
                layerListenerMap.put(layer, layerListener);
                layer.addLayerListener(layerListener);
            }
        }
    } catch (Exception e) {
        if (cell == null) {
            System.err.println("Cell being edited is no longer available. " + "Character: " + initialEditValue);
        } else {
            System.err.println("Error while editing cell (inline): " + "Cell: " + cell + "; Character: " + initialEditValue);
            e.printStackTrace(System.err);
        }
    }
    return true;
}
Also used : IDataValidator(net.sourceforge.nattable.data.validate.IDataValidator) ILayer(net.sourceforge.nattable.layer.ILayer) Rectangle(org.eclipse.swt.graphics.Rectangle) ILayerListener(net.sourceforge.nattable.layer.ILayerListener) IDisplayConverter(net.sourceforge.nattable.data.convert.IDisplayConverter) IStyle(net.sourceforge.nattable.style.IStyle) Control(org.eclipse.swt.widgets.Control) ICellEditor(net.sourceforge.nattable.edit.editor.ICellEditor) CellStyleProxy(net.sourceforge.nattable.style.CellStyleProxy)

Example 15 with ILayer

use of net.sourceforge.nattable.layer.ILayer in project translationstudio8 by heartsome.

the class LayerCommandUtil method convertColumnPositionToTargetContext.

public static ColumnPositionCoordinate convertColumnPositionToTargetContext(ColumnPositionCoordinate columnPositionCoordinate, ILayer targetLayer) {
    if (columnPositionCoordinate != null) {
        ILayer layer = columnPositionCoordinate.getLayer();
        if (layer == targetLayer) {
            return columnPositionCoordinate;
        }
        int columnPosition = columnPositionCoordinate.getColumnPosition();
        int underlyingColumnPosition = layer.localToUnderlyingColumnPosition(columnPosition);
        if (underlyingColumnPosition < 0) {
            return null;
        }
        Collection<ILayer> underlyingLayers = layer.getUnderlyingLayersByColumnPosition(columnPosition);
        if (underlyingLayers != null) {
            for (ILayer underlyingLayer : underlyingLayers) {
                if (underlyingLayer != null) {
                    ColumnPositionCoordinate convertedColumnPositionCoordinate = convertColumnPositionToTargetContext(new ColumnPositionCoordinate(underlyingLayer, underlyingColumnPosition), targetLayer);
                    if (convertedColumnPositionCoordinate != null) {
                        return convertedColumnPositionCoordinate;
                    }
                }
            }
        }
    }
    return null;
}
Also used : ColumnPositionCoordinate(net.sourceforge.nattable.coordinate.ColumnPositionCoordinate) ILayer(net.sourceforge.nattable.layer.ILayer)

Aggregations

ILayer (net.sourceforge.nattable.layer.ILayer)20 PositionCoordinate (net.sourceforge.nattable.coordinate.PositionCoordinate)3 SelectionLayer (net.sourceforge.nattable.selection.SelectionLayer)3 NatTable (net.sourceforge.nattable.NatTable)2 ColumnPositionCoordinate (net.sourceforge.nattable.coordinate.ColumnPositionCoordinate)2 RowPositionCoordinate (net.sourceforge.nattable.coordinate.RowPositionCoordinate)2 IDisplayConverter (net.sourceforge.nattable.data.convert.IDisplayConverter)2 IDataValidator (net.sourceforge.nattable.data.validate.IDataValidator)2 ColumnGroupModel (net.sourceforge.nattable.group.ColumnGroupModel)2 CellStyleProxy (net.sourceforge.nattable.style.CellStyleProxy)2 IStyle (net.sourceforge.nattable.style.IStyle)2 Rectangle (org.eclipse.swt.graphics.Rectangle)2 Control (org.eclipse.swt.widgets.Control)2 ArrayList (java.util.ArrayList)1 Language (net.heartsome.cat.common.locale.Language)1 AutoResizeCurrentRowsCommandHandler (net.heartsome.cat.ts.ui.xliffeditor.nattable.handler.AutoResizeCurrentRowsCommandHandler)1 UpdateDataAndAutoResizeCommandHandler (net.heartsome.cat.ts.ui.xliffeditor.nattable.handler.UpdateDataAndAutoResizeCommandHandler)1 HorizontalViewportLayer (net.heartsome.cat.ts.ui.xliffeditor.nattable.layer.HorizontalViewportLayer)1 RowHeightCalculator (net.heartsome.cat.ts.ui.xliffeditor.nattable.layer.RowHeightCalculator)1 VerticalViewportLayer (net.heartsome.cat.ts.ui.xliffeditor.nattable.layer.VerticalViewportLayer)1