001 // ---------- Attention: Generated code, please do not modify! ----------- 002 003 /* 004 * Licensed to the Apache Software Foundation (ASF) under one or more 005 * contributor license agreements. See the NOTICE file distributed with 006 * this work for additional information regarding copyright ownership. 007 * The ASF licenses this file to You under the Apache License, Version 2.0 008 * (the "License"); you may not use this file except in compliance with 009 * the License. You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, software 014 * distributed under the License is distributed on an "AS IS" BASIS, 015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 016 * See the License for the specific language governing permissions and 017 * limitations under the License. 018 */ 019 020 package org.apache.myfaces.tobago.component; 021 022 import javax.faces.context.FacesContext; 023 import org.apache.commons.lang.ArrayUtils; 024 import org.apache.commons.lang.StringUtils; 025 import org.apache.myfaces.tobago.component.MethodBindingToMethodExpression; 026 import org.apache.myfaces.tobago.component.MethodExpressionToMethodBinding; 027 import org.apache.myfaces.tobago.internal.util.Deprecation; 028 import org.apache.myfaces.tobago.renderkit.MarginValues; 029 import org.apache.myfaces.tobago.renderkit.SpacingValues; 030 import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer; 031 import javax.el.ELException; 032 import javax.faces.FacesException; 033 import java.util.ArrayList; 034 import java.util.List; 035 import javax.el.MethodExpression; 036 import javax.el.ValueExpression; 037 038 /** 039 Renders a set of radio command button's within a toolbar. 040 * UIComponent class, generated from template {@code component1.2.stg} with class 041 * {@link org.apache.myfaces.tobago.internal.taglib.component.ToolBarSelectOneTagDeclaration}. 042 */ 043 public class UIToolBarSelectOne 044 extends UISelectOneCommand { 045 046 public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.ToolBarSelectOne"; 047 048 private java.lang.Boolean disabled; 049 050 051 /** 052 Flag indicating that this element is disabled. 053 <br />Default: <code>false</code> 054 */ 055 public boolean isDisabled() { 056 if (disabled != null) { 057 return disabled; 058 } 059 ValueExpression ve = getValueExpression("disabled"); 060 if (ve != null) { 061 try { 062 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext()); 063 if (bool != null) { 064 return bool; 065 } 066 } catch (ELException e) { 067 throw new FacesException(e); 068 } 069 } 070 return false; 071 } 072 073 public void setDisabled(boolean disabled) { 074 this.disabled = disabled; 075 } 076 077 public void restoreState(FacesContext context, Object componentState) { 078 Object[] values = (Object[]) componentState; 079 super.restoreState(context, values[0]); 080 disabled = (java.lang.Boolean) values[1]; 081 } 082 083 public Object saveState(FacesContext context) { 084 Object[] values = new Object[2]; 085 values[0] = super.saveState(context); 086 values[1] = disabled; 087 return values; 088 } 089 090 091 }