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

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


    public LabelStack getConfigLabelsByPosition(int columnPosition,
            int rowPosition) {
        int rowIndex = getRowIndexByPosition(rowPosition);
        if (columnPosition == 0
                && RowGroupUtils.isPartOfAGroup(model, rowIndex)) {
            LabelStack stack = new LabelStack(GridRegion.ROW_GROUP_HEADER);

            IRowGroup<T> group = RowGroupUtils.getRowGroupForRowIndex(model,
                    rowIndex);
            if (RowGroupUtils.isCollapsed(model, group)) {
                stack.addLabelOnTop(DefaultRowGroupHeaderLayerConfiguration.GROUP_COLLAPSED_CONFIG_TYPE);
            } else {
                stack.addLabelOnTop(DefaultRowGroupHeaderLayerConfiguration.GROUP_EXPANDED_CONFIG_TYPE);
            }

            List<Integer> selectedRowIndexes = convertToRowIndexes(selectionLayer
                    .getFullySelectedRowPositions());
            if (selectedRowIndexes.contains(rowIndex)) {
                stack.addLabelOnTop(SelectionStyleLabels.ROW_FULLY_SELECTED_STYLE);
            }

            return stack;
        } else {
            return rowHeaderLayer.getConfigLabelsByPosition(columnPosition - 1,
View Full Code Here


    @Override
    public LabelStack getRegionLabelsByXY(int x, int y) {
        int rowIndex = getRowIndexByPosition(getRowPositionByY(y));
        if (RowGroupUtils.isPartOfAGroup(model, rowIndex)
                && x < getColumnWidthByPosition(0)) {
            return new LabelStack(GridRegion.ROW_GROUP_HEADER);
        } else {
            return rowHeaderLayer.getRegionLabelsByXY(x
                    - getColumnWidthByPosition(0), y);
        }
    }
View Full Code Here

    @Test
    public void testRegisterOverrides() {
        labelAccumulator.registerColumnOverrides(0, TEST_LABEL1);
        labelAccumulator.registerColumnOverrides(0, TEST_LABEL2);

        LabelStack configLabels = new LabelStack();
        labelAccumulator.accumulateConfigLabels(configLabels, 0, 0);

        Assert.assertEquals(2, configLabels.getLabels().size());
        Assert.assertEquals(TEST_LABEL1, configLabels.getLabels().get(0));
        Assert.assertEquals(TEST_LABEL2, configLabels.getLabels().get(1));
    }
View Full Code Here

    @Test
    public void testRegisterOverridesEllipse() {
        labelAccumulator.registerColumnOverrides(0, TEST_LABEL1);
        labelAccumulator.registerColumnOverrides(0, TEST_LABEL2, TEST_LABEL3);

        LabelStack configLabels = new LabelStack();
        labelAccumulator.accumulateConfigLabels(configLabels, 0, 0);

        Assert.assertEquals(3, configLabels.getLabels().size());
        Assert.assertEquals(TEST_LABEL1, configLabels.getLabels().get(0));
        Assert.assertEquals(TEST_LABEL2, configLabels.getLabels().get(1));
        Assert.assertEquals(TEST_LABEL3, configLabels.getLabels().get(2));
    }
View Full Code Here

        List<String> labels = new ArrayList<String>();
        labels.add(TEST_LABEL2);
        labels.add(TEST_LABEL3);
        labelAccumulator.registerColumnOverrides(0, labels);

        LabelStack configLabels = new LabelStack();
        labelAccumulator.accumulateConfigLabels(configLabels, 0, 0);

        Assert.assertEquals(3, configLabels.getLabels().size());
        Assert.assertEquals(TEST_LABEL1, configLabels.getLabels().get(0));
        Assert.assertEquals(TEST_LABEL2, configLabels.getLabels().get(1));
        Assert.assertEquals(TEST_LABEL3, configLabels.getLabels().get(2));
    }
View Full Code Here

    @Test
    public void testRegisterOverridesOnTop() {
        labelAccumulator.registerColumnOverridesOnTop(0, TEST_LABEL1);
        labelAccumulator.registerColumnOverridesOnTop(0, TEST_LABEL2);

        LabelStack configLabels = new LabelStack();
        labelAccumulator.accumulateConfigLabels(configLabels, 0, 0);

        Assert.assertEquals(2, configLabels.getLabels().size());
        Assert.assertEquals(TEST_LABEL2, configLabels.getLabels().get(0));
        Assert.assertEquals(TEST_LABEL1, configLabels.getLabels().get(1));
    }
View Full Code Here

    public void testRegisterOverridesEllipseOnTop() {
        labelAccumulator.registerColumnOverridesOnTop(0, TEST_LABEL1);
        labelAccumulator.registerColumnOverridesOnTop(0, TEST_LABEL2,
                TEST_LABEL3);

        LabelStack configLabels = new LabelStack();
        labelAccumulator.accumulateConfigLabels(configLabels, 0, 0);

        Assert.assertEquals(3, configLabels.getLabels().size());
        Assert.assertEquals(TEST_LABEL2, configLabels.getLabels().get(0));
        Assert.assertEquals(TEST_LABEL3, configLabels.getLabels().get(1));
        Assert.assertEquals(TEST_LABEL1, configLabels.getLabels().get(2));
    }
View Full Code Here

        List<String> labels = new ArrayList<String>();
        labels.add(TEST_LABEL2);
        labels.add(TEST_LABEL3);
        labelAccumulator.registerColumnOverridesOnTop(0, labels);

        LabelStack configLabels = new LabelStack();
        labelAccumulator.accumulateConfigLabels(configLabels, 0, 0);

        Assert.assertEquals(3, configLabels.getLabels().size());
        Assert.assertEquals(TEST_LABEL2, configLabels.getLabels().get(0));
        Assert.assertEquals(TEST_LABEL3, configLabels.getLabels().get(1));
        Assert.assertEquals(TEST_LABEL1, configLabels.getLabels().get(2));
    }
View Full Code Here

            }
        }

        for (int columnPosition = 0; columnPosition < expectedColumnCount; columnPosition++) {
            for (int rowPosition = 0; rowPosition < expectedRowCount; rowPosition++) {
                LabelStack expectedConfigLabelsByPosition = expectedLayer
                        .getConfigLabelsByPosition(columnPosition, rowPosition);
                LabelStack actualConfigLabelsByPosition = actualLayer
                        .getConfigLabelsByPosition(columnPosition, rowPosition);
                Assert.assertEquals("Config labels by position ("
                        + columnPosition + ", " + rowPosition + ")",
                        expectedConfigLabelsByPosition,
                        actualConfigLabelsByPosition);
View Full Code Here

                .getChildLayerByLayoutCoordinate(0, 1);

        // Since I selected using grid coordinates, the column position should
        // be 1 rather than 2
        int rowPosition = gridLayer.localToUnderlyingRowPosition(1);
        final LabelStack labelStack = rowHeaderLayer.getConfigLabelsByPosition(
                rowPosition, 0);
        Assert.assertTrue(labelStack
                .hasLabel(SelectionStyleLabels.ROW_FULLY_SELECTED_STYLE));

        rowPosition = gridLayer.localToUnderlyingRowPosition(4);

        Assert.assertFalse("Should not have returned fully selected style.",
View Full Code Here

TOP

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

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.