Package org.apache.myfaces.tobago.layout

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


    // find *
    if (orientation == Orientation.HORIZONTAL && !horizontalAuto
        || orientation == Orientation.VERTICAL && !verticalAuto) {
      // find rest
      LayoutContainer container = getLayoutContainer();
      Measure available = LayoutUtils.getCurrentSize(orientation, container);
      if (available != null) {
        available = available.subtractNotNegative(LayoutUtils.getBorderBegin(orientation, container));
        available = available.subtractNotNegative(LayoutUtils.getBorderEnd(orientation, container));

View Full Code Here


        factorList.add(((RelativeLayoutToken) head.getToken()).getFactor());
      }
    }
    if (!factorList.isEmpty()) {
      // find rest
      LayoutContainer container = getLayoutContainer();
      Measure available = LayoutUtils.getCurrentSize(orientation, container);
      if (available != null) {
        for (BankHead head : heads) {
          available = available.subtractNotNegative(head.getCurrent());
        }
View Full Code Here

    // find *
    if (orientation == Orientation.HORIZONTAL && !horizontalAuto
        || orientation == Orientation.VERTICAL && !verticalAuto) {

      final FacesContext facesContext = FacesContext.getCurrentInstance();
      final LayoutContainer container = getLayoutContainer();
      final AbstractUISheet sheet = (AbstractUISheet) container;

      if (orientation == Orientation.HORIZONTAL) {

        ensureColumnWidthList(facesContext, sheet);
View Full Code Here

    // find *
    if (orientation == Orientation.HORIZONTAL && !horizontalAuto
        || orientation == Orientation.VERTICAL && !verticalAuto) {

      final FacesContext facesContext = FacesContext.getCurrentInstance();
      final LayoutContainer container = getLayoutContainer();
      final AbstractUISheet sheet = (AbstractUISheet) container;

      if (orientation == Orientation.HORIZONTAL) {

        ensureColumnWidthList(facesContext, sheet);
View Full Code Here

    } else {
      LOG.warn("Layout Constraints inside of a non LayoutBase component!");
    }

    if (parent instanceof LayoutContainer) {
      final LayoutContainer container = (LayoutContainer) parent;

      if (borderLeft != null) {
        if (borderLeft.isLiteral()) {
          container.setBorderLeft(Measure.valueOf(borderLeft.getValue()));
        } else {
          parent.setValueExpression(Attributes.BORDER_LEFT,
              borderLeft.getValueExpression(faceletContext, Object.class));
        }
      }

      if (borderRight != null) {
        if (borderRight.isLiteral()) {
          container.setBorderRight(Measure.valueOf(borderRight.getValue()));
        } else {
          parent.setValueExpression(Attributes.BORDER_RIGHT,
              borderRight.getValueExpression(faceletContext, Object.class));
        }
      }

      if (borderTop != null) {
        if (borderTop.isLiteral()) {
          container.setBorderTop(Measure.valueOf(borderTop.getValue()));
        } else {
          parent.setValueExpression(Attributes.BORDER_TOP,
              borderTop.getValueExpression(faceletContext, Object.class));
        }
      }

      if (borderBottom != null) {
        if (borderBottom.isLiteral()) {
          container.setBorderBottom(Measure.valueOf(borderBottom.getValue()));
        } else {
          parent.setValueExpression(Attributes.BORDER_BOTTOM,
              borderBottom.getValueExpression(faceletContext, Object.class));
        }
      }

      if (paddingLeft != null) {
        if (paddingLeft.isLiteral()) {
          container.setPaddingLeft(Measure.valueOf(paddingLeft.getValue()));
        } else {
          parent.setValueExpression(Attributes.PADDING_LEFT,
              paddingLeft.getValueExpression(faceletContext, Object.class));
        }
      }

      if (paddingRight != null) {
        if (paddingRight.isLiteral()) {
          container.setPaddingRight(Measure.valueOf(paddingRight.getValue()));
        } else {
          parent.setValueExpression(Attributes.PADDING_RIGHT,
              paddingRight.getValueExpression(faceletContext, Object.class));
        }
      }

      if (paddingTop != null) {
        if (paddingTop.isLiteral()) {
          container.setPaddingTop(Measure.valueOf(paddingTop.getValue()));
        } else {
          parent.setValueExpression(Attributes.PADDING_TOP,
              paddingTop.getValueExpression(faceletContext, Object.class));
        }
      }

      if (paddingBottom != null) {
        if (paddingBottom.isLiteral()) {
          container.setPaddingBottom(Measure.valueOf(paddingBottom.getValue()));
        } else {
          parent.setValueExpression(Attributes.PADDING_BOTTOM,
              paddingBottom.getValueExpression(faceletContext, Object.class));
        }
      }
View Full Code Here

           }
         }
      }
      EncodeUtils.prepareRendererAll(facesContext, component);
      if (component instanceof LayoutContainer) {
        final LayoutContainer layoutContainer = (LayoutContainer) component;
        final Measure width = layoutContainer.getCurrentWidth();
        final Measure height = layoutContainer.getCurrentHeight();
        final Measure oldWidth = layoutContainer.getWidth();
        final Measure oldHeight = layoutContainer.getHeight();
        layoutContainer.setWidth(width);
        layoutContainer.setHeight(height);
        new LayoutContext(layoutContainer).layout();
        layoutContainer.setWidth(oldWidth);
        layoutContainer.setHeight(oldHeight);
      }
      component.encodeAll(facesContext);
    } catch (final IOException e) {
      throw new FacesException(e);
    }
View Full Code Here

        factorList.add(((RelativeLayoutToken) head.getToken()).getFactor());
      }
    }
    if (!factorList.isEmpty()) {
      // find rest
      final LayoutContainer container = getLayoutContainer();
      Measure available = LayoutUtils.getCurrentSize(orientation, container);
      if (available != null) {
        for (final BankHead head : heads) {
          available = available.subtractNotNegative(head.getCurrent());
        }
View Full Code Here

    // find *
    if (orientation == Orientation.HORIZONTAL && !horizontalAuto
        || orientation == Orientation.VERTICAL && !verticalAuto) {
      // find rest
      final LayoutContainer container = getLayoutContainer();
      final Measure available = LayoutUtils.getCurrentSize(orientation, container);
      if (available != null) {
        for (final LayoutComponent component : getLayoutContainer().getComponents()) {
          LayoutUtils.setCurrentSize(orientation, component, available);
        }
View Full Code Here

    }

    final LayoutBase layoutBase = (LayoutBase) component;
    final boolean isLayoutContainer = component instanceof LayoutContainer;
    final boolean isLayoutComponent = component instanceof LayoutComponent;
    final LayoutContainer layoutContainer = isLayoutContainer ? (LayoutContainer) component : null;
    final ELContext elContext = FacesContext.getCurrentInstance().getELContext();

    if (columnSpan != null) {
      if (isLayoutComponent) {
        component.setValueExpression(Attributes.COLUMN_SPAN, columnSpan);
      } else {
        LOG.warn("Ignoring '" + Attributes.COLUMN_SPAN + "', because the parent is not a LayoutComponent!");
      }
    }

    if (rowSpan != null) {
      if (isLayoutComponent) {
        component.setValueExpression(Attributes.ROW_SPAN, rowSpan);
      } else {
        LOG.warn("Ignoring '" + Attributes.ROW_SPAN + "', because the parent is not a LayoutComponent!");
      }
    }

    if (width != null) {
      if (width.isLiteralText()) {
        layoutBase.setWidth(Measure.valueOf(width.getValue(elContext)));
      } else {
        component.setValueExpression(Attributes.WIDTH, width);
      }
    }

    if (height != null) {
      if (height.isLiteralText()) {
        layoutBase.setHeight(Measure.valueOf(height.getValue(elContext)));
      } else {
        component.setValueExpression(Attributes.HEIGHT, height);
      }
    }

    if (minimumWidth != null) {
      if (minimumWidth.isLiteralText()) {
        layoutBase.setMinimumWidth(Measure.valueOf(minimumWidth.getValue(elContext)));
      } else {
        component.setValueExpression(Attributes.MINIMUM_WIDTH, minimumWidth);
      }
    }

    if (minimumHeight != null) {
      if (minimumHeight.isLiteralText()) {
        layoutBase.setMinimumHeight(Measure.valueOf(minimumHeight.getValue(elContext)));
      } else {
        component.setValueExpression(Attributes.MINIMUM_HEIGHT, minimumHeight);
      }
    }

    if (preferredWidth != null) {
      if (preferredWidth.isLiteralText()) {
        layoutBase.setPreferredWidth(Measure.valueOf(preferredWidth.getValue(elContext)));
      } else {
        component.setValueExpression(Attributes.PREFERRED_WIDTH, preferredWidth);
      }
    }

    if (preferredHeight != null) {
      if (preferredHeight.isLiteralText()) {
        layoutBase.setPreferredHeight(Measure.valueOf(preferredHeight.getValue(elContext)));
      } else {
        component.setValueExpression(Attributes.PREFERRED_HEIGHT, preferredHeight);
      }
    }

    if (maximumWidth != null) {
      if (maximumWidth.isLiteralText()) {
        layoutBase.setMaximumWidth(Measure.valueOf(maximumWidth.getValue(elContext)));
      } else {
        component.setValueExpression(Attributes.MAXIMUM_WIDTH, maximumWidth);
      }
    }

    if (maximumHeight != null) {
      if (maximumHeight.isLiteralText()) {
        layoutBase.setMaximumHeight(Measure.valueOf(maximumHeight.getValue(elContext)));
      } else {
        component.setValueExpression(Attributes.MAXIMUM_HEIGHT, maximumHeight);
      }
    }

    if (marginLeft != null) {
      if (marginLeft.isLiteralText()) {
        layoutBase.setMarginLeft(Measure.valueOf(marginLeft.getValue(elContext)));
      } else {
        component.setValueExpression(Attributes.MARGIN_LEFT, marginLeft);
      }
    }

    if (marginRight != null) {
      if (marginRight.isLiteralText()) {
        layoutBase.setMarginRight(Measure.valueOf(marginRight.getValue(elContext)));
      } else {
        component.setValueExpression(Attributes.MARGIN_RIGHT, marginRight);
      }
    }

    if (marginTop != null) {
      if (marginTop.isLiteralText()) {
        layoutBase.setMarginTop(Measure.valueOf(marginTop.getValue(elContext)));
      } else {
        component.setValueExpression(Attributes.MARGIN_TOP, marginTop);
      }
    }

    if (marginBottom != null) {
      if (marginBottom.isLiteralText()) {
        layoutBase.setMarginBottom(Measure.valueOf(marginBottom.getValue(elContext)));
      } else {
        component.setValueExpression(Attributes.MARGIN_BOTTOM, marginBottom);
      }
    }

    if (borderLeft != null) {
      if (isLayoutContainer) {
        if (borderLeft.isLiteralText()) {
          layoutContainer.setBorderLeft(Measure.valueOf(borderLeft.getValue(elContext)));
        } else {
          component.setValueExpression(Attributes.BORDER_LEFT, borderLeft);
        }
      } else {
        LOG.warn("Ignoring '" + Attributes.BORDER_LEFT + "', because the parent is not a LayoutContainer!");
      }
    }

    if (borderRight != null) {
      if (isLayoutContainer) {
        if (borderRight.isLiteralText()) {
          layoutContainer.setBorderRight(Measure.valueOf(borderRight.getValue(elContext)));
        } else {
          component.setValueExpression(Attributes.BORDER_RIGHT, borderRight);
        }
      } else {
        LOG.warn("Ignoring '" + Attributes.BORDER_RIGHT + "', because the parent is not a LayoutContainer!");
      }
    }

    if (borderTop != null) {
      if (isLayoutContainer) {
        if (borderTop.isLiteralText()) {
          layoutContainer.setBorderTop(Measure.valueOf(borderTop.getValue(elContext)));
        } else {
          component.setValueExpression(Attributes.BORDER_TOP, borderTop);
        }
      } else {
        LOG.warn("Ignoring '" + Attributes.BORDER_TOP + "', because the parent is not a LayoutContainer!");
      }
    }

    if (borderBottom != null) {
      if (isLayoutContainer) {
        if (borderBottom.isLiteralText()) {
          layoutContainer.setBorderBottom(Measure.valueOf(borderBottom.getValue(elContext)));
        } else {
          component.setValueExpression(Attributes.BORDER_BOTTOM, borderBottom);
        }
      } else {
        LOG.warn("Ignoring '" + Attributes.BORDER_BOTTOM + "', because the parent is not a LayoutContainer!");
      }
    }

    if (paddingLeft != null) {
      if (isLayoutContainer) {
        if (paddingLeft.isLiteralText()) {
          layoutContainer.setPaddingLeft(Measure.valueOf(paddingLeft.getValue(elContext)));
        } else {
          component.setValueExpression(Attributes.PADDING_LEFT, paddingLeft);
        }
      } else {
        LOG.warn("Ignoring '" + Attributes.PADDING_LEFT + "', because the parent is not a LayoutContainer!");
      }
    }

    if (paddingRight != null) {
      if (isLayoutContainer) {
        if (paddingRight.isLiteralText()) {
          layoutContainer.setPaddingRight(Measure.valueOf(paddingRight.getValue(elContext)));
        } else {
          component.setValueExpression(Attributes.PADDING_RIGHT, paddingRight);
        }
      } else {
        LOG.warn("Ignoring '" + Attributes.PADDING_RIGHT + "', because the parent is not a LayoutContainer!");
      }
    }
    if (paddingTop != null) {
      if (isLayoutContainer) {
        if (paddingTop.isLiteralText()) {
          layoutContainer.setPaddingTop(Measure.valueOf(paddingTop.getValue(elContext)));
        } else {
          component.setValueExpression(Attributes.PADDING_TOP, paddingTop);
        }
      } else {
        LOG.warn("Ignoring '" + Attributes.PADDING_TOP + "', because the parent is not a LayoutContainer!");
      }
    }

    if (paddingBottom != null) {
      if (isLayoutContainer) {
        if (paddingBottom.isLiteralText()) {
          layoutContainer.setPaddingBottom(Measure.valueOf(paddingBottom.getValue(elContext)));
        } else {
          component.setValueExpression(Attributes.PADDING_BOTTOM, paddingBottom);
        }
      } else {
        LOG.warn("Ignoring '" + Attributes.PADDING_BOTTOM + "', because the parent is not a LayoutContainer!");
View Full Code Here

    // find *
    if (orientation == Orientation.HORIZONTAL && !horizontalAuto
        || orientation == Orientation.VERTICAL && !verticalAuto) {

      final FacesContext facesContext = FacesContext.getCurrentInstance();
      final LayoutContainer container = getLayoutContainer();
      final AbstractUISheet sheet = (AbstractUISheet) container;

      if (orientation == Orientation.HORIZONTAL) {

        ensureColumnWidthList(facesContext, sheet);
View Full Code Here

TOP

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

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.