Examples of LabelStack


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

        return displayModes[columnPosition][rowPosition];
    }

    public LabelStack getConfigLabelsByPosition(int columnPosition,
            int rowPosition) {
        LabelStack labelStack = new LabelStack();
        String configLabelsString = configLabels[columnPosition][rowPosition];
        if (configLabelsString != null) {
            StringTokenizer configLabelTokenizer = new StringTokenizer(
                    configLabelsString, ",");
            while (configLabelTokenizer.hasMoreTokens()) {
                labelStack.addLabel(configLabelTokenizer.nextToken());
            }
        }
        return labelStack;
    }
View Full Code Here

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

    }

    @Override
    public LabelStack getConfigLabelsByPosition(int columnPosition, int rowPosition) {
        if (columnPosition == 0) {
            LabelStack labelStack = this.gridLayer.getConfigLabelsByPosition(
                    columnPosition, this.gridLayer.getRowCount() - 1);
            labelStack.addLabelOnTop(SummaryRowLayer.DEFAULT_SUMMARY_ROW_CONFIG_LABEL);
            return labelStack;
        }

        int columnIndex = LayerUtil.convertColumnPosition(
                this.gridLayer, columnPosition, (IUniqueIndexLayer) this.underlyingLayer);
View Full Code Here

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

        super(null, 0, 0);

        this.dataValue = dataValue;

        displayMode = DisplayMode.NORMAL;
        configLabels = new LabelStack(TEST_CONFIG_TYPE);
        bounds = TEST_BOUNDS;
    }
View Full Code Here

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

                getSummaryRowPosition(), calculateInBackground,
                new ICalculator() {

                    @Override
                    public Object executeCalculation() {
                        LabelStack labelStack = getConfigLabelsByPositionWithoutTransformation(
                                columnPosition, getSummaryRowPosition());
                        String[] configLabels = labelStack.getLabels().toArray(
                                ArrayUtil.STRING_TYPE_ARRAY);

                        final ISummaryProvider summaryProvider = SummaryRowLayer.this.configRegistry
                                .getConfigAttribute(
                                        SummaryRowConfigAttributes.SUMMARY_PROVIDER,
View Full Code Here

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

    @Override
    public LabelStack getConfigLabelsByPosition(int columnPosition, int rowPosition) {
        if (isSummaryRowPosition(rowPosition)) {
            // create a new LabelStack that takes the config labels into account
            LabelStack labelStack = new LabelStack();
            if (getConfigLabelAccumulator() != null) {
                getConfigLabelAccumulator().accumulateConfigLabels(
                        labelStack, columnPosition, rowPosition);
            }
            labelStack.addLabelOnTop(DEFAULT_SUMMARY_ROW_CONFIG_LABEL);
            labelStack.addLabelOnTop(DEFAULT_SUMMARY_COLUMN_CONFIG_LABEL_PREFIX + columnPosition);
            return labelStack;
        }
        return super.getConfigLabelsByPosition(columnPosition, rowPosition);
    }
View Full Code Here

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

    private boolean interactive = false;

    public void shouldOpenDefaultDialogWithoutIncrementDecrementBox() {
        CellFixture cell = new CellFixture();
        cell.setBounds(new Rectangle(100, 100, 100, 20));
        cell.setConfigLabels(new LabelStack("Cell_Edit"));
        cell.setDataValue("123");
        cell.setDisplayMode(DisplayMode.NORMAL);

        TextCellEditor cellEditor = new TextCellEditor();
View Full Code Here

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

        assertEquals(100, natTable.getRowHeightByPosition(4));
    }

    @Test
    public void defaultConfigLabelsAreApplied() throws Exception {
        LabelStack configLabels = natTable.getConfigLabelsByPosition(0, 4);
        List<String> labels = configLabels.getLabels();

        assertEquals(2, labels.size());
        assertEquals(
                SummaryRowLayer.DEFAULT_SUMMARY_COLUMN_CONFIG_LABEL_PREFIX + 0,
                labels.get(0));
View Full Code Here

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

                layerStackWithSummary);
        labelAcc.registerColumnOverrides(0, "myLabel");
        ((ViewportLayer) layerStackWithSummary)
                .setConfigLabelAccumulator(labelAcc);

        LabelStack configLabels = natTable.getConfigLabelsByPosition(0, 4);
        List<String> labels = configLabels.getLabels();

        assertEquals(3, labels.size());
        assertEquals(
                SummaryRowLayer.DEFAULT_SUMMARY_COLUMN_CONFIG_LABEL_PREFIX + 0,
                labels.get(0));
View Full Code Here

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

                        .getRowObject(rowPosition);
                configLabels.addLabel("myLabel " + rowObject.security_id);
            }
        });

        LabelStack configLabels = natTable.getConfigLabelsByPosition(0, 4);
        List<String> labels = configLabels.getLabels();

        assertEquals(2, labels.size());
        assertEquals(
                SummaryRowLayer.DEFAULT_SUMMARY_COLUMN_CONFIG_LABEL_PREFIX + 0,
                labels.get(0));
        assertEquals(SummaryRowLayer.DEFAULT_SUMMARY_ROW_CONFIG_LABEL,
                labels.get(1));

        configLabels = natTable.getConfigLabelsByPosition(0, 3);
        labels = configLabels.getLabels();

        assertEquals(1, labels.size());
        assertTrue("Label in default body does not start with myLabel", labels
                .get(0).startsWith("myLabel"));
    }
View Full Code Here

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

        CellLabelMouseEventMatcher matcher = new CellLabelMouseEventMatcher(
                GridRegion.BODY, MouseEventMatcher.LEFT_BUTTON, TEST_LABEL);

        boolean match = matcher.matches(natTableFixture, new MouseEvent(
                SWTUtils.getLeftClickEvent(100, 100, 0, natTableFixture)),
                new LabelStack(GridRegion.BODY));

        Assert.assertTrue(match);
    }
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.