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.faces.context.FacesContext;
23  import org.apache.myfaces.tobago.context.Markup;
24  import org.apache.myfaces.tobago.internal.component.AbstractUITreeCommand;
25  import org.apache.myfaces.tobago.renderkit.css.CustomClass;
26  import org.apache.myfaces.tobago.renderkit.css.Style;
27  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
28  import org.apache.myfaces.tobago.internal.util.StringUtils;
29  import org.apache.myfaces.tobago.internal.util.Deprecation;
30  import javax.el.ELException;
31  import javax.faces.FacesException;
32  import java.util.ArrayList;
33  import java.util.List;
34  import javax.el.MethodExpression;
35  import javax.el.ValueExpression;
36  
37  /** 
38   Renders a command inside of a tree.
39    * UIComponent class, generated from template {@code component.stg} with class
40    * {@link org.apache.myfaces.tobago.internal.taglib.component.TreeCommandTagDeclaration}.
41   */
42  public class UITreeCommand
43      extends AbstractUITreeCommand implements SupportsAccessKey, Visual {
44  
45    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.TreeCommand";
46  
47    public static final String COMPONENT_FAMILY = "javax.faces.Command";
48  
49  
50    enum PropertyKeys {
51      markup,
52      resource,
53      link,
54      tabIndex,
55      confirmation,
56      label,
57      transition,
58      target,
59      jsfResource,
60      accessKey,
61      customClass,
62      tip,
63      style,
64      omit,
65    }
66  
67    public String getFamily() {
68      return COMPONENT_FAMILY;
69    }
70  
71  
72    public org.apache.myfaces.tobago.context.Markup getMarkup() {
73      Object object = getStateHelper().eval(PropertyKeys.markup);
74      if (object != null) {
75        return Markup.valueOf(object);
76      }
77      return null;
78    }
79  
80    public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
81      getStateHelper().put(PropertyKeys.markup, markup);
82    }
83  
84    /**
85    Link to an internal resource.
86     Resources will be processed by the resource management.
87     E. g. define help.html and it will be served help_es.html or help_de.html if available.
88     For JSF-Pages you have to set the jsfResource attribute.
89  
90    */
91    public java.lang.String getResource() {
92      return (java.lang.String) getStateHelper().eval(PropertyKeys.resource);
93    }
94  
95    public void setResource(java.lang.String resource) {
96      getStateHelper().put(PropertyKeys.resource, resource);
97    }
98  
99    /**
100   Link to an arbitrary URL, either an internal link or an external link.
101 
102    <dl>
103      <dt>internal absolute link</dt>
104      <dd>Starts with a slash '/' character. The context path will be added.
105          A session id will be added, if needed.</dd>
106      <dt>external link</dt>
107      <dd>Starts with protocol followed by a colon ':' character.
108          The link will not be modified.</dd>
109      <dt>internal relative link</dt>
110      <dd>Any other strings. A session id will be added, if needed.</dd>
111    </dl>
112 
113   */
114   public java.lang.String getLink() {
115     return (java.lang.String) getStateHelper().eval(PropertyKeys.link);
116   }
117 
118   public void setLink(java.lang.String link) {
119     getStateHelper().put(PropertyKeys.link, link);
120   }
121 
122   /**
123   Controls the navigation of the focus through the
124    input controls on a page with the Tab-Key.
125    The navigation starts from the element with
126    the lowest tabIndex value to the element with the highest value.
127    Elements that have identical tabIndex values should be navigated
128    in the order they appear in the character stream
129    Elements that are disabled or with a negative tabIndex
130    do not participate in the tabbing order.
131 
132   */
133   public java.lang.Integer getTabIndex() {
134     Number value  = (Number) getStateHelper().eval(PropertyKeys.tabIndex);
135     if (value != null) {
136       return value.intValue();
137     }
138     return null;
139   }
140 
141   public void setTabIndex(java.lang.Integer tabIndex) {
142     getStateHelper().put(PropertyKeys.tabIndex, tabIndex);
143   }
144 
145   /**
146   Text to use as confirmation message.
147 
148   */
149   public java.lang.String getConfirmation() {
150     return (java.lang.String) getStateHelper().eval(PropertyKeys.confirmation);
151   }
152 
153   public void setConfirmation(java.lang.String confirmation) {
154     getStateHelper().put(PropertyKeys.confirmation, confirmation);
155   }
156 
157   /**
158   Text value to display as label.
159    If text contains an underscore the next character is used as accesskey (if configured so and possible).
160 
161   */
162   public java.lang.String getLabel() {
163     return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
164   }
165 
166   public void setLabel(java.lang.String label) {
167     getStateHelper().put(PropertyKeys.label, label);
168   }
169 
170   /**
171   Specify, if the command calls an JSF-Action.
172    Useful to switch off the Double-Submit-Check and Waiting-Behavior.
173   <br>Default: <code>true</code>
174   */
175   public boolean isTransition() {
176     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.transition);
177     if (bool != null) {
178       return bool;
179     }
180     return true;
181   }
182 
183   public void setTransition(boolean transition) {
184     getStateHelper().put(PropertyKeys.transition, transition);
185   }
186 
187   /**
188   Name of a frame where the resource retrieved via this hyperlink is to be
189    displayed.
190 
191   */
192   public java.lang.String getTarget() {
193     return (java.lang.String) getStateHelper().eval(PropertyKeys.target);
194   }
195 
196   public void setTarget(java.lang.String target) {
197     getStateHelper().put(PropertyKeys.target, target);
198   }
199 
200   /**
201   Flag indicating that the resource referenced by the resource attribute is a jsf resource.
202    That means that the url has to be processed to change the prefix or suffix (e. g. *.jsf or
203    /faces/*). Default is false.
204   <br>Default: <code>false</code>
205   */
206   public boolean isJsfResource() {
207     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.jsfResource);
208     if (bool != null) {
209       return bool;
210     }
211     return false;
212   }
213 
214   public void setJsfResource(boolean jsfResource) {
215     getStateHelper().put(PropertyKeys.jsfResource, jsfResource);
216   }
217 
218   /**
219   The access key of this control.
220 
221   */
222   public java.lang.Character getAccessKey() {
223     return (java.lang.Character) getStateHelper().eval(PropertyKeys.accessKey);
224   }
225 
226   public void setAccessKey(java.lang.Character accessKey) {
227     getStateHelper().put(PropertyKeys.accessKey, accessKey);
228   }
229 
230   /**
231   Sets a CSS class in its parent, if the parent supports it.
232 
233    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
234 
235    <pre>
236    &lt;tc:in&gt;
237      &lt;tc:style customClass="my-emphasized"/&gt;
238    &lt;/tc:in&gt;
239    </pre>
240 
241    One capability is, to used external CSS libs.
242    <br>
243    This feature should not be used imprudent.
244    Because it might be unstable against changes in the renderered HTML code.
245 
246   */
247   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
248     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
249   }
250 
251   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
252     getStateHelper().put(PropertyKeys.customClass, customClass);
253   }
254 
255   /**
256   Text value to display as tooltip.
257 
258   */
259   public java.lang.String getTip() {
260     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
261   }
262 
263   public void setTip(java.lang.String tip) {
264     getStateHelper().put(PropertyKeys.tip, tip);
265   }
266 
267   /**
268   For internal use. Used for rendering, if there is a child tag &lt;tc:style&gt;
269 
270   */
271   public org.apache.myfaces.tobago.renderkit.css.Style getStyle() {
272     return (org.apache.myfaces.tobago.renderkit.css.Style) getStateHelper().eval(PropertyKeys.style);
273   }
274 
275   public void setStyle(org.apache.myfaces.tobago.renderkit.css.Style style) {
276     getStateHelper().put(PropertyKeys.style, style);
277   }
278 
279   /**
280   Flag indicating that the action of this element, will not be executed from client side
281    (e. g. when the user clicks a button.
282    When setting this value to true, the action will not be executed by the Tobago, but it can executed
283    by JavaScript.
284    This attribute is useful, when you want to add JavaScript event handlers to commands manually.
285    In this case you usually don't want a submit with a full reload of the page.
286   <br>Default: <code>false</code>
287   */
288   public boolean isOmit() {
289     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.omit);
290     if (bool != null) {
291       return bool;
292     }
293     return false;
294   }
295 
296   public void setOmit(boolean omit) {
297     getStateHelper().put(PropertyKeys.omit, omit);
298   }
299 
300 
301 }