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