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.commons.lang.ArrayUtils;
25  import org.apache.commons.lang.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      renderedPartially,
52      target,
53      jsfResource,
54      resource,
55      transition,
56      onclick,
57    }
58  
59    public String getFamily() {
60      return COMPONENT_FAMILY;
61    }
62  
63  
64    /**
65    Link to an arbitrary URL, either an internal link or an external link.
66  
67     <dl>
68       <dt>internal absolute link</dt>
69       <dd>Starts with a slash '/' character. The context path will be added.
70           A session id will be added, if needed.</dd>
71       <dt>external link</dt>
72       <dd>Contains a colon ':' character.
73           The link will not be modified.</dd>
74       <dt>internal relative link</dt>
75       <dd>Any other strings. A session id will be added, if needed.</dd>
76     </dl>
77  
78    */
79    public java.lang.String getLink() {
80      return (java.lang.String) getStateHelper().eval(PropertyKeys.link);
81    }
82  
83    public void setLink(java.lang.String link) {
84      getStateHelper().put(PropertyKeys.link, link);
85    }
86  
87    /**
88    Indicate the partially rendered Components in a case of a submit.
89  
90    */
91    public String[] getRenderedPartially() {
92      Object strArray = getStateHelper().eval(PropertyKeys.renderedPartially);
93      if (strArray != null) {
94        if (strArray instanceof String[]) {
95          return (String[]) strArray;
96        } else if (strArray instanceof String) {
97          String[] strings = StringUtils.split((String) strArray, ", ");
98          List<String> result = new ArrayList<String>(strings.length);
99          for (String string : strings) {
100           if (string.trim().length() != 0) {
101             result.add(string.trim());
102           }
103         }
104         return result.toArray(new String[result.size()]);
105       } else if (strArray == null) {
106         return ArrayUtils.EMPTY_STRING_ARRAY;
107       } else {
108         return new String[]{strArray.toString()};
109       }
110     }
111     return ArrayUtils.EMPTY_STRING_ARRAY;
112   }
113 
114   public void setRenderedPartially(String[] renderedPartially) {
115     getStateHelper().put(PropertyKeys.renderedPartially, renderedPartially);
116   }
117 
118   /**
119   Name of a frame where the resource retrieved via this hyperlink is to be
120    displayed.
121 
122   */
123   public java.lang.String getTarget() {
124     return (java.lang.String) getStateHelper().eval(PropertyKeys.target);
125   }
126 
127   public void setTarget(java.lang.String target) {
128     getStateHelper().put(PropertyKeys.target, target);
129   }
130 
131   /**
132   Flag indicating that the resource referenced by the resource attribute is a jsf resource.
133    That means that the url has to be processed to change the prefix or suffix (e. g. *.jsf or
134    /faces/*). Default is false.
135   <br />Default: <code>false</code>
136   */
137   public boolean isJsfResource() {
138     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.jsfResource);
139     if (bool != null) {
140       return bool;
141     }
142     return false;
143   }
144 
145   public void setJsfResource(boolean jsfResource) {
146     getStateHelper().put(PropertyKeys.jsfResource, jsfResource);
147   }
148 
149   /**
150   Link to an internal resource.
151    Resources will be processed by the resource management.
152    E. g. define help.html and it will be served help_es.html or help_de.html if available.
153    For JSF-Pages you have to set the jsfResource attribute.
154 
155   */
156   public java.lang.String getResource() {
157     return (java.lang.String) getStateHelper().eval(PropertyKeys.resource);
158   }
159 
160   public void setResource(java.lang.String resource) {
161     getStateHelper().put(PropertyKeys.resource, resource);
162   }
163 
164   /**
165   Specify, if the command calls an JSF-Action.
166    Useful to switch off the Double-Submit-Check and Waiting-Behavior.
167   <br />Default: <code>true</code>
168   */
169   public boolean isTransition() {
170     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.transition);
171     if (bool != null) {
172       return bool;
173     }
174     return true;
175   }
176 
177   public void setTransition(boolean transition) {
178     getStateHelper().put(PropertyKeys.transition, transition);
179   }
180 
181   /**
182   Script to be invoked when clicked
183 
184   */
185   public java.lang.String getOnclick() {
186     return (java.lang.String) getStateHelper().eval(PropertyKeys.onclick);
187   }
188 
189   public void setOnclick(java.lang.String onclick) {
190     getStateHelper().put(PropertyKeys.onclick, onclick);
191   }
192 
193 
194 
195 }