Package org.apache.myfaces.tobago.layout

Examples of org.apache.myfaces.tobago.layout.LayoutManager


  }

  public static LayoutManager createAndInitLayout(
      FacesContext facesContext, String componentType, String rendererType, UIComponent parent) {

    LayoutManager layoutManager = (LayoutManager) CreateComponentUtils.createComponent(
        facesContext, componentType, rendererType, facesContext.getViewRoot().createUniqueId());
    if (layoutManager instanceof OnComponentCreated) {
      ((OnComponentCreated) layoutManager).onComponentCreated(facesContext, parent);
    }
    if (layoutManager instanceof OnComponentPopulated) {
View Full Code Here


    long begin = 0;
    if (LOG.isDebugEnabled()) {
      begin = System.nanoTime();
    }

    LayoutManager layoutManager = container.getLayoutManager();
    layoutManager.init();
    layoutManager.fixRelativeInsideAuto(Orientation.HORIZONTAL, false);
    layoutManager.fixRelativeInsideAuto(Orientation.VERTICAL, false);
    layoutManager.preProcessing(Orientation.HORIZONTAL);
    layoutManager.preProcessing(Orientation.VERTICAL);
    layoutManager.mainProcessing(Orientation.HORIZONTAL);
    layoutManager.mainProcessing(Orientation.VERTICAL);
    layoutManager.postProcessing(Orientation.HORIZONTAL);
    layoutManager.postProcessing(Orientation.VERTICAL);

    if (LOG.isDebugEnabled()) {
        LOG.debug("Laying out takes: {} ns", new DecimalFormat("#,##0").format(System.nanoTime() - begin));
    }
View Full Code Here

      buffer.append(", ");
      buffer.append(((LayoutBase) component).getCurrentHeight());
      buffer.append(")");
    }
    if (component instanceof LayoutContainer) {
      LayoutManager layoutManager = ((LayoutContainer) component).getLayoutManager();
      if (layoutManager instanceof AbstractUIGridLayout) {
        buffer.append("\n");
        buffer.append(StringUtils.repeat("  ", depth + 4));
        buffer.append("layout: ");
        buffer.append(((AbstractUIGridLayout) layoutManager).toString(depth));
View Full Code Here

  public static LayoutManager createAndInitLayout(
      final FacesContext facesContext, final String componentType, final String rendererType,
      final UIComponent parent) {

    final LayoutManager layoutManager = (LayoutManager) CreateComponentUtils.createComponent(
        facesContext, componentType, rendererType, facesContext.getViewRoot().createUniqueId());
    if (layoutManager instanceof OnComponentCreated) {
      ((OnComponentCreated) layoutManager).onComponentCreated(facesContext, parent);
    }
    if (layoutManager instanceof OnComponentPopulated) {
View Full Code Here

        return (LayoutManager) layoutFacet;
      } else {
        return (LayoutManager) ComponentUtils.findChild(layoutFacet, AbstractUILayoutBase.class);
      }
    } else {
      final LayoutManager layoutManager = CreateComponentUtils.createAndInitLayout(
          FacesContext.getCurrentInstance(), ComponentTypes.GRID_LAYOUT, RendererTypes.GRID_LAYOUT, base.getParent());
      base.getFacets().put(Facets.LAYOUT, (AbstractUILayoutBase) layoutManager);
      return layoutManager;
    }
  }
View Full Code Here

    final boolean trace = LOG.isTraceEnabled();
    if (debug) {
      begin = System.nanoTime();
    }

    final LayoutManager layoutManager = container.getLayoutManager();
    layoutManager.init();
    if (trace) {
      log("after init", true);
    }
    layoutManager.fixRelativeInsideAuto(Orientation.VERTICAL, false);
    if (trace) {
      log("after fixRelativeInsideAuto vertical", true);
    }
    layoutManager.fixRelativeInsideAuto(Orientation.HORIZONTAL, false);
    if (trace) {
      log("after fixRelativeInsideAuto horizontal", true);
    }
    layoutManager.preProcessing(Orientation.VERTICAL);
    if (trace) {
      log("after preProcessing vertical", true);
    }
    layoutManager.preProcessing(Orientation.HORIZONTAL);
    if (trace) {
      log("after preProcessing horizontal", true);
    }
    layoutManager.mainProcessing(Orientation.VERTICAL);
    if (trace) {
      log("after mainProcessing vertical", true);
    }
    layoutManager.mainProcessing(Orientation.HORIZONTAL);
    if (trace) {
      log("after mainProcessing horizontal", true);
    }
    layoutManager.postProcessing(Orientation.VERTICAL);
    if (trace) {
      log("after postProcessing vertical", true);
    }
    layoutManager.postProcessing(Orientation.HORIZONTAL);
    if (trace) {
      log("after postProcessing horizontal", true);
    }

    if (debug) {
View Full Code Here

      buffer.append(", ");
      buffer.append(((LayoutBase) component).getCurrentHeight());
      buffer.append(")");
    }
    if (component instanceof LayoutContainer) {
      final LayoutManager layoutManager = ((LayoutContainer) component).getLayoutManager();
      if (layoutManager instanceof AbstractUIGridLayout) {
        buffer.append("\n");
        buffer.append(StringUtils.repeat("  ", depth + 4));
        buffer.append("layout: ");
        buffer.append(((AbstractUIGridLayout) layoutManager).toString(depth));
View Full Code Here

        // recursion
        if (cell instanceof OriginCell) {
          final OriginCell origin = (OriginCell) cell;
          final LayoutComponent component = cell.getComponent();
          if (component instanceof LayoutContainer && component.isRendered()) {
            final LayoutManager layoutManager = ((LayoutContainer) component).getLayoutManager();
            // TODO: may be improved
            final boolean childAuto
                = origin.getSpan(orientation) == 1 && heads[i].getToken() instanceof AutoLayoutToken;
            layoutManager.fixRelativeInsideAuto(orientation, childAuto);
          }
        }
      }
      if (neitherRendered && !isRigid()) {
        heads[i].setRendered(false);
View Full Code Here

    writer.endElement(HtmlElements.TABLE);
    writer.endElement(HtmlElements.DIV);
  }

  private boolean needVerticalScrollbar(final FacesContext facesContext, final UISheet sheet) {
    final LayoutManager layoutManager = sheet.getLayoutManager();
    if (layoutManager instanceof AbstractUISheetLayout) {
      return ((AbstractUISheetLayout) layoutManager).needVerticalScrollbar(facesContext, sheet);
    } else {
      LOG.error("Sheet must use a sheet layout, but found: " + layoutManager.getClass().getName());
      return true;
    }
  }
View Full Code Here

        // recursion
        if (cell instanceof OriginCell) {
          OriginCell origin = (OriginCell) cell;
          LayoutComponent component = cell.getComponent();
          if (component instanceof LayoutContainer) {
            LayoutManager layoutManager = ((LayoutContainer) component).getLayoutManager();
            // TODO: may be improved
            boolean childAuto = origin.getSpan(orientation) == 1 && heads[i].getToken() instanceof AutoLayoutToken;
            layoutManager.fixRelativeInsideAuto(orientation, childAuto);
          }
        }
      }
      if (neitherRendered) {
        heads[i].setRendered(false);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.tobago.layout.LayoutManager

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.