Examples of IStyle


Examples of org.eclipse.birt.report.engine.content.IStyle

        while (yi <= coords.y2) {
            xi = coords.x1;
            while (xi <= coords.x2) {
                cell = sheet.getCell(yi, xi, false);
                if (cell == defaultCell) {
                    IStyle newStyle = null;

                    // update edge cell of an element
                    if (xi != coords.x1) {
                        if (newStyle == null) {
                            newStyle = StyleImpl.create(style);
                        }

                        // set directly for optimization
                        newStyle.setProperty(StyleConstants.STYLE_BORDER_LEFT_STYLE,
                                CSSValueConstants.NONE_VALUE);
                    }
                    if (xi != coords.x2) {
                        if (newStyle == null) {
                            newStyle = StyleImpl.create(style);
                        }
                        newStyle.setProperty(StyleConstants.STYLE_BORDER_RIGHT_STYLE,
                                CSSValueConstants.NONE_VALUE);
                    }
                    if (yi != coords.y1) {
                        if (newStyle == null) {
                            newStyle = StyleImpl.create(style);
                        }
                        newStyle.setProperty(StyleConstants.STYLE_BORDER_TOP_STYLE,
                                CSSValueConstants.NONE_VALUE);
                    }
                    if (yi != coords.y2) {
                        if (newStyle == null) {
                            newStyle = StyleImpl.create(style);
                        }
                        newStyle.setProperty(StyleConstants.STYLE_BORDER_BOTTOM_STYLE,
                                CSSValueConstants.NONE_VALUE);
                    }

                    sheet.setCell(yi, xi, null, newStyle != null ? newStyle
                            : style);
View Full Code Here

Examples of org.eclipse.birt.report.engine.content.IStyle

        yi = coords.y1;
        while (yi <= coords.y2) {
            xi = coords.x1;
            while (xi <= coords.x2) {
                IStyle newStyle = null;

                // update edge cell of an element
                if (xi != coords.x1) {
                    if (newStyle == null) {
                        newStyle = StyleImpl.create(style);
                    }

                    // set directly for optimization
                    newStyle.setProperty(StyleConstants.STYLE_BORDER_LEFT_STYLE,
                            CSSValueConstants.NONE_VALUE);
                }
                if (xi != coords.x2) {
                    if (newStyle == null) {
                        newStyle = StyleImpl.create(style);
                    }
                    newStyle.setProperty(StyleConstants.STYLE_BORDER_RIGHT_STYLE,
                            CSSValueConstants.NONE_VALUE);
                }
                if (yi != coords.y1) {
                    if (newStyle == null) {
                        newStyle = StyleImpl.create(style);
                    }
                    newStyle.setProperty(StyleConstants.STYLE_BORDER_TOP_STYLE,
                            CSSValueConstants.NONE_VALUE);
                }
                if (yi != coords.y2) {
                    if (newStyle == null) {
                        newStyle = StyleImpl.create(style);
                    }
                    newStyle.setProperty(StyleConstants.STYLE_BORDER_BOTTOM_STYLE,
                            CSSValueConstants.NONE_VALUE);
                }

                sheet.setCell(yi, xi, null, newStyle != null ? newStyle
                        : style);
View Full Code Here

Examples of org.eclipse.birt.report.engine.content.IStyle

    private void layoutChildren(List<Integer> xCuts, List<Integer> yCuts,
            Sheet sheet, Cell defaultCell, Frame parentElement,
            IStyle currentStyle, int xOffset, int yOffset) {
        Frame element = null;
        Coordinate coord = null;
        IStyle style = null;

        for (Iterator<Frame> it = parentElement.iterator(); it.hasNext();) {
            element = it.next();

            coord = getElementCoords(xCuts,
View Full Code Here

Examples of org.eclipse.e4.xwt.IStyle

            }
            if (keyAttribute != null) {
              dico.put(keyAttribute.getContent(), doCreate);
            }
            if (doCreate instanceof IStyle) {
              IStyle style = (IStyle) doCreate;
              loadData.addStyle(style);
            }
          }
        }
      }

      // apply the styles defined in parent's resources via TargetType
      Widget current = widget;
      while (current != null) {
        dico = UserData.getLocalResources(current);
        if (dico != null) {
          for (Object value : dico.values()) {
            if (value instanceof Style) {
              Style style = (Style) value;
              Class<?> targetType = style.getTargetType();
              if (targetType != null
                  && targetType.isInstance(widget)) {
                style.apply(targetObject);
              }
            }
          }
        }
        current = UserData.getParent(current);
      }
    }

    for (IStyle style : loadData.getStyles()) {
      style.applyStyle(targetObject);
    }
  }
View Full Code Here

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

                CellConfigAttributes.DISPLAY_CONVERTER,
                new DefaultDateDisplayConverter(), DisplayMode.EDIT,
                CrossValidationGridExample.DATE_LABEL);

        // configure the validation error style
        IStyle validationErrorStyle = new Style();
        validationErrorStyle.setAttributeValue(
                CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_RED);
        validationErrorStyle.setAttributeValue(
                CellStyleAttributes.FOREGROUND_COLOR, GUIHelper.COLOR_WHITE);

        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
                validationErrorStyle, DisplayMode.NORMAL,
                CrossValidationGridExample.INVALID_LABEL);
