1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 package org.apache.myfaces.custom.radio; 20 21 import javax.faces.component.UIComponentBase; 22 23 import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty; 24 import org.apache.myfaces.component.AccesskeyProperty; 25 import org.apache.myfaces.component.AlignProperty; 26 import org.apache.myfaces.component.AltProperty; 27 import org.apache.myfaces.component.ChangeSelectProperties; 28 import org.apache.myfaces.component.DisabledClassEnabledClassProperties; 29 import org.apache.myfaces.component.EventAware; 30 import org.apache.myfaces.component.FocusBlurProperties; 31 import org.apache.myfaces.component.StyleAware; 32 import org.apache.myfaces.component.TabindexProperty; 33 import org.apache.myfaces.component.UniversalProperties; 34 import org.apache.myfaces.component.UserRoleAware; 35 36 /** 37 * This tag is used in conjunction with the extended selectOneRadio 38 * tag when the "spread" layout is selected. It specifies the 39 * position within the document that the radio button corresponding 40 * to a specific SelectItem should be rendered. All HTML pass-through 41 * attributes for this input are taken from the associated 42 * selectOneRadio. 43 * 44 * Unless otherwise specified, all attributes accept static values or EL expressions. 45 * 46 * @JSFComponent 47 * name = "t:radio" 48 * class = "org.apache.myfaces.custom.radio.HtmlRadio" 49 * tagClass = "org.apache.myfaces.custom.radio.HtmlRadioTag" 50 * @since 1.1.7 51 * @author Thomas Spiegl (latest modification by $Author: lu4242 $) 52 * @version $Revision: 691856 $ $Date: 2008-09-03 21:40:30 -0500 (miƩ, 03 sep 2008) $ 53 */ 54 public abstract class AbstractHtmlRadio 55 extends UIComponentBase implements UserRoleAware, 56 FocusBlurProperties, ChangeSelectProperties, 57 UniversalProperties, EventAware, AltProperty, 58 AlignProperty, StyleAware, AccesskeyProperty, TabindexProperty, DisabledClassEnabledClassProperties 59 { 60 //private static final Log log = LogFactory.getLog(HtmlRadio.class); 61 62 public static final String FOR_ATTR = "for".intern(); 63 public static final String INDEX_ATTR = "index".intern(); 64 65 66 public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlRadio"; 67 public static final String COMPONENT_FAMILY = "org.apache.myfaces.Radio"; 68 private static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.Radio"; 69 70 /** 71 * The id of the referenced extended selectOneRadio component. 72 * This value is resolved to the particular component using 73 * the standard UIComponent.findComponent() searching algorithm. 74 * 75 * @JSFProperty 76 * required="true" 77 */ 78 public abstract String getFor(); 79 80 /** 81 * The index of the corresponding SelectItem, where 0 represents the first SelectItem. 82 * 83 * @JSFProperty 84 * defaultValue = "Integer.MIN_VALUE" 85 * required="true" 86 */ 87 public abstract int getIndex(); 88 89 /** 90 * If this property is set to true, the id generated for the input html markup 91 * will be the logical id composed from the clientId of the associated 92 * selectOneRadio and the index of this component (for example 'myComp:2'). 93 * 94 * <p> 95 * NOTE: This is provided only for backward compatibility with tomahawk 1.2. 96 * Activate this behavior will make client behaviors added to 97 * t:selectOneRadio like f:ajax or others fail, because the logical id 98 * has no counterpart in the component tree. 99 * </p> 100 * 101 * @return 102 */ 103 @JSFProperty(defaultValue="false") 104 public abstract boolean isRenderLogicalId(); 105 106 107 }