001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements. See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership. The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License. You may obtain a copy of the License at
009 *
010 * http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied. See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019
020 package org.apache.myfaces.tobago.taglib.component;
021
022 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TIP_REFERENCE;
023 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ID_REFERENCE;
024 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_NAME_REFERENCE;
025 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_REQUIRED;
026 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SELECTABLE;
027 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STATE;
028 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_VALUE;
029 import org.apache.myfaces.tobago.component.ComponentUtil;
030 import org.apache.myfaces.tobago.component.UITreeListbox;
031
032 import javax.faces.component.UIComponent;
033
034 public class TreeListboxTag extends TobagoTag
035 implements TreeListboxTagDeclaration {
036
037 private String value;
038 private String state;
039 private String idReference;
040 private String nameReference;
041 private String tipReference;
042 private String selectable;
043 private String required;
044
045 public String getComponentType() {
046 return UITreeListbox.COMPONENT_TYPE;
047 }
048
049 protected void setProperties(UIComponent component) {
050 super.setProperties(component);
051 ComponentUtil.setStringProperty(component, ATTR_VALUE, value);
052 ComponentUtil.setValueBinding(component, ATTR_STATE, state);
053 ComponentUtil.setStringProperty(component, ATTR_ID_REFERENCE, idReference);
054 ComponentUtil.setStringProperty(component, ATTR_NAME_REFERENCE, nameReference);
055 ComponentUtil.setStringProperty(component, ATTR_SELECTABLE, selectable);
056 ComponentUtil.setBooleanProperty(component, ATTR_REQUIRED, required);
057 ComponentUtil.setStringProperty(component, ATTR_TIP_REFERENCE, tipReference);
058
059 }
060
061 public void release() {
062 super.release();
063 value = null;
064 state = null;
065 idReference = null;
066 nameReference = null;
067 tipReference = null;
068 selectable = null;
069 required = null;
070 }
071
072 public String getValue() {
073 return value;
074 }
075
076 public void setValue(String value) {
077 this.value = value;
078 }
079
080 public String getState() {
081 return state;
082 }
083
084 public void setState(String state) {
085 this.state = state;
086 }
087
088 public String getIdReference() {
089 return idReference;
090 }
091
092 public void setIdReference(String idReference) {
093 this.idReference = idReference;
094 }
095
096 public String getNameReference() {
097 return nameReference;
098 }
099
100 public void setNameReference(String nameReference) {
101 this.nameReference = nameReference;
102 }
103
104 public String getSelectable() {
105 return selectable;
106 }
107
108 public void setSelectable(String selectable) {
109 this.selectable = selectable;
110 }
111
112 public String getRequired() {
113 return required;
114 }
115
116 public void setRequired(String required) {
117 this.required = required;
118 }
119
120 public void setTipReference(String tipReference) {
121 this.tipReference = tipReference;
122 }
123 }
124