View Full Code Here

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

        // Draw background
        gc.fillRectangle(bounds);

        groupByCellBounds.clear();

        IStyle cellStyle = CellStyleUtil.getCellStyle(cell, configRegistry);
        gc.setBackground(cellStyle
                .getAttributeValue(CellStyleAttributes.BACKGROUND_COLOR));
        gc.setForeground(cellStyle
                .getAttributeValue(CellStyleAttributes.FOREGROUND_COLOR));
        gc.setFont(cellStyle.getAttributeValue(CellStyleAttributes.FONT));
        gc.setAntialias(GUIHelper.DEFAULT_ANTIALIAS);
        gc.setTextAntialias(GUIHelper.DEFAULT_TEXT_ANTIALIAS);

        List<Integer> groupByColumnIndexes = groupByModel
                .getGroupByColumnIndexes();
        if (groupByColumnIndexes.size() > 0) {

            int textHeight = gc.textExtent("X").y; //$NON-NLS-1$

            int x0 = bounds.x + LEFT_INDENT;
            int y0 = bounds.y + bounds.height / 2 - textHeight / 2 - Y_PADDING;
            int y_height = Y_PADDING + textHeight + Y_PADDING;

            // Draw leftmost edge
            gc.drawLine(x0, y0, x0, y0 + y_height);
            x0++;

            // Draw group by columns
            int lastColumnIndex = groupByColumnIndexes.size() - 1;
            for (int i = 0; i <= lastColumnIndex; i++) {
                int columnIndex = groupByColumnIndexes.get(i);

                String columnName = (String) columnHeaderDataProvider
                        .getDataValue(columnIndex, 0);
                int textWidth = gc.textExtent(columnName).x;

                groupByCellBounds.add(new Rectangle(x0, y0, X_PADDING
                        + textWidth + X_PADDING, y_height));

                gc.fillRectangle(x0, y0, X_PADDING + textWidth + X_PADDING,
                        y_height);
                gc.drawLine(x0, y0, x0 + X_PADDING + textWidth + X_PADDING, y0);
                gc.drawLine(x0, y0 + y_height, x0 + X_PADDING + textWidth
                        + X_PADDING, y0 + y_height);

                gc.drawText(columnName, x0 + X_PADDING, y0 + Y_PADDING);

                x0 += X_PADDING + textWidth + X_PADDING;

                // Draw end cap
                if (i < lastColumnIndex) {
                    gc.fillRectangle(x0, y0, ENDCAP_WIDTH, y_height);
                    gc.drawLine(x0, y0, x0 + ENDCAP_WIDTH, y0);
                    gc.drawLine(x0, y0 + y_height, x0 + ENDCAP_WIDTH, y0
                            + y_height);
                } else {
                    gc.fillPolygon(new int[] { x0, y0, x0 + ENDCAP_WIDTH,
                            y0 + y_height / 2, x0, y0 + y_height });
                }
                gc.drawLine(x0, y0, x0 + ENDCAP_WIDTH - 1, y0 + y_height / 2);
                gc.drawLine(x0, y0 + y_height, x0 + ENDCAP_WIDTH - 1, y0
                        + y_height / 2);

                x0 += ENDCAP_WIDTH;
            }
        } else {
            // if no grouping is applied and a hint is specified via
            // configuration, the hint is rendered
            String hint = configRegistry.getConfigAttribute(
                    GroupByConfigAttributes.GROUP_BY_HINT, DisplayMode.NORMAL);
            if (hint != null) {
                // check if there is a separate styling configured for the hint
                IStyle hintStyle = configRegistry.getConfigAttribute(
                        GroupByConfigAttributes.GROUP_BY_HINT_STYLE,
                        DisplayMode.NORMAL);
                if (hintStyle != null) {
                    Color hintBackground = hintStyle
                            .getAttributeValue(CellStyleAttributes.BACKGROUND_COLOR);
                    gc.setBackground(hintBackground != null ? hintBackground
                            : originalBackground);
                    Color hintForeground = hintStyle
                            .getAttributeValue(CellStyleAttributes.FOREGROUND_COLOR);
                    if (hintForeground != null)
                        gc.setForeground(hintForeground);
                    Font hintFont = hintStyle
                            .getAttributeValue(CellStyleAttributes.FONT);
                    if (hintFont != null)
                        gc.setFont(hintFont);
                } else {
                    // ensure the background is the same as the background of
View Full Code Here

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

        return this.sortHeaderCellPainter;
    }

    @Override
    protected IStyle getSelectedSortHeaderStyle() {
        IStyle cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                selectedSortHeaderBgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                selectedSortHeaderFgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
                selectedSortHeaderGradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
                selectedSortHeaderGradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                selectedSortHeaderHAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                selectedSortHeaderVAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT,
                selectedSortHeaderFont);
        cellStyle.setAttributeValue(CellStyleAttributes.IMAGE,
                selectedSortHeaderImage);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                selectedSortHeaderBorderStyle);
        cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR,
                selectedSortHeaderPWEchoChar);
        cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION,
                selectedSortHeaderTextDecoration);
        return cellStyle;
    }
