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.component.UIComponentBase;
23  import javax.faces.context.FacesContext;
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 javax.el.ELException;
28  import javax.faces.FacesException;
29  import java.util.ArrayList;
30  import java.util.List;
31  import javax.el.MethodExpression;
32  import javax.el.ValueExpression;
33  
34  /** 
35   Update the parent component
36    * UIComponent class, generated from template {@code component.stg} with class
37    * {@link org.apache.myfaces.tobago.internal.taglib.component.ReloadTagDeclaration}.
38   */
39  public class UIReload
40      extends UIComponentBase  {
41  
42    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Reload";
43  
44    public static final String COMPONENT_FAMILY = "org.apache.myfaces.tobago.Reload";
45  
46  
47    enum PropertyKeys {
48      immediate,
49      update,
50      frequency,
51    }
52  
53    public String getFamily() {
54      return COMPONENT_FAMILY;
55    }
56  
57  
58    /**
59    Flag indicating that
60     the update check should be performed
61     immediately (that is, during Apply Request Values phase) rather than
62     waiting until Render Response phase.
63    <br>Default: <code>true</code>
64    */
65    public boolean isImmediate() {
66      Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.immediate);
67      if (bool != null) {
68        return bool;
69      }
70      return true;
71    }
72  
73    public void setImmediate(boolean immediate) {
74      getStateHelper().put(PropertyKeys.immediate, immediate);
75    }
76  
77    /**
78    Is update required.
79    <br>Default: <code>true</code>
80    */
81    public boolean isUpdate() {
82      Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.update);
83      if (bool != null) {
84        return bool;
85      }
86      return true;
87    }
88  
89    public void setUpdate(boolean update) {
90      getStateHelper().put(PropertyKeys.update, update);
91    }
92  
93    /**
94    Time in milliseconds after which the parent component is automatically reloaded.
95    <br>Default: <code>5000</code>
96    */
97    public java.lang.Integer getFrequency() {
98      Number value  = (Number) getStateHelper().eval(PropertyKeys.frequency);
99      if (value != null) {
100       return value.intValue();
101     }
102     return 5000;
103   }
104 
105   public void setFrequency(java.lang.Integer frequency) {
106     getStateHelper().put(PropertyKeys.frequency, frequency);
107   }
108 
109 
110 }