Examples of ILayerCell


Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

    public Class<?> getColumnClass(int col) {
        return null;
    }

    public Comparator<?> getColumnComparator(final int col) {
        ILayerCell cell = columnHeaderDataLayer.getCellByPosition(col, 0);
        if (cell == null) {
            return null;
        }
        Comparator<?> comparator = configRegistry.getConfigAttribute(
                SortConfigAttributes.SORT_COMPARATOR, cell.getDisplayMode(),
                cell.getConfigLabels().getLabels());

        return (comparator instanceof NullComparator) ? null : comparator;
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

        assertNull(cells[0]);
        // Should only have Column headers
        int[] selectedColumns = gridLayer.getBodyLayer().getSelectionLayer()
                .getSelectedColumnPositions();
        for (int columnPosition = 1; columnPosition < cells.length; columnPosition++) {
            ILayerCell cell = cells[columnPosition];
            // Remember to substract offset from columnPosition
            assertEquals(columnHeaderLayer.getDataValueByPosition(
                    selectedColumns[columnPosition - 1], 0),
                    cell.getDataValue());
        }
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

            // Check body data
            int selectedRowPosition = rowsIterator.next().intValue();

            for (int columnPosition = 1; columnPosition < cells.length; columnPosition++) {
                final ILayerCell cell = cells[columnPosition];
                if (cell != null) {
                    cellWithDataCounter++;
                    assertEquals(selectionLayer.getDataValueByPosition(
                            selectedColumns[columnPosition - 1],
                            selectedRowPosition), cell.getDataValue());
                }
            }
        }
        assertEquals(selectionLayer.getSelectedCellPositions().length,
                cellWithDataCounter);
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

        return dragToGridColumnPosition;
    }

    protected CellEdgeEnum getMoveDirection(int x) {
        ILayerCell cell = getColumnCell(x);
        if (cell != null) {
            Rectangle selectedColumnHeaderRect = cell.getBounds();
            return CellEdgeDetectUtil.getHorizontalCellEdge(
                    selectedColumnHeaderRect, new Point(x, initialEvent.y));
        }

        return null;
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

     *            The y coordinate of the drop location
     * @return The direction whether the drop should be performed before the the
     *         cell at drop position or after
     */
    protected CellEdgeEnum getMoveDirection(int y) {
        ILayerCell cell = getRowCell(y);
        if (cell != null) {
            Rectangle selectedRowHeaderRect = cell.getBounds();
            return CellEdgeDetectUtil.getVerticalCellEdge(
                    selectedRowHeaderRect, new Point(initialEvent.x, y));
        }

        return null;
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

            for (int rowPosition = positionRectangle.y; rowPosition < positionRectangle.y
                    + positionRectangle.height; rowPosition++) {
                if (columnPosition == -1 || rowPosition == -1) {
                    continue;
                }
                ILayerCell cell = natLayer.getCellByPosition(columnPosition,
                        rowPosition);
                if (cell != null) {
                    if (cell.isSpannedCell()) {
                        spannedCells.add(cell);
                    } else {
                        paintCell(cell, gc, configRegistry);
                    }
                }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

            // which should always return 1, we ask for row position 0 instead
            // of
            // using getGroupHeaderRowPosition(), if we would use
            // getGroupHeaderRowPosition()
            // the ColumnGroupGroupHeaderLayer wouldn't work anymore
            ILayerCell cell = columnHeaderLayer.getCellByPosition(
                    columnPosition, 0);
            if (cell != null) {
                final int rowSpan;

                if (calculateHeight && model.size() == 0) {
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

    // Cell features

    @Override
    public boolean isCellPositionSelected(int columnPosition, int rowPosition) {
        ILayerCell cell = selectionLayer.getCellByPosition(columnPosition,
                rowPosition);
        int cellOriginRowPosition = cell.getOriginRowPosition();
        for (int testRowPosition = cellOriginRowPosition; testRowPosition < cellOriginRowPosition
                + cell.getRowSpan(); testRowPosition++) {
            if (isRowPositionSelected(testRowPosition)) {
                return true;
            }
        }
        return false;
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

            boolean forcingEntireCellIntoViewport) {
        boolean selectCell = true;
        if (isControlOnly(withShiftMask, withControlMask)) {
            if (selectionLayer.isCellPositionSelected(columnPosition,
                    rowPosition)) {
                ILayerCell cell = selectionLayer.getCellByPosition(
                        columnPosition, rowPosition);
                Rectangle cellRect = new Rectangle(
                        cell.getOriginColumnPosition(),
                        cell.getOriginRowPosition(), cell.getColumnSpan(),
                        cell.getRowSpan());
                selectionLayer.clearSelection(cellRect);
                selectCell = false;
            }
        }
        if (selectCell) {
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

            boolean withShiftMask, boolean withControlMask) {
        if (!withShiftMask && !withControlMask) {
            selectionLayer.clear(false);
        }

        ILayerCell cell = selectionLayer.getCellByPosition(columnPosition,
                rowPosition);

        if (cell != null) {
            selectionLayer.setLastSelectedCell(cell.getOriginColumnPosition(),
                    cell.getOriginRowPosition());

            // Shift pressed + row selected
            if (selectionLayer.getSelectionModel().isMultipleSelectionAllowed()
                    && withShiftMask
                    && selectionLayer.getLastSelectedRegion() != null
                    && selectionLayer.hasRowSelection()
                    && (selectionLayer.getSelectionAnchor().rowPosition != SelectionLayer.NO_SELECTION)
                    && (selectionLayer.getSelectionAnchor().columnPosition != SelectionLayer.NO_SELECTION)) {
                // if cell.rowPosition > getSelectionAnchor().rowPositon, then
                // use cell.rowPosition + span - 1 (maxRowPosition)
                // else use cell.originRowPosition (minRowPosition)
                // and compare with selectionAnchor.rowPosition
                if (cell.getRowPosition() > selectionLayer.getSelectionAnchor().rowPosition) {
                    int maxRowPosition = cell.getOriginRowPosition()
                            + cell.getRowSpan() - 1;
                    selectionLayer.getLastSelectedRegion().height = Math
                            .abs(selectionLayer.getSelectionAnchor().rowPosition
                                    - maxRowPosition) + 1;
                } else {
                    int minRowPosition = cell.getOriginRowPosition();
                    selectionLayer.getLastSelectedRegion().height = Math
                            .abs(selectionLayer.getSelectionAnchor().rowPosition
                                    - minRowPosition) + 1;
                }
                selectionLayer.getLastSelectedRegion().y = Math.min(
                        selectionLayer.getSelectionAnchor().rowPosition,
                        cell.getOriginRowPosition());

                if (cell.getColumnPosition() > selectionLayer
                        .getSelectionAnchor().columnPosition) {
                    int maxColumnPosition = cell.getOriginColumnPosition()
                            + cell.getColumnSpan() - 1;
                    selectionLayer.getLastSelectedRegion().width = Math
                            .abs(selectionLayer.getSelectionAnchor().columnPosition
                                    - maxColumnPosition) + 1;
                } else {
                    int minColumnPosition = cell.getOriginColumnPosition();
                    selectionLayer.getLastSelectedRegion().width = Math
                            .abs(selectionLayer.getSelectionAnchor().columnPosition
                                    - minColumnPosition) + 1;
                }
                selectionLayer.getLastSelectedRegion().x = Math.min(
                        selectionLayer.getSelectionAnchor().columnPosition,
                        cell.getOriginColumnPosition());

                selectionLayer.addSelection(selectionLayer
                        .getLastSelectedRegion());
            } else {
                selectionLayer.setLastSelectedRegion(null);
                Rectangle selection = new Rectangle(
                        cell.getOriginColumnPosition(),
                        cell.getOriginRowPosition(), cell.getColumnSpan(),
                        cell.getRowSpan());

                selectionLayer.addSelection(selection);
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.