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.internal.component.AbstractUICommandBase;
24  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
25  import org.apache.myfaces.tobago.internal.util.StringUtils;
26  import org.apache.myfaces.tobago.internal.util.Deprecation;
27  import org.apache.myfaces.tobago.renderkit.MarginValues;
28  import org.apache.myfaces.tobago.renderkit.SpacingValues;
29  import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
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    * UIComponent class, generated from template {@code component2.0.stg} with class
39    * {@link org.apache.myfaces.tobago.internal.taglib.component.SelectBooleanCommandTagDeclaration}.
40   */
41  public class UISelectBooleanCommand
42      extends AbstractUICommandBase  {
43  
44    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.SelectBooleanCommand";
45  
46    public static final String COMPONENT_FAMILY = "";
47  
48  
49    enum PropertyKeys {
50      link,
51      resource,
52      jsfResource,
53      transition,
54      omit,
55      target,
56      renderedPartially,
57      onclick,
58      disabled,
59    }
60  
61    public String getFamily() {
62      return COMPONENT_FAMILY;
63    }
64  
65  
66    /**
67    Link to an arbitrary URL, either an internal link or an external link.
68  
69     <dl>
70       <dt>internal absolute link</dt>
71       <dd>Starts with a slash '/' character. The context path will be added.
72           A session id will be added, if needed.</dd>
73       <dt>external link</dt>
74       <dd>Contains a colon ':' character.
75           The link will not be modified.</dd>
76       <dt>internal relative link</dt>
77       <dd>Any other strings. A session id will be added, if needed.</dd>
78     </dl>
79  
80    */
81    public java.lang.String getLink() {
82      return (java.lang.String) getStateHelper().eval(PropertyKeys.link);
83    }
84  
85    public void setLink(java.lang.String link) {
86      getStateHelper().put(PropertyKeys.link, link);
87    }
88  
89    /**
90    Link to an internal resource.
91     Resources will be processed by the resource management.
92     E. g. define help.html and it will be served help_es.html or help_de.html if available.
93     For JSF-Pages you have to set the jsfResource attribute.
94  
95    */
96    public java.lang.String getResource() {
97      return (java.lang.String) getStateHelper().eval(PropertyKeys.resource);
98    }
99  
100   public void setResource(java.lang.String resource) {
101     getStateHelper().put(PropertyKeys.resource, resource);
102   }
103 
104   /**
105   Flag indicating that the resource referenced by the resource attribute is a jsf resource.
106    That means that the url has to be processed to change the prefix or suffix (e. g. *.jsf or
107    /faces/*). Default is false.
108   <br />Default: <code>false</code>
109   */
110   public boolean isJsfResource() {
111     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.jsfResource);
112     if (bool != null) {
113       return bool;
114     }
115     return false;
116   }
117 
118   public void setJsfResource(boolean jsfResource) {
119     getStateHelper().put(PropertyKeys.jsfResource, jsfResource);
120   }
121 
122   /**
123   Specify, if the command calls an JSF-Action.
124    Useful to switch off the Double-Submit-Check and Waiting-Behavior.
125   <br />Default: <code>true</code>
126   */
127   public boolean isTransition() {
128     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.transition);
129     if (bool != null) {
130       return bool;
131     }
132     return true;
133   }
134 
135   public void setTransition(boolean transition) {
136     getStateHelper().put(PropertyKeys.transition, transition);
137   }
138 
139   /**
140   Flag indicating that the action of this element, will not be executed from client side
141    (e. g. when the user clicks a button.
142    When setting this value to true, the action will not be executed by the Tobago, but it can executed
143    by JavaScript.
144    This attribute is useful, when you want to add JavaScript event handlers to commands manually.
145    In this case you usually don't want a submit with a full reload of the page.
146   <br />Default: <code>false</code>
147   */
148   public boolean isOmit() {
149     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.omit);
150     if (bool != null) {
151       return bool;
152     }
153     return false;
154   }
155 
156   public void setOmit(boolean omit) {
157     getStateHelper().put(PropertyKeys.omit, omit);
158   }
159 
160   /**
161   Name of a frame where the resource retrieved via this hyperlink is to be
162    displayed.
163 
164   */
165   public java.lang.String getTarget() {
166     return (java.lang.String) getStateHelper().eval(PropertyKeys.target);
167   }
168 
169   public void setTarget(java.lang.String target) {
170     getStateHelper().put(PropertyKeys.target, target);
171   }
172 
173   /**
174   Indicate the partially rendered Components in a case of a submit.
175 
176   */
177   public String[] getRenderedPartially() {
178     Object strArray = getStateHelper().eval(PropertyKeys.renderedPartially);
179     if (strArray != null) {
180       if (strArray instanceof String[]) {
181         return (String[]) strArray;
182       } else if (strArray instanceof String) {
183         String[] strings = StringUtils.split((String) strArray, ", ");
184         List<String> result = new ArrayList<String>(strings.length);
185         for (String string : strings) {
186           if (string.trim().length() != 0) {
187             result.add(string.trim());
188           }
189         }
190         return result.toArray(new String[result.size()]);
191       } else if (strArray == null) {
192         return org.apache.myfaces.tobago.internal.util.ArrayUtils.EMPTY_STRING_ARRAY;
193       } else {
194         return new String[]{strArray.toString()};
195       }
196     }
197     return org.apache.myfaces.tobago.internal.util.ArrayUtils.EMPTY_STRING_ARRAY;
198   }
199 
200   public void setRenderedPartially(String[] renderedPartially) {
201     getStateHelper().put(PropertyKeys.renderedPartially, renderedPartially);
202   }
203 
204   /**
205   Script to be invoked when clicked
206 
207   */
208   public java.lang.String getOnclick() {
209     return (java.lang.String) getStateHelper().eval(PropertyKeys.onclick);
210   }
211 
212   public void setOnclick(java.lang.String onclick) {
213     getStateHelper().put(PropertyKeys.onclick, onclick);
214   }
215 
216   /**
217   Flag indicating that this element is disabled.
218   <br />Default: <code>false</code>
219   */
220   public boolean isDisabled() {
221     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
222     if (bool != null) {
223       return bool;
224     }
225     return false;
226   }
227 
228   public void setDisabled(boolean disabled) {
229     getStateHelper().put(PropertyKeys.disabled, disabled);
230   }
231 
232 
233 
234 }