Package org.eclipse.jst.pagedesigner.css2

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


   * calculation is looped.
   */
  public Integer getCount(Object oCaller) {
    Assert.isTrue(oCaller instanceof ICSSStyle && _visitors != null
        && _visitors.size() > 0);
    ICSSStyle caller = (ICSSStyle) oCaller;
    if (!_visitors.contains(caller)) {
      return null;
    }
    int result = getInitial();

    for (int i = 0, n = _visitors.size(); i < n; i++) {
      ICSSStyle style = (ICSSStyle) _visitors.get(i);
      // get the count;
      Object counterIncrements = style
          .getStyleProperty(ICSSPropertyID.ATTR_COUNTER_INCREMENT);
      if (counterIncrements != null
          && counterIncrements != ICSSPropertyMeta.NOT_SPECIFIED) {
        if (counterIncrements instanceof List) {
          List crList = (List) counterIncrements;
View Full Code Here


    List children = getFigure().getChildren();
    for (int i = 0, size = children.size(); i < size; i++) {
      IFigure childfigure = (IFigure) children.get(i);
      if (childfigure instanceof ICSSFigure) {
        ICSSStyle childstyle = ((ICSSFigure) childfigure).getCSSStyle();
        if (childstyle != null) {
          String display = childstyle.getDisplay();
          if ("table-cell".equalsIgnoreCase(display)) { //$NON-NLS-1$
            TableCellInfo cellInfo = new TableCellInfo(
                (ICSSFigure) childfigure);
            cellInfo.calculateCellInfo(context);
            _cells.add(cellInfo);
View Full Code Here

  /**
   * @param info
   * @param tableHeight
   */
  public void calculateHeight(TableInfo info, int tableHeight) {
    ICSSStyle style = this.getFigure().getCSSStyle();
    if (style == null) {
      this._rowHeight = -1;
    } else {
      Object height = style.getStyleProperty(ICSSPropertyID.ATTR_HEIGHT);
      Length recommendedHeight = (height instanceof Length) ? (Length) height
          : null;

      int rh = 0;
      if (recommendedHeight == null || recommendedHeight.getValue() <= 0) {
        rh = 0;
      } else {
        if (recommendedHeight.isPercentage()) {
          // not supported.
        } else {
          rh = recommendedHeight.getValue();
        }
        if (rh > 0 && !style.isSizeIncludeBorderPadding()) {
          rh += style.getBorderInsets().getHeight()
              + style.getPaddingInsets().getHeight();
        }
      }
      this._rowHeight = rh;
    }

View Full Code Here

      else {
        //fix for bug #221629 - BEGIN
        boolean useShouldTrimLeadingWSInlineMethod = false;
        IFigure parentFigure = flowFigure.getParent();
        if (parentFigure instanceof CSSFigure) {
          ICSSStyle style = ((CSSFigure)parentFigure).getCSSStyle();
          if (style instanceof AbstractStyle) {
            Element element = ((AbstractStyle)style).getElement();
            if (element != null &&
                element.getNodeName().equals(IHTMLConstants.TAG_SPAN)) {
              useShouldTrimLeadingWSInlineMethod = true;
View Full Code Here

  /**
   * @return true if is absolute position
   */
  protected final boolean isAbsolutePosition() {
    ICSSStyle style = getCSSStyle();

    // FIXME: Some layout don't support absolute, need check here
    if (style != null) {
      Object obj = style.getStyleProperty(ICSSPropertyID.ATTR_POSITION);
      if (PositionMeta.ABSOLUTE.equals(obj)
          || PositionMeta.FIXED.equals(obj))
      {
          PDPreferences prefs = new PDPreferences();
          return prefs.isCssAbsolutePositioningEnabled();
View Full Code Here

  /**
   * Perform a prelayout
   */
  protected void preLayout() {
    ICSSStyle style = this.getCSSStyle();
    if (style != null) {
      style.processCounters();
    }

    if (isAbsolutePosition()) {
      FlowContext parentFigureContext = getParentFigureContext();
      _absoluteContext = new BlockFlowContext(parentFigureContext, style);
View Full Code Here

    return super.getFlowContext();
  }

  final void postValidateForAbsolute() {
    if (_absoluteContext != null) {
      ICSSStyle style = this.getCSSStyle();

      _absoluteContext.endBlock();

      int xOffset;
      int yOffset;
View Full Code Here

  /**
   * @param figure
   * @return the CSS layout for fixed layout
   */
  protected CSSLayout getFixedCSSLayout(CSSFigure figure) {
    return new CSSBrFlowLayout(figure);
  }
View Full Code Here

    this.translateToRelative(bounds);
    this.setBounds(bounds);

    this.removeAll();
    // ok, recreate all children.
    CSSFigure cssfigure = (CSSFigure) getOwner().getFigure();
    List fragments = cssfigure.getFragmentsForRead();
    for (int i = 0, size = fragments.size(); i < size; i++) {
      // the rectangle.
      Figure childFigure = new BorderFigure();
      childFigure.setBorder(new LineBorder(1));
      this.add(childFigure);

      FlowBox box = (FlowBox) fragments.get(i);
      Rectangle rect = new Rectangle(box.getX(), box.getY(), box.getWidth(), box
          .getHeight());
      cssfigure.translateToAbsolute(rect);

      childFigure.translateToRelative(rect);
      childFigure.setBounds(rect);

      createCornerHandles(cssfigure, box);
View Full Code Here

        if (editPart.getParent() != null) {
            IFigure figure = ((GraphicalEditPart) editPart.getParent())
                    .getFigure();
            if (figure instanceof CSSFigure) {
                CSSFigure cssFigure = (CSSFigure) figure;
                LayoutManager layoutManager = cssFigure.getLayoutManager();
                if (layoutManager instanceof CSSTableLayout2) {
                    CSSTableLayout2 tableLayout = (CSSTableLayout2) layoutManager;
                    bounds.y = tableLayout.getHSpacing();
                    bounds.height = figure.getClientArea().height
                            - tableLayout.getHSpacing() * 2;
 
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.