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 org.apache.myfaces.tobago.TobagoConstants; 023 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TAB_INDEX; 024 import org.apache.myfaces.tobago.component.ComponentUtil; 025 import org.apache.myfaces.tobago.component.UITreeOld; 026 027 import javax.faces.component.ActionSource; 028 import javax.faces.component.UIComponent; 029 030 @Deprecated 031 public class TreeOldTag extends TobagoTag implements TreeOldTagDeclaration { 032 033 private String value; 034 private String state; 035 036 private String showJunctions; 037 private String showIcons; 038 private String showRoot; 039 private String showRootJunction; 040 041 private String selectable; 042 private String mutable; 043 044 private String idReference; 045 private String nameReference; 046 private String disabledReference; 047 private String tipReference; 048 049 private String required; 050 051 private String actionListener; 052 053 private String mode; 054 055 private String tabIndex; 056 057 public String getComponentType() { 058 return UITreeOld.COMPONENT_TYPE; 059 } 060 061 protected void setProperties(UIComponent component) { 062 super.setProperties(component); 063 064 ComponentUtil.setStringProperty(component, TobagoConstants.ATTR_VALUE, value); 065 ComponentUtil.setValueBinding(component, TobagoConstants.ATTR_STATE, state); 066 067 ComponentUtil.setBooleanProperty(component, 068 TobagoConstants.ATTR_SHOW_JUNCTIONS, showJunctions); 069 ComponentUtil.setBooleanProperty(component, TobagoConstants.ATTR_SHOW_ICONS, showIcons); 070 ComponentUtil.setBooleanProperty(component, TobagoConstants.ATTR_SHOW_ROOT, showRoot); 071 ComponentUtil.setBooleanProperty(component, 072 TobagoConstants.ATTR_SHOW_ROOT_JUNCTION, showRootJunction); 073 074 ComponentUtil.setStringProperty(component, TobagoConstants.ATTR_SELECTABLE, selectable); 075 ComponentUtil.setBooleanProperty(component, TobagoConstants.ATTR_MUTABLE, mutable); 076 077 ComponentUtil.setStringProperty(component, TobagoConstants.ATTR_ID_REFERENCE, idReference); 078 ComponentUtil.setStringProperty(component, 079 TobagoConstants.ATTR_NAME_REFERENCE, nameReference); 080 ComponentUtil.setStringProperty(component, 081 TobagoConstants.ATTR_DISABLED_REFERENCE, disabledReference); 082 ComponentUtil.setBooleanProperty(component, TobagoConstants.ATTR_REQUIRED, required); 083 ComponentUtil.setActionListener((ActionSource) component, actionListener); 084 ComponentUtil.setStringProperty(component, TobagoConstants.ATTR_MODE, mode); 085 ComponentUtil.setStringProperty(component, TobagoConstants.ATTR_TIP_REFERENCE, tipReference); 086 ComponentUtil.setIntegerProperty(component, ATTR_TAB_INDEX, tabIndex); 087 } 088 089 public void release() { 090 super.release(); 091 value = null; 092 state = null; 093 showJunctions = null; 094 showIcons = null; 095 showRoot = null; 096 showRootJunction = null; 097 selectable = null; 098 mutable = null; 099 idReference = null; 100 nameReference = null; 101 disabledReference = null; 102 required = null; 103 actionListener = null; 104 mode = null; 105 tabIndex = null; 106 } 107 108 public String getValue() { 109 return value; 110 } 111 112 public void setValue(String value) { 113 this.value = value; 114 } 115 116 public String getState() { 117 return state; 118 } 119 120 public void setState(String state) { 121 this.state = state; 122 } 123 124 public String getShowIcons() { 125 return showIcons; 126 } 127 128 public void setActionListener(String actionListener) { 129 this.actionListener = actionListener; 130 } 131 132 public String getActionListener() { 133 return actionListener; 134 } 135 136 public void setShowIcons(String showIcons) { 137 this.showIcons = showIcons; 138 } 139 140 public String getShowJunctions() { 141 return showJunctions; 142 } 143 144 public void setShowJunctions(String showJunctions) { 145 this.showJunctions = showJunctions; 146 } 147 148 public String getShowRoot() { 149 return showRoot; 150 } 151 152 public void setShowRoot(String showRoot) { 153 this.showRoot = showRoot; 154 } 155 156 public String getShowRootJunction() { 157 return showRootJunction; 158 } 159 160 public void setShowRootJunction(String showRootJunction) { 161 this.showRootJunction = showRootJunction; 162 } 163 164 public String getIdReference() { 165 return idReference; 166 } 167 168 public void setIdReference(String idReference) { 169 this.idReference = idReference; 170 } 171 172 public String getSelectable() { 173 return selectable; 174 } 175 176 public void setSelectable(String selectable) { 177 this.selectable = selectable; 178 } 179 180 public String getMutable() { 181 return mutable; 182 } 183 184 public void setMutable(String mutable) { 185 this.mutable = mutable; 186 } 187 188 public String getNameReference() { 189 return nameReference; 190 } 191 192 public void setNameReference(String nameReference) { 193 this.nameReference = nameReference; 194 } 195 196 public String getDisabledReference() { 197 return disabledReference; 198 } 199 200 public void setDisabledReference(String disabledReference) { 201 this.disabledReference = disabledReference; 202 } 203 204 public String getRequired() { 205 return required; 206 } 207 208 public void setRequired(String required) { 209 this.required = required; 210 } 211 212 public String getMode() { 213 return mode; 214 } 215 216 public void setMode(String mode) { 217 this.mode = mode; 218 } 219 220 public void setTipReference(String tipReference) { 221 this.tipReference = tipReference; 222 } 223 224 public String getTabIndex() { 225 return tabIndex; 226 } 227 228 public void setTabIndex(String tabIndex) { 229 this.tabIndex = tabIndex; 230 } 231 }