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