Package org.apache.myfaces.tobago.component

Examples of org.apache.myfaces.tobago.component.UIGridLayout


  }

  public int getComponentExtraWidth(FacesContext facesContext,
      UIComponent component) {
    int extra = 0;
    UIGridLayout layout = (UIGridLayout) component;

    extra += getMarginAsInt(layout.getMarginRight());
    extra += getMarginAsInt(layout.getMarginLeft());

    return extra;
  }
View Full Code Here


  }

  public int getComponentExtraHeight(FacesContext facesContext,
      UIComponent component) {
    int extra = 0;
    UIGridLayout layout = (UIGridLayout) component;

    extra += getMarginAsInt(layout.getMarginTop());
    extra += getMarginAsInt(layout.getMarginBottom());
    return extra;
  }
View Full Code Here

  }

  @Override
  protected void setProperties(final UIComponent uiComponent) {
    super.setProperties(uiComponent);
    final UIGridLayout component = (UIGridLayout) uiComponent;
    final FacesContext context = FacesContext.getCurrentInstance();
    final Application application = context.getApplication();
    if (rowOverflow != null) {
      if (!rowOverflow.isLiteralText()) {
        component.setValueExpression("rowOverflow", rowOverflow);
      } else {
        component.setRowOverflow(Boolean.parseBoolean(rowOverflow.getExpressionString()));
      }
    }
    if (markup != null) {
      if (!markup.isLiteralText()) {
        component.setValueExpression("markup", markup);
      } else {
        component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
      }
    }
    if (marginLeft != null) {
      if (!marginLeft.isLiteralText()) {
        component.setValueExpression("marginLeft", marginLeft);
      } else {
        component.setMarginLeft(org.apache.myfaces.tobago.layout.Measure.valueOf(marginLeft.getExpressionString()));
      }
    }
    if (marginTop != null) {
      if (!marginTop.isLiteralText()) {
        component.setValueExpression("marginTop", marginTop);
      } else {
        component.setMarginTop(org.apache.myfaces.tobago.layout.Measure.valueOf(marginTop.getExpressionString()));
      }
    }
    if (marginRight != null) {
      if (!marginRight.isLiteralText()) {
        component.setValueExpression("marginRight", marginRight);
      } else {
        component.setMarginRight(org.apache.myfaces.tobago.layout.Measure.valueOf(marginRight.getExpressionString()));
      }
    }
    if (columns != null) {
      component.setValueExpression("columns", columns);
    }

    if (rigid != null) {
      if (!rigid.isLiteralText()) {
        component.setValueExpression("rigid", rigid);
      } else {
        component.setRigid(Boolean.parseBoolean(rigid.getExpressionString()));
      }
    }
    if (cellspacing != null) {
      if (!cellspacing.isLiteralText()) {
        component.setValueExpression("cellspacing", cellspacing);
      } else {
        component.setCellspacing(org.apache.myfaces.tobago.layout.Measure.valueOf(cellspacing.getExpressionString()));
      }
    }
    if (rows != null) {
      component.setValueExpression("rows", rows);
    }

    if (marginBottom != null) {
      if (!marginBottom.isLiteralText()) {
        component.setValueExpression("marginBottom", marginBottom);
      } else {
        component.setMarginBottom(org.apache.myfaces.tobago.layout.Measure.valueOf(marginBottom.getExpressionString()));
      }
    }
    if (columnOverflow != null) {
      if (!columnOverflow.isLiteralText()) {
        component.setValueExpression("columnOverflow", columnOverflow);
      } else {
        component.setColumnOverflow(Boolean.parseBoolean(columnOverflow.getExpressionString()));
      }
    }
    if (rowSpacing != null) {
      if (!rowSpacing.isLiteralText()) {
        component.setValueExpression("rowSpacing", rowSpacing);
      } else {
        component.setRowSpacing(org.apache.myfaces.tobago.layout.Measure.valueOf(rowSpacing.getExpressionString()));
      }
    }
    if (margin != null) {
      if (!margin.isLiteralText()) {
        component.setValueExpression("margin", margin);
      } else {
        component.setMargin(org.apache.myfaces.tobago.layout.Measure.valueOf(margin.getExpressionString()));
      }
    }
    if (border != null) {
      component.setValueExpression("border", border);
    }

    if (columnSpacing != null) {
      if (!columnSpacing.isLiteralText()) {
        component.setValueExpression("columnSpacing", columnSpacing);
      } else {
        component.setColumnSpacing(org.apache.myfaces.tobago.layout.Measure.valueOf(columnSpacing.getExpressionString()));
      }
    }
  }
