Package org.eclipse.jst.pagedesigner.css2.provider

Examples of org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo


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

   * @return
   */
  private static DesignPosition findTextEditPartPosition(TextEditPart host,
      Point p) {
    if (host.getFigure() instanceof CSSTextFigure) {
      CSSTextFigure figure = (CSSTextFigure) host.getFigure();
      // make a copy to not destroy the original o
      p = p.getCopy();
      figure.translateToRelative(p);
      int offset = figure.getInsertionOffset(p);
      if (offset >= 0) {
        return new DesignPosition(host, offset);
      }
            return null;
    }
View Full Code Here

  }

  protected IFigure createFigure() {
    // XXX: currently creating of CSSTextFigure is distributed both here
    // and FigureFactory. We may want to unify them later.
    return new CSSTextFigure(this);
  }
View Full Code Here

  public void updateFigure(Element node, CSSFigure oldFigure) {
    setCurrentFigure(oldFigure);
    ICSSWidgetProvider provider = initializeWidgetProvider(node);
    oldFigure.setCSSStyle(provider.getCSSStyle());
    oldFigure
        .setFixedLayoutManager(new CSSWidgetLayout(oldFigure, provider));
  }
View Full Code Here

   */
  public void refresh(boolean recursive) {
    if (!_tagConverter.isVisualByHTML()) {
      _tagConverter.convertRefresh(null);
      ((CSSFigure) getFigure())
          .setFixedLayoutManager(new CSSWidgetLayout(
              (CSSFigure) getFigure(), createHiddenProvider()));
      // nothing to refresh
      // ((CSSWidgetFigure)
      // getFigure()).setProvider(createHiddenProvider());
      return;
View Full Code Here

          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);
            }
          }
View Full Code Here

          .booleanValue();
      final int CARET_OFFSET = 1;
      Rectangle bounds = null;
      IFigure figure = ((GraphicalEditPart) part).getFigure();
      if (!caretIsAtRight) {
        FlowBox box;
        if ((box = layoutPart.getLine(0)) != null) {
          bounds = LayoutPart.getBounds(box);
        }
      } else {
        FlowBox box;
        if ((box = layoutPart.getLastLine()) != null) {
          bounds = LayoutPart.getBounds(box);
        }
      }
      if (bounds == null) {
View Full Code Here

TOP

Related Classes of org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo

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.