View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.myfaces.orchestra.dynaForm.jsf.guiBuilder.impl.jsf;
20  
21  import org.apache.myfaces.orchestra.dynaForm.metadata.MetaField;
22  
23  import javax.faces.component.UIComponent;
24  import javax.faces.component.UIInput;
25  import javax.faces.component.UIOutput;
26  import javax.faces.component.UIParameter;
27  import javax.faces.component.UISelectBoolean;
28  import javax.faces.component.html.HtmlInputText;
29  import javax.faces.component.html.HtmlOutputLabel;
30  import javax.faces.component.html.HtmlOutputText;
31  import javax.faces.component.html.HtmlPanelGroup;
32  import javax.faces.component.html.HtmlSelectBooleanCheckbox;
33  import javax.faces.component.html.HtmlSelectOneMenu;
34  import javax.faces.context.FacesContext;
35  import javax.faces.convert.DateTimeConverter;
36  import javax.el.ELContext;
37  import java.util.Map;
38  
39  /**
40   * a helper to be able to decorate the builder
41   */
42  public class JsfGuiBuilderDecorator extends JsfGuiBuilder
43  {
44      private final JsfGuiBuilder original;
45  
46      public JsfGuiBuilderDecorator(JsfGuiBuilder original)
47      {
48          this.original = original;
49      }
50  
51      public JsfGuiBuilder getOriginal()
52      {
53          return original;
54      }
55  
56      public void createInputBoolean(MetaField field)
57      {
58          original.createInputBoolean(field);
59      }
60  
61      public void createInputDate(MetaField field)
62      {
63          original.createInputDate(field);
64      }
65  
66      public void createInputNumber(MetaField field)
67      {
68          original.createInputNumber(field);
69      }
70  
71      public void createInputText(MetaField field)
72      {
73          original.createInputText(field);
74      }
75  
76      public UIOutput createLabelFor(String labelText, UIComponent cmp)
77      {
78          return original.createLabelFor(labelText, cmp);
79      }
80  
81      public void createNative(MetaField field)
82      {
83          original.createNative(field);
84      }
85  
86      public void createOutputText(MetaField field)
87      {
88          original.createOutputText(field);
89      }
90  
91      public UIParameter createParameter(String name, String value)
92      {
93          return original.createParameter(name, value);
94      }
95  
96      public void createSearchFor(MetaField field)
97      {
98          original.createSearchFor(field);
99      }
100 
101     /*
102     public void createSearchForSelectMenu(MetaField field)
103     {
104         original.createSearchForSelectMenu(field);
105     }
106     */
107 
108     public void createSelectOneMenu(MetaField field)
109     {
110         original.createSelectOneMenu(field);
111     }
112 
113     /*
114     public HtmlCommandLink doCreateCommandLinkComponent()
115     {
116         return original.doCreateCommandLinkComponent();
117     }
118     */
119 
120     public DateTimeConverter doCreateDateConverter(MetaField field)
121     {
122         return original.doCreateDateConverter(field);
123     }
124 
125     public UISelectBoolean doCreateInputBoolean(MetaField field)
126     {
127         return original.doCreateInputBoolean(field);
128     }
129 
130     public HtmlSelectBooleanCheckbox doCreateInputBooleanComponent()
131     {
132         return original.doCreateInputBooleanComponent();
133     }
134 
135     public HtmlInputText doCreateInputDate(MetaField field)
136     {
137         return original.doCreateInputDate(field);
138     }
139 
140     public HtmlInputText doCreateInputDateComponent(MetaField field)
141     {
142         return original.doCreateInputDateComponent(field);
143     }
144 
145     public HtmlInputText doCreateInputNumber(MetaField field)
146     {
147         return original.doCreateInputNumber(field);
148     }
149 
150     public HtmlInputText doCreateInputText(MetaField field)
151     {
152         return original.doCreateInputText(field);
153     }
154 
155     public HtmlInputText doCreateInputTextComponent()
156     {
157         return original.doCreateInputTextComponent();
158     }
159 
160     public void doCreateNative(MetaField field, UIComponent uicomponent)
161     {
162         original.doCreateNative(field, uicomponent);
163     }
164 
165     public HtmlOutputLabel doCreateOutputLabel(String text)
166     {
167         return original.doCreateOutputLabel(text);
168     }
169 
170     public HtmlOutputLabel doCreateOutputLabelComponent()
171     {
172         return original.doCreateOutputLabelComponent();
173     }
174 
175     public HtmlOutputText doCreateOutputText(MetaField field)
176     {
177         return original.doCreateOutputText(field);
178     }
179 
180     public HtmlOutputText doCreateOutputText(String text)
181     {
182         return original.doCreateOutputText(text);
183     }
184 
185     public HtmlOutputText doCreateOutputTextComponent()
186     {
187         return original.doCreateOutputTextComponent();
188     }
189 
190     public HtmlPanelGroup doCreatePanelGroupComponent()
191     {
192         return original.doCreatePanelGroupComponent();
193     }
194 
195     public UIComponent doCreateSearchFor(MetaField field)
196     {
197         return original.doCreateSearchFor(field);
198     }
199 
200     public HtmlSelectOneMenu doCreateSelectOneMenu(MetaField field)
201     {
202         return original.doCreateSelectOneMenu(field);
203     }
204 
205     public HtmlSelectOneMenu doCreateSelectOneMenuComponent()
206     {
207         return original.doCreateSelectOneMenuComponent();
208     }
209 
210     public UIInput findInputComponent(UIComponent cmp)
211     {
212         return original.findInputComponent(cmp);
213     }
214 
215     public void fireNewComponent(MetaField field, UIComponent cmp)
216     {
217         original.fireNewComponent(field, cmp);
218     }
219 
220     /*
221     public String getBackingBeanPrefix()
222     {
223         return original.getBackingBeanPrefix();
224     }
225     */
226 
227     public String getBackingEntityPrefix()
228     {
229         return original.getBackingEntityPrefix();
230     }
231 
232     public FacesContext getContext()
233     {
234         return original.getContext();
235     }
236 
237     public void setELContext(ELContext elcontext)
238     {
239         original.setELContext(elcontext);
240     }
241 
242     public ELContext getELContext()
243     {
244         return original.getELContext();
245     }
246 
247     public NewComponentListener getNewComponentListener()
248     {
249         return original.getNewComponentListener();
250     }
251 
252     /*
253     public void iniCommandDefaults(UICommand cmp, FieldInterface field, String action, String actionListener)
254     {
255         original.iniCommandDefaults(cmp, field, action, actionListener);
256     }
257     */
258 
259     public void initDefaults(UIComponent cmp, MetaField field)
260     {
261         original.initDefaults(cmp, field);
262     }
263 
264     public void initInputDefaults(HtmlInputText cmp, MetaField field)
265     {
266         original.initInputDefaults(cmp, field);
267     }
268 
269     public void initInputDefaults(UIInput cmp, MetaField field)
270     {
271         original.initInputDefaults(cmp, field);
272     }
273 
274     public void initOutputDefaults(UIOutput cmp, MetaField field)
275     {
276         original.initOutputDefaults(cmp, field);
277     }
278 
279     public void initSelections(MetaField field, UIComponent cmp)
280     {
281         original.initSelections(field, cmp);
282     }
283 
284     public void initValueBinding(UIComponent cmp, MetaField field)
285     {
286         original.initValueBinding(cmp, field);
287     }
288 
289     /*
290     public void setBackingBeanPrefix(String backingBeanPrefix)
291     {
292         original.setBackingBeanPrefix(backingBeanPrefix);
293     }
294     */
295 
296     public void setBackingEntityPrefix(String backingEntityPrefix)
297     {
298         original.setBackingEntityPrefix(backingEntityPrefix);
299     }
300 
301     public void setContext(FacesContext context)
302     {
303         original.setContext(context);
304     }
305 
306     public void setFormDisplayOnly(boolean displayOnly)
307     {
308         original.setFormDisplayOnly(displayOnly);
309     }
310 
311     public void setNewComponentListener(NewComponentListener newComponentListener)
312     {
313         original.setNewComponentListener(newComponentListener);
314     }
315 
316     public Map<String, String> getLabelBundle()
317     {
318         return original.getLabelBundle();
319     }
320 
321     public void setLabelBundle(Map<String, String> labelBundle)
322     {
323         original.setLabelBundle(labelBundle);
324     }
325 
326     protected void attachLengthValidator(HtmlInputText cmp, int minSize, int maxSize)
327     {
328         original.attachLengthValidator(cmp, minSize, maxSize);
329     }
330 
331     protected void attachRangeValidator(HtmlInputText cmp, double minValue, double maxValue)
332     {
333         original.attachRangeValidator(cmp, minValue, maxValue);
334     }
335 
336     protected boolean buildField(MetaField field)
337     {
338         return super.buildField(field);
339     }
340 }