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    /*
021     * Created on: 15.02.2002, 17:01:56
022     * $Id: InTag.java 578592 2007-09-23 18:51:32Z bommel $
023     */
024    
025    import org.apache.commons.logging.Log;
026    import org.apache.commons.logging.LogFactory;
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    
031    import javax.faces.component.UIComponent;
032    
033    public class InTag extends TextInputTag implements InTagDeclaration {
034    
035      private static final Log LOG = LogFactory.getLog(InTag.class);
036    
037      private String password;
038      private String suggestMethod;
039      private String markup;
040    
041    
042      @Override
043      public void release() {
044        super.release();
045        password = null;
046        suggestMethod = null;
047        markup = null;
048      }
049    
050      @Override
051      protected void setProperties(UIComponent component) {
052        super.setProperties(component);
053    
054        if (getLabel() != null) {
055          LOG.warn("the label attribute is deprecated in t:in, please use tx:in instead.");
056        }
057    
058        ComponentUtil.setBooleanProperty(component, ATTR_PASSWORD, password);
059        if (component instanceof UIInput) {
060          ComponentUtil.setSuggestMethodBinding((UIInput) component, suggestMethod);
061        }
062        ComponentUtil.setMarkup(component, markup);
063      }
064    
065      public String getPassword() {
066        return password;
067      }
068    
069      public void setPassword(String password) {
070        this.password = password;
071      }
072    
073      public String getSuggestMethod() {
074        return suggestMethod;
075      }
076    
077      public void setSuggestMethod(String suggestMethod) {
078        this.suggestMethod = suggestMethod;
079      }
080    
081    
082      public String getMarkup() {
083        return markup;
084      }
085    
086      public void setMarkup(String markup) {
087        this.markup = markup;
088      }
089    }