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