View Javadoc
1   // ---------- Attention: Generated code, please do not modify! -----------
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one or more
5    * contributor license agreements.  See the NOTICE file distributed with
6    * this work for additional information regarding copyright ownership.
7    * The ASF licenses this file to You under the Apache License, Version 2.0
8    * (the "License"); you may not use this file except in compliance with
9    * the License.  You may obtain a copy of the License at
10   *
11   *      http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */
19  
20  package org.apache.myfaces.tobago.component;
21  
22  import javax.el.MethodExpression;
23  import javax.faces.context.FacesContext;
24  import org.apache.myfaces.tobago.context.Markup;
25  import org.apache.myfaces.tobago.internal.component.AbstractUISheet;
26  import org.apache.myfaces.tobago.layout.ShowPosition;
27  import org.apache.myfaces.tobago.model.Selectable;
28  import org.apache.myfaces.tobago.renderkit.css.CustomClass;
29  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
30  import org.apache.myfaces.tobago.internal.util.StringUtils;
31  import org.apache.myfaces.tobago.internal.util.Deprecation;
32  import org.apache.myfaces.tobago.component.Tags;
33  import javax.annotation.Generated;
34  import javax.el.ELException;
35  import javax.faces.FacesException;
36  import java.util.Arrays;
37  import java.util.ArrayList;
38  import java.util.Collection;
39  import java.util.List;
40  import javax.el.MethodExpression;
41  import javax.el.ValueExpression;
42  
43  /**
44   Render a sheet element.
45    * UIComponent class, generated from template {@code component.stg} with class
46    * {@link org.apache.myfaces.tobago.internal.taglib.component.SheetTagDeclaration}.
47   */
48  @Generated("component.stg")
49  public class UISheet
50      extends AbstractUISheet  {
51  
52    public static final String COMPONENT_TYPE = Tags.sheet.componentType();
53  
54    public static final String COMPONENT_FAMILY = "javax.faces.Data";
55  
56    private static final Collection<String> EVENT_NAMES = Arrays.asList("reload");
57  
58    @Override
59    public Collection<String> getEventNames() {
60      return EVENT_NAMES;
61    }
62  
63    @Override
64    public String getDefaultEventName() {
65      return "reload";
66    }
67  
68  
69    enum PropertyKeys {
70      markup,
71      showPageRange,
72      showPagingAlways,
73      directLinkCount,
74      showRootJunction,
75      columns,
76      showHeader,
77      lazy,
78      showPageRangeArrows,
79      selectable,
80      sortActionListener,
81      showDirectLinks,
82      showDirectLinksArrows,
83      showRoot,
84      showRowRange,
85      customClass,
86      stateChangeListener,
87    }
88  
89    public String getFamily() {
90      return COMPONENT_FAMILY;
91    }
92  
93  
94    public org.apache.myfaces.tobago.context.Markup getMarkup() {
95      Object object = getStateHelper().eval(PropertyKeys.markup);
96      if (object != null) {
97        return Markup.valueOf(object);
98      }
99      return null;
100   }
101 
102   public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
103     getStateHelper().put(PropertyKeys.markup, markup);
104   }
105 
106   /**
107   Flag indicating whether and where the range pages should
108    rendered in the sheet's footer. Rendering this range also offers the
109    capability to enter the index displayed page directly.
110   <br>Default: <code>right</code><br>Allowed Values: <code>left,center,right,none</code>
111   */
112   public org.apache.myfaces.tobago.layout.ShowPosition getShowPageRange() {
113     org.apache.myfaces.tobago.layout.ShowPosition showPageRange = (org.apache.myfaces.tobago.layout.ShowPosition) getStateHelper().eval(PropertyKeys.showPageRange);
114     if (showPageRange != null) {
115       return showPageRange;
116     }
117     return org.apache.myfaces.tobago.layout.ShowPosition.right;
118   }
119 
120   public void setShowPageRange(org.apache.myfaces.tobago.layout.ShowPosition showPageRange) {
121     getStateHelper().put(PropertyKeys.showPageRange, showPageRange);
122   }
123 
124   /**
125   Flag indicating whether or not the paging panel should be display, if it is not needed for paging.<br>
126    <ul>
127    <li>showPagingAlways="false" which is the default means, that the paging footer should be displayed,
128    only when it is needed.
129    <ul>
130    <li>When the rows="0" paging is not needed, so the footer will not be rendered,
131    <li>when rows="N", N &gt; 0 and the size of the data value is &lt;= N paging is not needed
132    and the footer will not be rendered,
133    <li>in any other case the paging footer will be displayed.
134    </ul>
135    <li>showPagingAlways="true" means, that the paging footer should be displayed in any case.
136    </ul>
137   <br>Default: <code>false</code>
138   */
139   public boolean isShowPagingAlways() {
140     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.showPagingAlways);
141     if (bool != null) {
142       return bool;
143     }
144     return false;
145   }
146 
147   public void setShowPagingAlways(boolean showPagingAlways) {
148     getStateHelper().put(PropertyKeys.showPagingAlways, showPagingAlways);
149   }
150 
151   /**
152   The count of rendered direct paging links in the sheet's footer.<br>
153   <br>Default: <code>9</code>
154   */
155   public java.lang.Integer getDirectLinkCount() {
156     Number value  = (Number) getStateHelper().eval(PropertyKeys.directLinkCount);
157     if (value != null) {
158       return value.intValue();
159     }
160     return 9;
161   }
162 
163   public void setDirectLinkCount(java.lang.Integer directLinkCount) {
164     getStateHelper().put(PropertyKeys.directLinkCount, directLinkCount);
165   }
166 
167   /**
168   Only applicable in the case that the data model is a tree.
169    This flag indicates that the root node should be displayed with an open-close-switch.
170   <br>Default: <code>false</code>
171   */
172   public boolean isShowRootJunction() {
173     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.showRootJunction);
174     if (bool != null) {
175       return bool;
176     }
177     return false;
178   }
179 
180   public void setShowRootJunction(boolean showRootJunction) {
181     getStateHelper().put(PropertyKeys.showRootJunction, showRootJunction);
182   }
183 
184   /**
185   LayoutConstraints for column layout.
186    Semicolon separated list of layout tokens ('&lt;x&gt;*', '&lt;x&gt;px' or '&lt;x&gt;%') or "auto"
187 
188   */
189   public java.lang.String getColumns() {
190     return (java.lang.String) getStateHelper().eval(PropertyKeys.columns);
191   }
192 
193   public void setColumns(java.lang.String columns) {
194     getStateHelper().put(PropertyKeys.columns, columns);
195   }
196 
197   /**
198   Flag indicating the header should be rendered.
199   <br>Default: <code>true</code>
200   */
201   public boolean isShowHeader() {
202     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.showHeader);
203     if (bool != null) {
204       return bool;
205     }
206     return true;
207   }
208 
209   public void setShowHeader(boolean showHeader) {
210     getStateHelper().put(PropertyKeys.showHeader, showHeader);
211   }
212 
213   /**
214   Lazy loading by scroll event.
215   <br>Default: <code>false</code>
216   */
217   public boolean isLazy() {
218     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.lazy);
219     if (bool != null) {
220       return bool;
221     }
222     return false;
223   }
224 
225   public void setLazy(boolean lazy) {
226     getStateHelper().put(PropertyKeys.lazy, lazy);
227   }
228 
229   /**
230   Flag indicating if paging arrows are shown near page range
231   <br>Default: <code>true</code>
232   */
233   public boolean isShowPageRangeArrows() {
234     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.showPageRangeArrows);
235     if (bool != null) {
236       return bool;
237     }
238     return true;
239   }
240 
241   public void setShowPageRangeArrows(boolean showPageRangeArrows) {
242     getStateHelper().put(PropertyKeys.showPageRangeArrows, showPageRangeArrows);
243   }
244 
245   /**
246   Indicating the selection mode of the sheet.
247   <br>Default: <code>multi</code><br>Allowed Values: <code>none,single,singleOrNone,multi</code>
248   */
249   public org.apache.myfaces.tobago.model.Selectable getSelectable() {
250     org.apache.myfaces.tobago.model.Selectable selectable = (org.apache.myfaces.tobago.model.Selectable) getStateHelper().eval(PropertyKeys.selectable);
251     if (selectable != null) {
252       return selectable;
253     }
254     return org.apache.myfaces.tobago.model.Selectable.multi;
255   }
256 
257   public void setSelectable(org.apache.myfaces.tobago.model.Selectable selectable) {
258     getStateHelper().put(PropertyKeys.selectable, selectable);
259   }
260 
261   public javax.el.MethodExpression getSortActionListenerExpression() {
262     return (javax.el.MethodExpression) getStateHelper().eval(PropertyKeys.sortActionListener);
263   }
264 
265   public void setSortActionListenerExpression(javax.el.MethodExpression sortActionListener) {
266     getStateHelper().put(PropertyKeys.sortActionListener, sortActionListener);
267   }
268 
269 
270   /**
271   Flag indicating whether or not a range of direct paging links should be
272    rendered in the sheet's footer.
273   <br>Default: <code>center</code><br>Allowed Values: <code>left,center,right,none</code>
274   */
275   public org.apache.myfaces.tobago.layout.ShowPosition getShowDirectLinks() {
276     org.apache.myfaces.tobago.layout.ShowPosition showDirectLinks = (org.apache.myfaces.tobago.layout.ShowPosition) getStateHelper().eval(PropertyKeys.showDirectLinks);
277     if (showDirectLinks != null) {
278       return showDirectLinks;
279     }
280     return org.apache.myfaces.tobago.layout.ShowPosition.center;
281   }
282 
283   public void setShowDirectLinks(org.apache.myfaces.tobago.layout.ShowPosition showDirectLinks) {
284     getStateHelper().put(PropertyKeys.showDirectLinks, showDirectLinks);
285   }
286 
287   /**
288   Flag indicating if paging arrows are shown near direct links
289   <br>Default: <code>false</code>
290   */
291   public boolean isShowDirectLinksArrows() {
292     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.showDirectLinksArrows);
293     if (bool != null) {
294       return bool;
295     }
296     return false;
297   }
298 
299   public void setShowDirectLinksArrows(boolean showDirectLinksArrows) {
300     getStateHelper().put(PropertyKeys.showDirectLinksArrows, showDirectLinksArrows);
301   }
302 
303   /**
304   Only applicable in the case that the data model is a tree.
305    This flag indicates that the root node should be displayed.
306    Often in tree structures the root node is special and should not be displayed.
307   <br>Default: <code>false</code>
308   */
309   public boolean isShowRoot() {
310     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.showRoot);
311     if (bool != null) {
312       return bool;
313     }
314     return false;
315   }
316 
317   public void setShowRoot(boolean showRoot) {
318     getStateHelper().put(PropertyKeys.showRoot, showRoot);
319   }
320 
321   /**
322   Flag indicating whether or not the range of displayed rows should
323    rendered in the sheet's footer. Rendering this range also offers the
324    capability to enter the index of the start row directly.
325   <br>Default: <code>left</code><br>Allowed Values: <code>left,center,right,none</code>
326   */
327   public org.apache.myfaces.tobago.layout.ShowPosition getShowRowRange() {
328     org.apache.myfaces.tobago.layout.ShowPosition showRowRange = (org.apache.myfaces.tobago.layout.ShowPosition) getStateHelper().eval(PropertyKeys.showRowRange);
329     if (showRowRange != null) {
330       return showRowRange;
331     }
332     return org.apache.myfaces.tobago.layout.ShowPosition.left;
333   }
334 
335   public void setShowRowRange(org.apache.myfaces.tobago.layout.ShowPosition showRowRange) {
336     getStateHelper().put(PropertyKeys.showRowRange, showRowRange);
337   }
338 
339   /**
340   Sets a CSS class in its parent, if the parent supports it.
341 
342    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
343 
344    <pre>
345    &lt;tc:in&gt;
346      &lt;tc:style customClass="my-emphasized"/&gt;
347    &lt;/tc:in&gt;
348    </pre>
349 
350    One capability is, to used external CSS libs.
351    <br>
352    This feature should not be used imprudent.
353    Because it might be unstable against changes in the renderered HTML code.
354 
355   */
356   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
357     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
358   }
359 
360   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
361     getStateHelper().put(PropertyKeys.customClass, customClass);
362   }
363 
364   public javax.el.MethodExpression getStateChangeListenerExpression() {
365     return (javax.el.MethodExpression) getStateHelper().eval(PropertyKeys.stateChangeListener);
366   }
367 
368   public void setStateChangeListenerExpression(javax.el.MethodExpression stateChangeListener) {
369     getStateHelper().put(PropertyKeys.stateChangeListener, stateChangeListener);
370   }
371 
372 
373 
374   @Override
375   public void restoreState(FacesContext context, Object state) {
376     // FIXME HACK for mojarra SystemEventListener state restoring bug
377     pushComponentToEL(context, this);
378     super.restoreState(context, state);
379     popComponentFromEL(context);
380   }
381 
382 }