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    /*
023     * Created on: 15.02.2002, 17:01:56
024     * $Id: InTag.java 1368577 2012-08-02 16:20:31Z lofwyr $
025     */
026    
027    import static org.apache.myfaces.tobago.TobagoConstants.ATTR_PASSWORD;
028    import org.apache.myfaces.tobago.component.ComponentUtil;
029    import org.apache.myfaces.tobago.component.UIInput;
030    import org.apache.myfaces.tobago.util.Deprecation;
031    
032    import javax.faces.component.UIComponent;
033    
034    public class InTag extends TextInputTag implements InTagDeclaration {
035    
036      private String password;
037      private String suggestMethod;
038      private String markup;
039    
040    
041      @Override
042      public void release() {
043        super.release();
044        password = null;
045        suggestMethod = null;
046        markup = null;
047      }
048    
049      @Override
050      protected void setProperties(UIComponent component) {
051        super.setProperties(component);
052    
053        if (getLabel() != null && Deprecation.LOG.isErrorEnabled()) {
054          Deprecation.LOG.error("the label attribute is deprecated in tc:in, please use tx:in instead.");
055        }
056    
057        ComponentUtil.setBooleanProperty(component, ATTR_PASSWORD, password);
058        if (component instanceof UIInput) {
059          ComponentUtil.setSuggestMethodBinding((UIInput) component, suggestMethod);
060        }
061        ComponentUtil.setMarkup(component, markup);
062      }
063    
064      public String getPassword() {
065        return password;
066      }
067    
068      public void setPassword(String password) {
069        this.password = password;
070      }
071    
072      public String getSuggestMethod() {
073        return suggestMethod;
074      }
075    
076      public void setSuggestMethod(String suggestMethod) {
077        this.suggestMethod = suggestMethod;
078      }
079    
080    
081      public String getMarkup() {
082        return markup;
083      }
084    
085      public void setMarkup(String markup) {
086        this.markup = markup;
087      }
088    }