public void apply(FaceletContext faceletContext, UIComponent parent)
throws IOException, FacesException, ELException {
if (parent instanceof LayoutBase) {
LayoutBase component = (LayoutBase) parent;
if (parent instanceof LayoutComponent && columnSpan != null) {
if (columnSpan.isLiteral()) {
((LayoutComponent) component).setColumnSpan(Integer.valueOf(columnSpan.getValue()));
} else {
parent.setValueBinding(Attributes.COLUMN_SPAN,
faceletContext.getFacesContext().getApplication().createValueBinding(columnSpan.getValue()));
}
}
if (parent instanceof LayoutComponent && rowSpan != null) {
if (rowSpan.isLiteral()) {
((LayoutComponent) component).setRowSpan(Integer.valueOf(rowSpan.getValue()));
} else {
parent.setValueBinding(Attributes.ROW_SPAN,
faceletContext.getFacesContext().getApplication().createValueBinding(rowSpan.getValue()));
}
}
if (width != null) {
if (width.isLiteral()) {
component.setWidth(Measure.parse(width.getValue()));
} else {
parent.setValueBinding(Attributes.WIDTH,
faceletContext.getFacesContext().getApplication().createValueBinding(width.getValue()));
}
}
if (height != null) {
if (height.isLiteral()) {
component.setHeight(Measure.parse(height.getValue()));
} else {
parent.setValueBinding(Attributes.HEIGHT,
faceletContext.getFacesContext().getApplication().createValueBinding(height.getValue()));
}
}
if (minimumWidth != null) {
if (minimumWidth.isLiteral()) {
component.setMinimumWidth(Measure.parse(minimumWidth.getValue()));
} else {
parent.setValueBinding(Attributes.MINIMUM_WIDTH,
faceletContext.getFacesContext().getApplication().createValueBinding(minimumWidth.getValue()));
}
}
if (minimumHeight != null) {
if (minimumHeight.isLiteral()) {
component.setMinimumHeight(Measure.parse(minimumHeight.getValue()));
} else {
parent.setValueBinding(Attributes.MINIMUM_HEIGHT,
faceletContext.getFacesContext().getApplication().createValueBinding(minimumHeight.getValue()));
}
}
if (preferredWidth != null) {
if (preferredWidth.isLiteral()) {
component.setPreferredWidth(Measure.parse(preferredWidth.getValue()));
} else {
parent.setValueBinding(Attributes.PREFERRED_WIDTH,
faceletContext.getFacesContext().getApplication().createValueBinding(preferredWidth.getValue()));
}
}
if (preferredHeight != null) {
if (preferredHeight.isLiteral()) {
component.setPreferredHeight(Measure.parse(preferredHeight.getValue()));
} else {
parent.setValueBinding(Attributes.PREFERRED_HEIGHT,
faceletContext.getFacesContext().getApplication().createValueBinding(preferredHeight.getValue()));
}
}
if (maximumWidth != null) {
if (maximumWidth.isLiteral()) {
component.setMaximumWidth(Measure.parse(maximumWidth.getValue()));
} else {
parent.setValueBinding(Attributes.MAXIMUM_WIDTH,
faceletContext.getFacesContext().getApplication().createValueBinding(maximumWidth.getValue()));
}
}
if (maximumHeight != null) {
if (maximumHeight.isLiteral()) {
component.setMaximumHeight(Measure.parse(maximumHeight.getValue()));
} else {
parent.setValueBinding(Attributes.MAXIMUM_HEIGHT,
faceletContext.getFacesContext().getApplication().createValueBinding(maximumHeight.getValue()));
}
}
if (marginLeft != null) {
if (marginLeft.isLiteral()) {
component.setMarginLeft(Measure.parse(marginLeft.getValue()));
} else {
parent.setValueBinding(Attributes.MARGIN_LEFT,
faceletContext.getFacesContext().getApplication().createValueBinding(marginLeft.getValue()));
}
}
if (marginRight != null) {
if (marginRight.isLiteral()) {
component.setMarginRight(Measure.parse(marginRight.getValue()));
} else {
parent.setValueBinding(Attributes.MARGIN_RIGHT,
faceletContext.getFacesContext().getApplication().createValueBinding(marginRight.getValue()));
}
}
if (marginTop != null) {
if (marginTop.isLiteral()) {
component.setMarginTop(Measure.parse(marginTop.getValue()));
} else {
parent.setValueBinding(Attributes.MARGIN_TOP,
faceletContext.getFacesContext().getApplication().createValueBinding(marginTop.getValue()));
}
}
if (marginBottom != null) {
if (marginBottom.isLiteral()) {
component.setMarginBottom(Measure.parse(marginBottom.getValue()));
} else {
parent.setValueBinding(Attributes.MARGIN_BOTTOM,
faceletContext.getFacesContext().getApplication().createValueBinding(marginBottom.getValue()));
}
}