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

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


    class ActiveTableStyleConfiguration extends AbstractRegistryConfiguration {

        @Override
        public void configureRegistry(IConfigRegistry configRegistry) {
            IStyle style = new Style();
            style.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                    GUIHelper.COLOR_BLUE);
            style.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                    GUIHelper.COLOR_WHITE);

            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, style, DisplayMode.NORMAL,
                    ACTIVE_LABEL);
View Full Code Here


            Rectangle bounds, IConfigRegistry configRegistry) {

        Image image = getImage(cell, configRegistry);
        if (image != null) {
            Rectangle imageBounds = image.getBounds();
            IStyle cellStyle = CellStyleUtil.getCellStyle(cell, configRegistry);
            int x0 = bounds.x
                    + CellStyleUtil.getHorizontalAlignmentPadding(
                            cellStyle, bounds, imageBounds.width);
            int y0 = bounds.y
                    + CellStyleUtil.getVerticalAlignmentPadding(
View Full Code Here

        }

        Image image = getImage(cell, configRegistry);
        if (image != null) {
            Rectangle imageBounds = image.getBounds();
            IStyle cellStyle = CellStyleUtil.getCellStyle(cell, configRegistry);

            int contentHeight = imageBounds.height;
            if (this.calculateByHeight && (contentHeight > bounds.height)) {
                int contentToCellDiff = (cell.getBounds().height - bounds.height);
                ILayer layer = cell.getLayer();
View Full Code Here

     * @param configRegistry
     *            The IConfigRegistry that is used by the NatTable instance to
     *            which the style configuration should be applied to.
     */
    protected void configureDefaultStyle(IConfigRegistry configRegistry) {
        IStyle defaultStyle = getDefaultCellStyle();
        if (!isStyleEmpty(defaultStyle)) {
            // register body cell style for every display mode
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, defaultStyle);
        }
View Full Code Here

     * @param configRegistry
     *            The IConfigRegistry that is used by the NatTable instance to
     *            which the style configuration should be applied to.
     */
    protected void configureColumnHeaderStyle(IConfigRegistry configRegistry) {
        IStyle columnHeaderStyle = getColumnHeaderStyle();
        if (!isStyleEmpty(columnHeaderStyle)) {
            // register column header cell style in normal mode
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, columnHeaderStyle,
                    DisplayMode.NORMAL, GridRegion.COLUMN_HEADER);
View Full Code Here

     * @param configRegistry
     *            The IConfigRegistry that is used by the NatTable instance to
     *            which the style configuration should be applied to.
     */
    protected void configureRowHeaderStyle(IConfigRegistry configRegistry) {
        IStyle rowHeaderStyle = getRowHeaderStyle();
        if (!isStyleEmpty(rowHeaderStyle)) {
            // register row header cell style in normal mode
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, rowHeaderStyle,
                    DisplayMode.NORMAL, GridRegion.ROW_HEADER);
View Full Code Here

     * @param configRegistry
     *            The IConfigRegistry that is used by the NatTable instance to
     *            which the style configuration should be applied to.
     */
    protected void configureCornerStyle(IConfigRegistry configRegistry) {
        IStyle cornerStyle = this.styleCornerLikeColumnHeader ? getColumnHeaderStyle()
                : getCornerStyle();
        if (!isStyleEmpty(cornerStyle)) {
            // register corner cell style in normal mode
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, cornerStyle,
View Full Code Here

    private void verifyFontAttributes() {
        // Check cell font attributes
        ILayerCell cell = natTable.getCellByPosition(2, 2);
        final FontData expectedFontData = defaultFont.getFontData()[0];
        IStyle cellStyle = configRegistry.getConfigAttribute(
                CellConfigAttributes.CELL_STYLE, cell.getDisplayMode(), cell
                        .getConfigLabels().getLabels());
        final FontData actualFontData = cellStyle.getAttributeValue(
                CellStyleAttributes.FONT).getFontData()[0];
        Assert.assertEquals(actualFontData.getName(),
                expectedFontData.getName());
        Assert.assertEquals(actualFontData.getHeight(),
                expectedFontData.getHeight());
View Full Code Here

     * @param configRegistry
     *            The IConfigRegistry that is used by the NatTable instance to
     *            which the style configuration should be applied to.
     */
    protected void configureHoverStyle(IConfigRegistry configRegistry) {
        IStyle defaultHoverStyle = getDefaultHoverStyle();
        if (!isStyleEmpty(defaultHoverStyle)) {
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, defaultHoverStyle,
                    DisplayMode.HOVER);
        }
        ICellPainter defaultHoverCellPainter = getDefaultHoverCellPainter();
        if (defaultHoverCellPainter != null) {
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_PAINTER, defaultHoverCellPainter,
                    DisplayMode.HOVER);
        }

        IStyle bodyHoverStyle = getBodyHoverStyle();
        if (!isStyleEmpty(bodyHoverStyle)) {
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, bodyHoverStyle,
                    DisplayMode.HOVER, GridRegion.BODY);
        }
        ICellPainter bodyHoverCellPainter = getBodyHoverCellPainter();
        if (bodyHoverCellPainter != null) {
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_PAINTER, bodyHoverCellPainter,
                    DisplayMode.HOVER, GridRegion.BODY);
        }

        IStyle columnHeaderHoverStyle = getColumnHeaderHoverStyle();
        if (!isStyleEmpty(columnHeaderHoverStyle)) {
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, columnHeaderHoverStyle,
                    DisplayMode.HOVER, GridRegion.COLUMN_HEADER);
        }
        ICellPainter columnHeaderHoverCellPainter = getColumnHeaderHoverCellPainter();
        if (columnHeaderHoverCellPainter != null) {
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_PAINTER,
                    columnHeaderHoverCellPainter, DisplayMode.HOVER,
                    GridRegion.COLUMN_HEADER);
        }

        IStyle rowHeaderHoverStyle = getRowHeaderHoverStyle();
        if (!isStyleEmpty(rowHeaderHoverStyle)) {
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, rowHeaderHoverStyle,
                    DisplayMode.HOVER, GridRegion.ROW_HEADER);
        }
View Full Code Here

     * @param configRegistry
     *            The IConfigRegistry that is used by the NatTable instance to
     *            which the style configuration should be applied to.
     */
    protected void configureHoverSelectionStyle(IConfigRegistry configRegistry) {
        IStyle defaultHoverStyle = getDefaultHoverSelectionStyle();
        if (!isStyleEmpty(defaultHoverStyle)) {
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, defaultHoverStyle,
                    DisplayMode.SELECT_HOVER);
        }
        ICellPainter defaultHoverCellPainter = getDefaultHoverSelectionCellPainter();
        if (defaultHoverCellPainter != null) {
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_PAINTER, defaultHoverCellPainter,
                    DisplayMode.SELECT_HOVER);
        }

        IStyle bodyHoverStyle = getBodyHoverSelectionStyle();
        if (!isStyleEmpty(bodyHoverStyle)) {
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, bodyHoverStyle,
                    DisplayMode.SELECT_HOVER, GridRegion.BODY);
        }
        ICellPainter bodyHoverCellPainter = getBodyHoverSelectionCellPainter();
        if (bodyHoverCellPainter != null) {
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_PAINTER, bodyHoverCellPainter,
                    DisplayMode.SELECT_HOVER, GridRegion.BODY);
        }

        IStyle columnHeaderHoverStyle = getColumnHeaderHoverSelectionStyle();
        if (!isStyleEmpty(columnHeaderHoverStyle)) {
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, columnHeaderHoverStyle,
                    DisplayMode.SELECT_HOVER, GridRegion.COLUMN_HEADER);
        }
        ICellPainter columnHeaderHoverCellPainter = getColumnHeaderHoverSelectionCellPainter();
        if (columnHeaderHoverCellPainter != null) {
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_PAINTER,
                    columnHeaderHoverCellPainter, DisplayMode.SELECT_HOVER,
                    GridRegion.COLUMN_HEADER);
        }

        IStyle rowHeaderHoverStyle = getRowHeaderHoverSelectionStyle();
        if (!isStyleEmpty(rowHeaderHoverStyle)) {
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, rowHeaderHoverStyle,
                    DisplayMode.SELECT_HOVER, GridRegion.ROW_HEADER);
        }
View Full Code Here

TOP

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

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.