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

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


    /**
     * @return The {@link IStyle} that should be used to render the GroupBy
     *         hint.
     */
    protected IStyle getGroupByHintStyle() {
        IStyle cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                groupByHintBgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                groupByHintFgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
                groupByHintGradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
                groupByHintGradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                groupByHintHAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                groupByHintVAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT, groupByHintFont);
        cellStyle
                .setAttributeValue(CellStyleAttributes.IMAGE, groupByHintImage);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                groupByHintBorderStyle);
        cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR,
                groupByHintPWEchoChar);
        cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION,
                groupByHintTextDecoration);
        return cellStyle;
    }
View Full Code Here


    public void configureLayer(ILayer layer) {}

    @Override
    public void configureRegistry(IConfigRegistry configRegistry) {
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
                new Style() {
                    {
                        setAttributeValue(
                                CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                                HorizontalAlignmentEnum.LEFT);
                    }
View Full Code Here

        columnLabelAccumulator.accumulateConfigLabels(configLabels,
                columnIndexOfClick, 0);
        configLabels.addLabel(getConfigLabel(columnIndexOfClick));

        // Column style
        Style clickedCellStyle = (Style) configRegistry.getConfigAttribute(
                CELL_STYLE, NORMAL, configLabels.getLabels());

        dialog = new ColumnStyleEditorDialog(Display.getCurrent()
                .getActiveShell(), clickedCellStyle);
        dialog.open();
View Full Code Here

    }

    protected void applySelectedStyleToColumns(
            DisplayColumnStyleEditorCommand command, int[] columnIndeces) {
        // Read the edited styles
        Style newColumnCellStyle = dialog.getNewColumnCellStyle();

        for (int i = 0; i < columnIndeces.length; i++) {
            final int columnIndex = columnIndeces[i];

            String configLabel = getConfigLabel(columnIndex);
View Full Code Here

        }
    }

    protected void applySelectedStyle() {
        // Read the edited styles
        Style newColumnCellStyle = dialog.getNewColumnCellStyle();

        applySelectedStyle(newColumnCellStyle, USER_EDITED_STYLE_LABEL);

        if (newColumnCellStyle != null) {
            columnLabelAccumulator
View Full Code Here

                    int colIndex = parseColumnIndexFromKey(keyString);

                    // Has the config label been processed
                    String configLabel = getConfigLabel(colIndex);
                    if (!stylesToPersist.keySet().contains(configLabel)) {
                        Style savedStyle = StylePersistor.loadStyle(prefix
                                + DOT + configLabel, properties);

                        configRegistry.registerConfigAttribute(CELL_STYLE,
                                savedStyle, NORMAL, configLabel);
                        stylesToPersist.put(configLabel, savedStyle);
                        columnLabelAccumulator.registerColumnOverrides(
                                colIndex, configLabel);
                    }
                } else {
                    // Has the config label been processed
                    if (!stylesToPersist.keySet().contains(
                            USER_EDITED_STYLE_LABEL)) {
                        Style savedStyle = StylePersistor.loadStyle(prefix
                                + DOT + USER_EDITED_STYLE_LABEL, properties);

                        configRegistry.registerConfigAttribute(CELL_STYLE,
                                savedStyle, NORMAL, USER_EDITED_STYLE_LABEL);
                        stylesToPersist
View Full Code Here

    @Override
    public void saveState(String prefix, Properties properties) {
        prefix = prefix + DOT + PERSISTENCE_PREFIX;

        for (Map.Entry<String, Style> labelToStyle : stylesToPersist.entrySet()) {
            Style style = labelToStyle.getValue();
            String label = labelToStyle.getKey();

            StylePersistor.saveStyle(prefix + DOT + label, properties, style);
        }
    }
View Full Code Here

        configRegistry.registerConfigAttribute(
                CellConfigAttributes.RENDER_GRID_LINES, renderGridLines,
                DisplayMode.NORMAL, GridRegion.CORNER);

        // configure the normal style
        Style cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                bgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                fgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, gradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, gradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                hAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                vAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                borderStyle);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT, font);

        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
                cellStyle, DisplayMode.NORMAL, GridRegion.COLUMN_HEADER);
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
                cellStyle, DisplayMode.NORMAL, GridRegion.CORNER);
View Full Code Here

        configureRowHeaderCellPainter(configRegistry);
        configureRowHeaderStyle(configRegistry);
    }

    protected void configureRowHeaderStyle(IConfigRegistry configRegistry) {
        Style cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                bgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                fgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, gradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, gradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                hAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                vAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                borderStyle);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT, font);

        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
                cellStyle, DisplayMode.NORMAL, GridRegion.ROW_HEADER);
    }
View Full Code Here

            configRegistry.registerConfigAttribute(
                    EditConfigAttributes.OPEN_IN_DIALOG, Boolean.TRUE,
                    DisplayMode.EDIT,
                    _804_GlazedListsEditorExample.COLUMN_FOUR_LABEL);

            Style cellStyle = new Style();
            cellStyle.setAttributeValue(
                    CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                    HorizontalAlignmentEnum.LEFT);
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, cellStyle,
                    DisplayMode.NORMAL,
View Full Code Here

TOP

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

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.