Package org.eclipse.jst.pagedesigner.css2

Examples of org.eclipse.jst.pagedesigner.css2.ICSSStyle


  /**
   * @param g
   */
  protected void paintSelection(Graphics g) {
    ICSSStyle style = this.getCSSStyle();
    if (style != null) {
      if (style.isInSelection()) {
        ITagEditInfo editInfo = (ITagEditInfo) style
            .getAdapter(ITagEditInfo.class);
        if (editInfo != null && editInfo.isWidget()) {
          BorderUtil.maskFigure(this, g);
        }
      }
View Full Code Here


    CSSLayout layout = (CSSLayout) getLayoutManager();
    if (layout != null && !layout.handlingBorderForBlock()) {
      return;
    }

    ICSSStyle style = this.getCSSStyle();
    if (style != null) {
      CSSBorder border1 = new CSSBorder(this.getCSSStyle());
      border1.paint(this, graphics, NO_INSETS);

      // draw a border for those special elements like <h:form>, etc.
      ITagEditInfo editInfo = (ITagEditInfo) style
          .getAdapter(ITagEditInfo.class);
      if (editInfo != null && editInfo.needBorderDecorator()) {
        BorderUtil.drawBorderDecorator(this, graphics);
      }
    }
View Full Code Here

  public Insets getInsets() {
    CSSLayout layout = (CSSLayout) getLayoutManager();
    if (layout != null && !layout.handlingBorderForBlock()) {
      return new Insets();
    }
    ICSSStyle style = this.getCSSStyle();
    if (style != null) {
      return style.getBorderInsets().getAdded(style.getPaddingInsets());
    }
    return new Insets();
  }
View Full Code Here

    void constructTable() {
    List child = getFigure().getChildren();
    for (int i = 0, size = child.size(); i < size; i++) {
      IFigure childfigure = (IFigure) child.get(i);
      if (childfigure instanceof ICSSFigure) {
        ICSSStyle style = ((ICSSFigure) childfigure).getCSSStyle();
        if (style != null) {
          String display = style.getDisplay();
          if ("table-caption".equalsIgnoreCase(display)) //$NON-NLS-1$
          {
            _caption = new TableCaptionInfo(
                (ICSSFigure) childfigure);
          } else if ("table-row".equalsIgnoreCase(display)) //$NON-NLS-1$
View Full Code Here

  private int getDefaultWidth() {
    int textareaWidth;
    if (this._longestString == null || this._longestString.length() == 0) {
      textareaWidth = 20;
    } else {
      ICSSStyle style = this.getCSSStyle();
      if (style == null) {
        style = DefaultStyle.getInstance();
      }
      ICSSFont font = style.getCSSFont();

      textareaWidth = FigureUtilities.getTextWidth(_longestString, font
          .getSwtFont());
    }
    return textareaWidth + ARRAWWIDTH + HORIZONTAL_PADDING;
View Full Code Here

   *
   * @return the default height
   * @see TextInputWidgetProvider#getDefaultHeight()
   */
  public int getDefaultHeight() {
    ICSSStyle style = this.getCSSStyle();
    if (style == null) {
      style = DefaultStyle.getInstance();
    }
    ICSSFont font = style.getCSSFont();
    Font swtfont = font.getSwtFont();
    int fontSize = FigureUtilities.getFontMetrics(swtfont).getHeight();
    return fontSize + VERTICAL_PADDING;
  }
View Full Code Here

   * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#paintFigure(org.eclipse.draw2d.Graphics,
   *      org.eclipse.draw2d.geometry.Rectangle)
   */
  public void paintFigure(Graphics g, Rectangle rect) {
    if (this._firstString != null) {
      ICSSStyle style = this.getCSSStyle();
      if (style == null) {
        style = DefaultStyle.getInstance();
      }
      ICSSFont font = style.getCSSFont();
      g.setFont(font.getSwtFont());

      Color newColor = null;
      Object color = style.getColor();
      if (color instanceof Color) {
        g.setForegroundColor((Color) color);
      } else if (color instanceof RGB) {
        newColor = new Color(Display.getCurrent(), (RGB) color);
        g.setForegroundColor(newColor);
View Full Code Here

   * @return the default width value
   */
  public int getDefaultWidth() {
    int longestStringWidth = 0;
    if (_lines != null) {
      ICSSStyle style = this.getCSSStyle();
      if (style == null) {
        style = DefaultStyle.getInstance();
      }
      ICSSFont font = style.getCSSFont();
      Font swtFont = font.getSwtFont();
      for (int i = 0; i < _lines.length; i++) {
        int width = FigureUtilities.getTextWidth(_lines[i], swtFont);
        if (width > longestStringWidth) {
          longestStringWidth = width;
View Full Code Here

   *
   * @return the default height value
   * @see TextInputWidgetProvider#getDefaultHeight()
   */
  public int getDefaultHeight() {
    ICSSStyle style = this.getCSSStyle();
    if (style == null) {
      style = DefaultStyle.getInstance();
    }
    ICSSFont font = style.getCSSFont();
    Font swtfont = font.getSwtFont();
    int fontHeight = FigureUtilities.getFontMetrics(swtfont).getHeight();
    return (int) ((fontHeight) * (_lines.length + VERTICAL_PADDING_RATE));
  }
View Full Code Here

   *
   * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#paintFigure(org.eclipse.draw2d.Graphics,
   *      org.eclipse.draw2d.geometry.Rectangle)
   */
  public void paintFigure(Graphics g, Rectangle rect) {
    ICSSStyle style = this.getCSSStyle();
    if (style == null) {
      style = DefaultStyle.getInstance();
    }
    Object textAlign = style
        .getStyleProperty(ICSSPropertyID.ATTR_TEXTALIGN);
    if (ICSSPropertyMeta.NOT_SPECIFIED == textAlign) {
      textAlign = "center"; //$NON-NLS-1$
    }
    Font font = style.getCSSFont().getSwtFont();
    g.setFont(font);
    int fontHeight = FigureUtilities.getFontMetrics(font).getHeight();

    Color newColor = null;
    Object color = style.getColor();
    if (color instanceof Color) {
      g.setForegroundColor((Color) color);
    } else if (color instanceof RGB) {
      newColor = new Color(Display.getCurrent(), (RGB) color);
      g.setForegroundColor(newColor);
View Full Code Here

TOP

Related Classes of org.eclipse.jst.pagedesigner.css2.ICSSStyle

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.