001 package org.apache.myfaces.tobago.taglib.component;
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 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TIP_REFERENCE;
021 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ID_REFERENCE;
022 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_NAME_REFERENCE;
023 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_REQUIRED;
024 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SELECTABLE;
025 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STATE;
026 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_VALUE;
027 import org.apache.myfaces.tobago.component.ComponentUtil;
028 import org.apache.myfaces.tobago.component.UITreeListbox;
029
030 import javax.faces.component.UIComponent;
031
032 public class TreeListboxTag extends TobagoTag
033 implements TreeListboxTagDeclaration {
034
035 private String value;
036 private String state;
037 private String idReference;
038 private String nameReference;
039 private String tipReference;
040 private String selectable;
041 private String required;
042
043 public String getComponentType() {
044 return UITreeListbox.COMPONENT_TYPE;
045 }
046
047 protected void setProperties(UIComponent component) {
048 super.setProperties(component);
049 ComponentUtil.setStringProperty(component, ATTR_VALUE, value);
050 ComponentUtil.setValueBinding(component, ATTR_STATE, state);
051 ComponentUtil.setStringProperty(component, ATTR_ID_REFERENCE, idReference);
052 ComponentUtil.setStringProperty(component, ATTR_NAME_REFERENCE, nameReference);
053 ComponentUtil.setStringProperty(component, ATTR_SELECTABLE, selectable);
054 ComponentUtil.setBooleanProperty(component, ATTR_REQUIRED, required);
055 ComponentUtil.setStringProperty(component, ATTR_TIP_REFERENCE, tipReference);
056
057 }
058
059 public void release() {
060 super.release();
061 value = null;
062 state = null;
063 idReference = null;
064 nameReference = null;
065 tipReference = null;
066 selectable = null;
067 required = null;
068 }
069
070 public String getValue() {
071 return value;
072 }
073
074 public void setValue(String value) {
075 this.value = value;
076 }
077
078 public String getState() {
079 return state;
080 }
081
082 public void setState(String state) {
083 this.state = state;
084 }
085
086 public String getIdReference() {
087 return idReference;
088 }
089
090 public void setIdReference(String idReference) {
091 this.idReference = idReference;
092 }
093
094 public String getNameReference() {
095 return nameReference;
096 }
097
098 public void setNameReference(String nameReference) {
099 this.nameReference = nameReference;
100 }
101
102 public String getSelectable() {
103 return selectable;
104 }
105
106 public void setSelectable(String selectable) {
107 this.selectable = selectable;
108 }
109
110 public String getRequired() {
111 return required;
112 }
113
114 public void setRequired(String required) {
115 this.required = required;
116 }
117
118 public void setTipReference(String tipReference) {
119 this.tipReference = tipReference;
120 }
121 }
122