View Full Code Here

    ColumnSpacingMapper(final TagAttribute attribute) {
      this.attribute = attribute;
    }

    public void applyMetadata(final FaceletContext ctx, final Object instance) {
      final UIGridLayout gridLayout = (UIGridLayout) instance;
      gridLayout.setColumnSpacing(Measure.parse(attribute.getValue()));
    }
View Full Code Here

    RowSpacingMapper(final TagAttribute attribute) {
      this.attribute = attribute;
    }

    public void applyMetadata(final FaceletContext ctx, final Object instance) {
      final UIGridLayout gridLayout = (UIGridLayout) instance;
      gridLayout.setRowSpacing(Measure.parse(attribute.getValue()));
    }
View Full Code Here

    CellspacingMapper(final TagAttribute attribute) {
      this.attribute = attribute;
    }

    public void applyMetadata(final FaceletContext ctx, final Object instance) {
      final UIGridLayout gridLayout = (UIGridLayout) instance;
      gridLayout.setCellspacing(Measure.parse(attribute.getValue()));
    }
View Full Code Here

    MarginLeftMapper(final TagAttribute attribute) {
      this.attribute = attribute;
    }

    public void applyMetadata(final FaceletContext ctx, final Object instance) {
      final UIGridLayout gridLayout = (UIGridLayout) instance;
      gridLayout.setMarginLeft(Measure.valueOf(attribute.getValue()));
    }
View Full Code Here

    MarginTopMapper(final TagAttribute attribute) {
      this.attribute = attribute;
    }

    public void applyMetadata(final FaceletContext ctx, final Object instance) {
      final UIGridLayout gridLayout = (UIGridLayout) instance;
      gridLayout.setMarginTop(Measure.valueOf(attribute.getValue()));
    }
View Full Code Here

    }
  }

  private void addGridLayout(
      final FaceletContext faceletContext, final UIComponent panel, final Application application) {
    final UIGridLayout gridLayout = (UIGridLayout) application.createComponent(UIGridLayout.COMPONENT_TYPE);
    gridLayout.setRendererType(RendererTypes.GRID_LAYOUT);
    if (labelWidthAttribute != null) {
      String columns = getColumns(labelWidthAttribute.getValue(faceletContext));
      if (!LayoutUtils.checkTokens(columns)) {
        LOG.warn("Illegal value for columns = \"" + columns + "\" replacing with default: \"" + DEFAULT_COLUMNS + "\"");
        columns = DEFAULT_COLUMNS;
      }
      gridLayout.setColumns(columns);
    } else {
      gridLayout.setColumns(getColumns("auto"));
    }
    gridLayout.setRows(getRows());
    gridLayout.setId(panel.getId() + "_tx_layout");
    if (gridLayout instanceof OnComponentCreated) {
      ((OnComponentCreated) gridLayout).onComponentCreated(faceletContext.getFacesContext(), panel);
    }
    panel.getFacets().put(Facets.LAYOUT, gridLayout);
    if (gridLayout instanceof OnComponentPopulated) {
View Full Code Here

    MarginRightMapper(final TagAttribute attribute) {
      this.attribute = attribute;
    }

    public void applyMetadata(final FaceletContext ctx, final Object instance) {
      final UIGridLayout gridLayout = (UIGridLayout) instance;
      gridLayout.setMarginRight(Measure.valueOf(attribute.getValue()));
    }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.tobago.component.UIGridLayout

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.