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