1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag;
21
22 import org.apache.myfaces.tobago.component.Attributes;
23 import org.apache.myfaces.tobago.config.Configurable;
24 import org.apache.myfaces.tobago.layout.LayoutContainer;
25 import org.apache.myfaces.tobago.layout.Measure;
26 import org.apache.myfaces.tobago.renderkit.MarginValues;
27 import org.apache.myfaces.tobago.renderkit.RendererBase;
28 import org.apache.myfaces.tobago.renderkit.SpacingValues;
29 import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
30 import org.slf4j.Logger;
31 import org.slf4j.LoggerFactory;
32
33 import javax.faces.component.UIComponent;
34 import javax.faces.context.FacesContext;
35 import java.io.IOException;
36
37 public class GridLayoutRenderer extends RendererBase implements SpacingValues, MarginValues {
38
39 private static final Logger LOG = LoggerFactory.getLogger(GridLayoutRenderer.class);
40
41 @Override
42 public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
43
44
45
46
47 }
48
49 @Override
50 public void encodeChildren(FacesContext facesContext, UIComponent component) throws IOException {
51 UIComponent container = component.getParent();
52 if (container instanceof LayoutContainer && !((LayoutContainer) container).isLayoutChildren()) {
53 return;
54 }
55 RenderUtils.encodeChildren(facesContext, container);
56 }
57
58 @Override
59 public void encodeEnd(
60 FacesContext facesContext,
61 UIComponent component) throws IOException {
62
63
64 }
65
66 public Measure getColumnSpacing(FacesContext facesContext, Configurable component) {
67 return getResourceManager().getThemeMeasure(facesContext, component, Attributes.COLUMN_SPACING);
68 }
69
70 public Measure getRowSpacing(FacesContext facesContext, Configurable component) {
71 return getResourceManager().getThemeMeasure(facesContext, component, Attributes.ROW_SPACING);
72 }
73
74 public Measure getMarginLeft(FacesContext facesContext, Configurable component) {
75 return getResourceManager().getThemeMeasure(facesContext, component, Attributes.MARGIN_LEFT);
76 }
77
78 public Measure getMarginRight(FacesContext facesContext, Configurable component) {
79 return getResourceManager().getThemeMeasure(facesContext, component, Attributes.MARGIN_RIGHT);
80 }
81
82 public Measure getMarginTop(FacesContext facesContext, Configurable component) {
83 return getResourceManager().getThemeMeasure(facesContext, component, Attributes.MARGIN_TOP);
84 }
85
86 public Measure getMarginBottom(FacesContext facesContext, Configurable component) {
87 return getResourceManager().getThemeMeasure(facesContext, component, Attributes.MARGIN_BOTTOM);
88 }
89 }