View Full Code Here

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

        return this.selectedSortHeaderCellPainter;
    }

    @Override
    protected IStyle getFilterRowStyle() {
        IStyle cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                filterRowBgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                filterRowFgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
                filterRowGradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
                filterRowGradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                filterRowHAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                filterRowVAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT, filterRowFont);
        cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, filterRowImage);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                filterRowBorderStyle);
        cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR,
                filterRowPWEchoChar);
        cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION,
                filterRowTextDecoration);
        return cellStyle;
    }
View Full Code Here

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

        return this.filterRowCellPainter;
    }

    @Override
    protected IStyle getTreeStyle() {
        IStyle cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                treeBgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                treeFgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
                treeGradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
                treeGradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                treeHAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                treeVAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT, treeFont);
        cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, treeImage);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                treeBorderStyle);
        cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR,
                treePWEchoChar);
        cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION,
                treeTextDecoration);
        return cellStyle;
    }
View Full Code Here

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

        return this.treeCellPainter;
    }

    @Override
    protected IStyle getTreeSelectionStyle() {
        IStyle cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                treeSelectionBgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                treeSelectionFgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
                treeSelectionGradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
                treeSelectionGradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                treeSelectionHAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                treeSelectionVAlign);
        cellStyle
                .setAttributeValue(CellStyleAttributes.FONT, treeSelectionFont);
        cellStyle.setAttributeValue(CellStyleAttributes.IMAGE,
                treeSelectionImage);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                treeSelectionBorderStyle);
        cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR,
                treeSelectionPWEchoChar);
        cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION,
                treeSelectionTextDecoration);
        return cellStyle;
    }
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.