1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.myfaces.tobago.component;
21
22 import javax.faces.context.FacesContext;
23 import org.apache.commons.lang.ArrayUtils;
24 import org.apache.commons.lang.StringUtils;
25 import org.apache.myfaces.tobago.component.MethodBindingToMethodExpression;
26 import org.apache.myfaces.tobago.component.MethodExpressionToMethodBinding;
27 import org.apache.myfaces.tobago.internal.util.Deprecation;
28 import org.apache.myfaces.tobago.renderkit.MarginValues;
29 import org.apache.myfaces.tobago.renderkit.SpacingValues;
30 import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
31 import javax.el.ELException;
32 import javax.faces.FacesException;
33 import java.util.ArrayList;
34 import java.util.List;
35 import javax.el.MethodExpression;
36 import javax.el.ValueExpression;
37
38
39
40
41
42 public class UISelectOneCommand
43 extends UICommand {
44
45 public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.SelectOneCommand";
46
47 private java.lang.Boolean immediate;
48 private java.lang.Boolean jsfResource;
49 private java.lang.Boolean transition;
50
51
52
53
54
55
56
57
58
59 public boolean isImmediate() {
60 if (immediate != null) {
61 return immediate;
62 }
63 ValueExpression ve = getValueExpression("immediate");
64 if (ve != null) {
65 try {
66 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
67 if (bool != null) {
68 return bool;
69 }
70 } catch (ELException e) {
71 throw new FacesException(e);
72 }
73 }
74 return false;
75 }
76
77 public void setImmediate(boolean immediate) {
78 this.immediate = immediate;
79 }
80
81
82
83
84
85
86
87 public boolean isJsfResource() {
88 if (jsfResource != null) {
89 return jsfResource;
90 }
91 ValueExpression ve = getValueExpression("jsfResource");
92 if (ve != null) {
93 try {
94 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
95 if (bool != null) {
96 return bool;
97 }
98 } catch (ELException e) {
99 throw new FacesException(e);
100 }
101 }
102 return false;
103 }
104
105 public void setJsfResource(boolean jsfResource) {
106 this.jsfResource = jsfResource;
107 }
108
109
110
111
112
113
114 public boolean isTransition() {
115 if (transition != null) {
116 return transition;
117 }
118 ValueExpression ve = getValueExpression("transition");
119 if (ve != null) {
120 try {
121 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
122 if (bool != null) {
123 return bool;
124 }
125 } catch (ELException e) {
126 throw new FacesException(e);
127 }
128 }
129 return true;
130 }
131
132 public void setTransition(boolean transition) {
133 this.transition = transition;
134 }
135
136 public void restoreState(FacesContext context, Object componentState) {
137 Object[] values = (Object[]) componentState;
138 super.restoreState(context, values[0]);
139 immediate = (java.lang.Boolean) values[1];
140 jsfResource = (java.lang.Boolean) values[2];
141 transition = (java.lang.Boolean) values[3];
142 }
143
144 public Object saveState(FacesContext context) {
145 Object[] values = new Object[4];
146 values[0] = super.saveState(context);
147 values[1] = immediate;
148 values[2] = jsfResource;
149 values[3] = transition;
150 return values;
151 }
152
153
154 }