Package org.eclipse.jst.pagedesigner.css2.property

Examples of org.eclipse.jst.pagedesigner.css2.property.CounterResetMeta


  /**
   * @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

      if (handler instanceof HiddenFigureHandler) {
        // for deep hidden element, we don't create figure for them.
        // this will remove the small <> icon for data window.
        return;
      }
      CSSFigure figure = new CSSFigure();
      handler.updateFigure((Element) node, figure);
      // IFigure figure = handler.createFigure((Element) node);
      parentFigure.add(figure);
      if (!handler.isWidget()) {
        NodeList children = node.getChildNodes();
View Full Code Here

    // {
    // CSSWidgetFigure figure = new CSSWidgetFigure(this._elementNode,
    // createHiddenProvider());
    // return figure;
    // }
    return new CSSFigure();
  }
View Full Code Here

   */
  private boolean shouldUseObjectMode(Point location) {
    // when the location is close to the border/padding of the element, then
    // we think it is default to
    // object mode selection.
    CSSFigure figure = (CSSFigure) this.getHostFigure();
    if (figure.getFragmentsBounds().length != 1) {
      return false;
    }
    Rectangle bounds = figure.getBounds().getCopy();
    Insets insets = figure.getInsets();
    bounds.crop(insets);
    if (insets.top > THRESHHOLD && insets.left > THRESHHOLD
        && insets.right > THRESHHOLD && insets.bottom > THRESHHOLD) {
      return !bounds.contains(location);
    }
View Full Code Here

    // 2. Those element that is rectangle but not resizable.
    // 3. Those element that is not rectangle (fragments)

    IFigure figure = this.getHostFigure();
    if (figure instanceof CSSFigure && getHost() instanceof ElementEditPart) {
      CSSFigure cssfigure = (CSSFigure) figure;
      List fragments = cssfigure.getFragmentsForRead();

      // XXX: only one fragment and is blockbox, then we think it is
      // resizable by figure
      // should move this test to somewhere else.
      if (fragments != null && fragments.size() == 1
View Full Code Here

    // element. And if the element's
    // width/height style setting don't include border padding, then we need
    // to set the element's width/height
    // style property a little smaller.
    if (part.getFigure() instanceof CSSFigure) {
      CSSFigure cssfigure = (CSSFigure) part.getFigure();
      ICSSStyle style = cssfigure.getCSSStyle();
      if (style != null && !style.isSizeIncludeBorderPadding()) {
        width -= (style.getBorderInsets().getWidth() + style
            .getPaddingInsets().getWidth());
        height -= (style.getBorderInsets().getHeight() + style
            .getPaddingInsets().getHeight());
View Full Code Here

      if (data.trim().length() == 0) {
        return;
      }
      // XXX: currently creating of CSSTextFigure is distributed both here
      // and TextEditPart. We may want to unify them later.
      CSSTextFigure figure = new CSSTextFigure(new ICSSTextProvider() {
        /*
         * (non-Javadoc)
         *
         * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSTextProvider#getCSSStyle()
         */
 
View Full Code Here

      if (position == null || !position.isValid()) {
        return null;
      }
      EditPart containerEditPart = position.getContainerPart();
      if (containerEditPart instanceof TextEditPart) {
        CSSTextFigure figure = (CSSTextFigure) ((TextEditPart) containerEditPart)
            .getFigure();
        ret = figure.calculateCaretPosition(position.getOffset());
        figure.translateToAbsolute(ret);
        ret.width = CaretUpdater.CARET_WIDTH;
      } else {
        int offset = position.getOffset();
        // there is no child
        if (containerEditPart.getChildren().isEmpty()
            || LayoutPart.getConcretePart(containerEditPart) == null) {
          IFigure figure = ((GraphicalEditPart) containerEditPart)
              .getFigure();
          Rectangle bounds = figure.getBounds();
          if (figure instanceof CSSFigure) {
            List fragments = ((CSSFigure) figure)
                .getFragmentsForRead();
            if (fragments.size() > 0) {
              FlowBox box = (FlowBox) fragments.get(fragments
                  .size() - 1);
              bounds = LayoutPart.getBounds(box);
            }
          }

          ret = new Rectangle(bounds.x + CARET_OFFSET, bounds.y,
              CaretUpdater.CARET_WIDTH, bounds.height);

          figure.translateToAbsolute(ret);
        } else if (offset >= 0
            && offset <= containerEditPart.getChildren().size()) {
          ret = getRefRect(position);
        }
      }
View Full Code Here

TOP

Related Classes of org.eclipse.jst.pagedesigner.css2.property.CounterResetMeta

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.