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.AbstractUIHidden;
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   Renders a hidden input element.
39    * UIComponent class, generated from template {@code component.stg} with class
40    * {@link org.apache.myfaces.tobago.internal.taglib.component.HiddenTagDeclaration}.
41   */
42  @Generated("component.stg")
43  public class UIHidden
44      extends AbstractUIHidden  {
45  
46    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Hidden";
47  
48    public static final String COMPONENT_FAMILY = "javax.faces.Input";
49  
50    private static final Collection<String> EVENT_NAMES = Arrays.asList("change");
51  
52    @Override
53    public Collection<String> getEventNames() {
54      return EVENT_NAMES;
55    }
56  
57    @Override
58    public String getDefaultEventName() {
59      return "change";
60    }
61  
62  
63    enum PropertyKeys {
64      readonly,
65      disabled,
66    }
67  
68    public String getFamily() {
69      return COMPONENT_FAMILY;
70    }
71  
72  
73    /**
74    Flag indicating that this component will prohibit changes by the user.
75    <br>Default: <code>false</code>
76    */
77    public boolean isReadonly() {
78      Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.readonly);
79      if (bool != null) {
80        return bool;
81      }
82      return false;
83    }
84  
85    public void setReadonly(boolean readonly) {
86      getStateHelper().put(PropertyKeys.readonly, readonly);
87    }
88  
89    /**
90    Flag indicating that this element is disabled.
91    <br>Default: <code>false</code>
92    */
93    public boolean isDisabled() {
94      Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
95      if (bool != null) {
96        return bool;
97      }
98      return false;
99    }
100 
101   public void setDisabled(boolean disabled) {
102     getStateHelper().put(PropertyKeys.disabled, disabled);
103   }
104 
105 
106   @Override
107   public void restoreState(FacesContext context, Object state) {
108     // FIXME HACK for mojarra SystemEventListener state restoring bug
109     pushComponentToEL(context, this);
110     super.restoreState(context, state);
111     popComponentFromEL(context);
112   }
113 
114 }