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 javax.el.ELException;
33  import javax.faces.FacesException;
34  import java.util.Arrays;
35  import java.util.ArrayList;
36  import java.util.Collection;
37  import java.util.List;
38  import javax.el.MethodExpression;
39  import javax.el.ValueExpression;
40  
41  /** 
42   Render a sheet element.
43    * UIComponent class, generated from template {@code component.stg} with class
44    * {@link org.apache.myfaces.tobago.internal.taglib.component.SheetTagDeclaration}.
45   */
46  public class UISheet
47      extends AbstractUISheet implements Visual {
48  
49    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Sheet";
50  
51    public static final String COMPONENT_FAMILY = "javax.faces.Data";
52  
53    private static final Collection<String> EVENT_NAMES = Arrays.asList("reload");
54  
55    @Override
56    public Collection<String> getEventNames() {
57      return EVENT_NAMES;
58    }
59  
60    @Override
61    public String getDefaultEventName() {
62      return "reload";
63    }
64  
65  
66    enum PropertyKeys {
67      markup,
68      showPageRange,
69      showPagingAlways,
70      directLinkCount,
71      showRootJunction,
72      columns,
73      showHeader,
74      showPageRangeArrows,
75      selectable,
76      sortActionListener,
77      showDirectLinks,
78      showDirectLinksArrows,
79      showRoot,
80      showRowRange,
81      customClass,
82      stateChangeListener,
83    }
84  
85    public String getFamily() {
86      return COMPONENT_FAMILY;
87    }
88  
89  
90    public org.apache.myfaces.tobago.context.Markup getMarkup() {
91      Object object = getStateHelper().eval(PropertyKeys.markup);
92      if (object != null) {
93        return Markup.valueOf(object);
94      }
95      return null;
96    }
97  
98    public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
99      getStateHelper().put(PropertyKeys.markup, markup);
100   }
101 
102   /**
103   Flag indicating whether and where the range pages should
104    rendered in the sheet's footer. Rendering this range also offers the
105    capability to enter the index displayed page directly.
106   <br>Default: <code>right</code><br>Allowed Values: <code>left,center,right,none</code>
107   */
108   public org.apache.myfaces.tobago.layout.ShowPosition getShowPageRange() {
109     org.apache.myfaces.tobago.layout.ShowPosition showPageRange = (org.apache.myfaces.tobago.layout.ShowPosition) getStateHelper().eval(PropertyKeys.showPageRange);
110     if (showPageRange != null) {
111       return showPageRange;
112     }
113     return org.apache.myfaces.tobago.layout.ShowPosition.right;
114   }
115 
116   public void setShowPageRange(org.apache.myfaces.tobago.layout.ShowPosition showPageRange) {
117     getStateHelper().put(PropertyKeys.showPageRange, showPageRange);
118   }
119 
120   /**
121   Flag indicating whether or not the paging panel should be display, if it is not needed for paging.<br>
122    <ul>
123    <li>showPagingAlways="false" which is the default means, that the paging footer should be displayed,
124    only when it is needed.
125    <ul>
126    <li>When the rows="0" paging is not needed, so the footer will not be rendered,
127    <li>when rows="N", N &gt; 0 and the size of the data value is &lt;= N paging is not needed
128    and the footer will not be rendered,
129    <li>in any other case the paging footer will be displayed.
130    </ul>
131    <li>showPagingAlways="true" means, that the paging footer should be displayed in any case.
132    </ul>
133   <br>Default: <code>false</code>
134   */
135   public boolean isShowPagingAlways() {
136     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.showPagingAlways);
137     if (bool != null) {
138       return bool;
139     }
140     return false;
141   }
142 
143   public void setShowPagingAlways(boolean showPagingAlways) {
144     getStateHelper().put(PropertyKeys.showPagingAlways, showPagingAlways);
145   }
146 
147   /**
148   The count of rendered direct paging links in the sheet's footer.<br>
149   <br>Default: <code>9</code>
150   */
151   public java.lang.Integer getDirectLinkCount() {
152     Number value  = (Number) getStateHelper().eval(PropertyKeys.directLinkCount);
153     if (value != null) {
154       return value.intValue();
155     }
156     return 9;
157   }
158 
159   public void setDirectLinkCount(java.lang.Integer directLinkCount) {
160     getStateHelper().put(PropertyKeys.directLinkCount, directLinkCount);
161   }
162 
163   /**
164   Only applicable in the case that the data model is a tree.
165    This flag indicates that the root node should be displayed with an open-close-switch.
166   <br>Default: <code>false</code>
167   */
168   public boolean isShowRootJunction() {
169     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.showRootJunction);
170     if (bool != null) {
171       return bool;
172     }
173     return false;
174   }
175 
176   public void setShowRootJunction(boolean showRootJunction) {
177     getStateHelper().put(PropertyKeys.showRootJunction, showRootJunction);
178   }
179 
180   /**
181   LayoutConstraints for column layout.
182    Semicolon separated list of layout tokens ('&lt;x&gt;*', '&lt;x&gt;px' or '&lt;x&gt;%') or "auto"
183 
184   */
185   public java.lang.String getColumns() {
186     return (java.lang.String) getStateHelper().eval(PropertyKeys.columns);
187   }
188 
189   public void setColumns(java.lang.String columns) {
190     getStateHelper().put(PropertyKeys.columns, columns);
191   }
192 
193   /**
194   Flag indicating the header should be rendered.
195   <br>Default: <code>true</code>
196   */
197   public boolean isShowHeader() {
198     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.showHeader);
199     if (bool != null) {
200       return bool;
201     }
202     return true;
203   }
204 
205   public void setShowHeader(boolean showHeader) {
206     getStateHelper().put(PropertyKeys.showHeader, showHeader);
207   }
208 
209   /**
210   Flag indicating if paging arrows are shown near page range
211   <br>Default: <code>true</code>
212   */
213   public boolean isShowPageRangeArrows() {
214     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.showPageRangeArrows);
215     if (bool != null) {
216       return bool;
217     }
218     return true;
219   }
220 
221   public void setShowPageRangeArrows(boolean showPageRangeArrows) {
222     getStateHelper().put(PropertyKeys.showPageRangeArrows, showPageRangeArrows);
223   }
224 
225   /**
226   Indicating the selection mode of the sheet.
227   <br>Default: <code>multi</code><br>Allowed Values: <code>none,single,singleOrNone,multi</code>
228   */
229   public org.apache.myfaces.tobago.model.Selectable getSelectable() {
230     org.apache.myfaces.tobago.model.Selectable selectable = (org.apache.myfaces.tobago.model.Selectable) getStateHelper().eval(PropertyKeys.selectable);
231     if (selectable != null) {
232       return selectable;
233     }
234     return org.apache.myfaces.tobago.model.Selectable.multi;
235   }
236 
237   public void setSelectable(org.apache.myfaces.tobago.model.Selectable selectable) {
238     getStateHelper().put(PropertyKeys.selectable, selectable);
239   }
240 
241   public javax.el.MethodExpression getSortActionListenerExpression() {
242     return (javax.el.MethodExpression) getStateHelper().eval(PropertyKeys.sortActionListener);
243   }
244 
245   public void setSortActionListenerExpression(javax.el.MethodExpression sortActionListener) {
246     getStateHelper().put(PropertyKeys.sortActionListener, sortActionListener);
247   }
248 
249 
250   /**
251   Flag indicating whether or not a range of direct paging links should be
252    rendered in the sheet's footer.
253   <br>Default: <code>center</code><br>Allowed Values: <code>left,center,right,none</code>
254   */
255   public org.apache.myfaces.tobago.layout.ShowPosition getShowDirectLinks() {
256     org.apache.myfaces.tobago.layout.ShowPosition showDirectLinks = (org.apache.myfaces.tobago.layout.ShowPosition) getStateHelper().eval(PropertyKeys.showDirectLinks);
257     if (showDirectLinks != null) {
258       return showDirectLinks;
259     }
260     return org.apache.myfaces.tobago.layout.ShowPosition.center;
261   }
262 
263   public void setShowDirectLinks(org.apache.myfaces.tobago.layout.ShowPosition showDirectLinks) {
264     getStateHelper().put(PropertyKeys.showDirectLinks, showDirectLinks);
265   }
266 
267   /**
268   Flag indicating if paging arrows are shown near direct links
269   <br>Default: <code>false</code>
270   */
271   public boolean isShowDirectLinksArrows() {
272     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.showDirectLinksArrows);
273     if (bool != null) {
274       return bool;
275     }
276     return false;
277   }
278 
279   public void setShowDirectLinksArrows(boolean showDirectLinksArrows) {
280     getStateHelper().put(PropertyKeys.showDirectLinksArrows, showDirectLinksArrows);
281   }
282 
283   /**
284   Only applicable in the case that the data model is a tree.
285    This flag indicates that the root node should be displayed.
286    Often in tree structures the root node is special and should not be displayed.
287   <br>Default: <code>false</code>
288   */
289   public boolean isShowRoot() {
290     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.showRoot);
291     if (bool != null) {
292       return bool;
293     }
294     return false;
295   }
296 
297   public void setShowRoot(boolean showRoot) {
298     getStateHelper().put(PropertyKeys.showRoot, showRoot);
299   }
300 
301   /**
302   Flag indicating whether or not the range of displayed rows should
303    rendered in the sheet's footer. Rendering this range also offers the
304    capability to enter the index of the start row directly.
305   <br>Default: <code>left</code><br>Allowed Values: <code>left,center,right,none</code>
306   */
307   public org.apache.myfaces.tobago.layout.ShowPosition getShowRowRange() {
308     org.apache.myfaces.tobago.layout.ShowPosition showRowRange = (org.apache.myfaces.tobago.layout.ShowPosition) getStateHelper().eval(PropertyKeys.showRowRange);
309     if (showRowRange != null) {
310       return showRowRange;
311     }
312     return org.apache.myfaces.tobago.layout.ShowPosition.left;
313   }
314 
315   public void setShowRowRange(org.apache.myfaces.tobago.layout.ShowPosition showRowRange) {
316     getStateHelper().put(PropertyKeys.showRowRange, showRowRange);
317   }
318 
319   /**
320   Sets a CSS class in its parent, if the parent supports it.
321 
322    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
323 
324    <pre>
325    &lt;tc:in&gt;
326      &lt;tc:style customClass="my-emphasized"/&gt;
327    &lt;/tc:in&gt;
328    </pre>
329 
330    One capability is, to used external CSS libs.
331    <br>
332    This feature should not be used imprudent.
333    Because it might be unstable against changes in the renderered HTML code.
334 
335   */
336   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
337     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
338   }
339 
340   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
341     getStateHelper().put(PropertyKeys.customClass, customClass);
342   }
343 
344   public javax.el.MethodExpression getStateChangeListenerExpression() {
345     return (javax.el.MethodExpression) getStateHelper().eval(PropertyKeys.stateChangeListener);
346   }
347 
348   public void setStateChangeListenerExpression(javax.el.MethodExpression stateChangeListener) {
349     getStateHelper().put(PropertyKeys.stateChangeListener, stateChangeListener);
350   }
351 
352 
353 
354 }