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.AbstractUIProgress;
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 org.apache.myfaces.tobago.component.Tags;
30  import javax.annotation.Generated;
31  import javax.el.ELException;
32  import javax.faces.FacesException;
33  import java.util.Arrays;
34  import java.util.ArrayList;
35  import java.util.Collection;
36  import java.util.List;
37  import javax.el.MethodExpression;
38  import javax.el.ValueExpression;
39  
40  /**
41   Renders a progress bar.
42    * UIComponent class, generated from template {@code component.stg} with class
43    * {@link org.apache.myfaces.tobago.internal.taglib.component.ProgressTagDeclaration}.
44   */
45  @Generated("component.stg")
46  public class UIProgress
47      extends AbstractUIProgress  {
48  
49    public static final String COMPONENT_TYPE = Tags.progress.componentType();
50  
51    public static final String COMPONENT_FAMILY = "javax.faces.Output";
52  
53    private static final Collection<String> EVENT_NAMES = Arrays.asList("complete");
54  
55    @Override
56    public Collection<String> getEventNames() {
57      return EVENT_NAMES;
58    }
59  
60    @Override
61    public String getDefaultEventName() {
62      return "complete";
63    }
64  
65  
66    enum PropertyKeys {
67      markup,
68      max,
69      customClass,
70      tip,
71    }
72  
73    public String getFamily() {
74      return COMPONENT_FAMILY;
75    }
76  
77  
78    public org.apache.myfaces.tobago.context.Markup getMarkup() {
79      Object object = getStateHelper().eval(PropertyKeys.markup);
80      if (object != null) {
81        return Markup.valueOf(object);
82      }
83      return null;
84    }
85  
86    public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
87      getStateHelper().put(PropertyKeys.markup, markup);
88    }
89  
90    /**
91    The maximum of the value of the progress.
92  
93    */
94    public java.lang.Double getMax() {
95      return (java.lang.Double) getStateHelper().eval(PropertyKeys.max);
96    }
97  
98    public void setMax(java.lang.Double max) {
99      getStateHelper().put(PropertyKeys.max, max);
100   }
101 
102   /**
103   Sets a CSS class in its parent, if the parent supports it.
104 
105    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
106 
107    <pre>
108    &lt;tc:in&gt;
109      &lt;tc:style customClass="my-emphasized"/&gt;
110    &lt;/tc:in&gt;
111    </pre>
112 
113    One capability is, to used external CSS libs.
114    <br>
115    This feature should not be used imprudent.
116    Because it might be unstable against changes in the renderered HTML code.
117 
118   */
119   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
120     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
121   }
122 
123   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
124     getStateHelper().put(PropertyKeys.customClass, customClass);
125   }
126 
127   /**
128   Text value to display as tooltip.
129 
130   */
131   public java.lang.String getTip() {
132     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
133   }
134 
135   public void setTip(java.lang.String tip) {
136     getStateHelper().put(PropertyKeys.tip, tip);
137   }
138 
139 
140   @Override
141   public void restoreState(FacesContext context, Object state) {
142     // FIXME HACK for mojarra SystemEventListener state restoring bug
143     pushComponentToEL(context, this);
144     super.restoreState(context, state);
145     popComponentFromEL(context);
146   }
147 
148 }