Package org.eclipse.nebula.widgets.nattable.layer

Examples of org.eclipse.nebula.widgets.nattable.layer.IUniqueIndexLayer


            public void setDataValue(int columnIndex, int rowIndex,
                    Object newValue) {}
        };

        IConfigRegistry configRegistry = new ConfigRegistry();
        IUniqueIndexLayer dataLayer = new DataLayer(myDataProvider);

        // Plug in the SummaryRowLayer
        IUniqueIndexLayer summaryRowLayer = new SummaryRowLayer(dataLayer,
                configRegistry, false);
        ViewportLayer viewportLayer = new ViewportLayer(summaryRowLayer);

        NatTable natTable = new NatTable(parent, viewportLayer, false);
View Full Code Here


                .valueOf(localColumnPosition));
        if (cachedStartX != null) {
            return cachedStartX.intValue();
        }

        IUniqueIndexLayer underlyingLayer = (IUniqueIndexLayer) getUnderlyingLayer();
        int underlyingPosition = localToUnderlyingColumnPosition(localColumnPosition);
        if (underlyingPosition < 0) {
            return -1;
        }
        int underlyingStartX = underlyingLayer
                .getStartXOfColumnPosition(underlyingPosition);
        if (underlyingStartX < 0) {
            return -1;
        }

        for (Integer hiddenIndex : getHiddenColumnIndexes()) {
            int hiddenPosition = underlyingLayer
                    .getColumnPositionByIndex(hiddenIndex.intValue());
            if (hiddenPosition <= underlyingPosition) {
                underlyingStartX -= underlyingLayer
                        .getColumnWidthByPosition(hiddenPosition);
            }
        }

        startXCache.put(Integer.valueOf(localColumnPosition),
View Full Code Here

                .valueOf(localRowPosition));
        if (cachedStartY != null) {
            return cachedStartY.intValue();
        }

        IUniqueIndexLayer underlyingLayer = (IUniqueIndexLayer) getUnderlyingLayer();
        int underlyingPosition = localToUnderlyingRowPosition(localRowPosition);
        if (underlyingPosition < 0) {
            return -1;
        }
        int underlyingStartY = underlyingLayer
                .getStartYOfRowPosition(underlyingPosition);
        if (underlyingStartY < 0) {
            return -1;
        }

        for (Integer hiddenIndex : getHiddenRowIndexes()) {
            int hiddenPosition = underlyingLayer
                    .getRowPositionByIndex(hiddenIndex.intValue());
            // if the hidden position is -1, it is hidden in the underlying
            // layer
            // therefore the underlying layer should handle the positioning
            if (hiddenPosition >= 0 && hiddenPosition <= underlyingPosition) {
                underlyingStartY -= underlyingLayer
                        .getRowHeightByPosition(hiddenPosition);
            }
        }

        startYCache.put(Integer.valueOf(localRowPosition),
View Full Code Here

    // Expand/collapse

    @Override
    public boolean isColumnIndexHidden(int columnIndex) {

        IUniqueIndexLayer underlyingLayer = (IUniqueIndexLayer) getUnderlyingLayer();

        boolean isHiddeninUnderlyingLayer = ColumnGroupUtils
                .isColumnIndexHiddenInUnderLyingLayer(columnIndex, this,
                        underlyingLayer);
View Full Code Here

    @Override
    public Collection<Integer> getHiddenColumnIndexes() {
        Collection<Integer> hiddenColumnIndexes = new HashSet<Integer>();

        IUniqueIndexLayer underlyingLayer = (IUniqueIndexLayer) getUnderlyingLayer();
        int underlyingColumnCount = underlyingLayer.getColumnCount();
        for (int i = 0; i < underlyingColumnCount; i++) {
            int columnIndex = underlyingLayer.getColumnIndexByPosition(i);

            for (ColumnGroupModel model : models) {
                ColumnGroup columnGroup = model
                        .getColumnGroupByIndex(columnIndex);
View Full Code Here

        // This can happen if a row has just been removed.
        if (rowIndex >= model.getDataProvider().getRowCount()) {
            return true;
        }

        IUniqueIndexLayer underlyingLayer = (IUniqueIndexLayer) getUnderlyingLayer();

        boolean isHiddeninUnderlyingLayer = RowGroupUtils
                .isRowIndexHiddenInUnderLyingLayer(rowIndex, this,
                        underlyingLayer);
View Full Code Here

    @Override
    public Collection<Integer> getHiddenRowIndexes() {
        Collection<Integer> hiddenRowIndexes = new HashSet<Integer>();

        IUniqueIndexLayer underlyingLayer = (IUniqueIndexLayer) getUnderlyingLayer();
        int underlyingColumnCount = underlyingLayer.getRowCount();
        for (int i = 0; i < underlyingColumnCount; i++) {
            int rowIndex = underlyingLayer.getRowIndexByPosition(i);
            if (isRowIndexHidden(rowIndex)) {
                hiddenRowIndexes.add(Integer.valueOf(rowIndex));
            }
        }
View Full Code Here

        return getWidth();
    }

    @Override
    public int getColumnPositionByX(int x) {
        IUniqueIndexLayer underlyingLayer = getUnderlyingLayer();
        int xOffset = underlyingLayer.getStartXOfColumnPosition(this.topLeftPosition.columnPosition);
        return underlyingToLocalColumnPosition(
                underlyingLayer, underlyingLayer.getColumnPositionByX(xOffset + x));
    }
View Full Code Here

    @Override
    public int getStartXOfColumnPosition(int columnPosition) {
        if (columnPosition < 0 || columnPosition >= getColumnCount()) {
            return -1;
        }
        IUniqueIndexLayer underlyingLayer = getUnderlyingLayer();
        final int underlyingColumnPosition =
                LayerUtil.convertColumnPosition(this, columnPosition, underlyingLayer);
        if (underlyingColumnPosition < 0) {
            return -1;
        }
        return underlyingLayer.getStartXOfColumnPosition(underlyingColumnPosition)
                - underlyingLayer.getStartXOfColumnPosition(this.topLeftPosition.columnPosition);
    }
View Full Code Here

        return getHeight();
    }

    @Override
    public int getRowPositionByY(int y) {
        IUniqueIndexLayer underlyingLayer = getUnderlyingLayer();
        int yOffset = underlyingLayer.getStartYOfRowPosition(this.topLeftPosition.rowPosition);
        return underlyingToLocalRowPosition(
                underlyingLayer, underlyingLayer.getRowPositionByY(yOffset + y));
    }
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.layer.IUniqueIndexLayer

Copyright © 2018 www.massapicom. 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.