Package org.eclipse.nebula.widgets.nattable.style

Examples of org.eclipse.nebula.widgets.nattable.style.HorizontalAlignmentEnum


                fgColor);

        Font font = fontPicker.getSelectedFont();
        newStyle.setAttributeValue(CellStyleAttributes.FONT, font);

        HorizontalAlignmentEnum hAlign = horizontalAlignmentPicker
                .getSelectedAlignment();
        newStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                hAlign);

        VerticalAlignmentEnum vAlign = verticalAlignmentPicker
View Full Code Here


                    fgColor);
        }

        // Alignment
        String hAlignPrefix = prefix + DOT + H_ALIGNMENT_PREFIX;
        HorizontalAlignmentEnum hAlign = loadHAlignment(hAlignPrefix,
                properties);
        if (hAlign != null) {
            style.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                    hAlign);
        }
View Full Code Here

    public ICellPainter getCellPainterAt(int x, int y, ILayerCell cell, GC gc,
            Rectangle adjustedCellBounds, IConfigRegistry configRegistry) {
        // need to take the alignment into account
        IStyle cellStyle = CellStyleUtil.getCellStyle(cell, configRegistry);

        HorizontalAlignmentEnum horizontalAlignment = cellStyle
                .getAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT);
        int horizontalAlignmentPadding = 0;
        switch (horizontalAlignment) {
            case LEFT:
                horizontalAlignmentPadding = leftPadding;
View Full Code Here

    @Test
    public void loadPersistedAlignmentSettings() throws Exception {
        Style style = StylePersistor.loadStyle(TEST_PREFIX, propertiesFixture);

        HorizontalAlignmentEnum expecetdHAlign = style
                .getAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT);
        assertEquals(HorizontalAlignmentEnum.LEFT, expecetdHAlign);

        VerticalAlignmentEnum expecetdVAlign = style
                .getAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT);
View Full Code Here

    // Horizontal alignment
    @Test
    public void retreivedCellShouldHaveRightAlignment() {
        // Register horizontal alignment
        final HorizontalAlignmentEnum hAlignment = HorizontalAlignmentEnum.RIGHT;
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                hAlignment);
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
                cellStyle, DisplayMode.NORMAL,
                AlternatingRowConfigLabelAccumulator.ODD_ROW_CONFIG_TYPE);

        // Check cell horizontal alignment
        ILayerCell cell = natTable.getCellByPosition(2, 2);
        Assert.assertEquals(
                hAlignment.name(),
                configRegistry
                        .getConfigAttribute(CellConfigAttributes.CELL_STYLE,
                                cell.getDisplayMode(),
                                cell.getConfigLabels().getLabels())
                        .getAttributeValue(
View Full Code Here

                testCellStyle2, DisplayMode.SELECT);

        // The 'default' from SELECT gets picked up
        StyleProxy cellStyleProxy = new CellStyleProxy(configRegistry,
                DisplayMode.SELECT, Arrays.asList(TEST_CONFIG_LABEL1));
        HorizontalAlignmentEnum alignmentFromProxy = cellStyleProxy
                .getAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT);

        Assert.assertEquals(HorizontalAlignmentEnum.CENTER, alignmentFromProxy);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.style.HorizontalAlignmentEnum

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.