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.component.ComponentUtil;
023    import org.apache.myfaces.tobago.component.UIColumn;
024    
025    import javax.faces.component.UIComponent;
026    
027    import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ALIGN;
028    import static org.apache.myfaces.tobago.TobagoConstants.ATTR_RESIZABLE;
029    import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SORTABLE;
030    import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TIP;
031    import static org.apache.myfaces.tobago.TobagoConstants.ATTR_WIDTH;
032    
033    public class ColumnTag extends TobagoTag
034        implements ColumnTagDeclaration {
035    
036      private String sortable;
037      private String resizable;
038      private String align;
039      private String markup;
040      private String tip;
041      private String width;
042    
043      public String getComponentType() {
044        return UIColumn.COMPONENT_TYPE;
045      }
046    
047      public String getRendererType() {
048        return null;
049      }
050    
051      public void release() {
052        super.release();
053        sortable = null;
054        resizable = null;
055        align = null;
056        markup = null;
057        tip = null;
058        width = null;
059      }
060    
061      protected void setProperties(UIComponent component) {
062        super.setProperties(component);
063        ComponentUtil.setBooleanProperty(component, ATTR_SORTABLE, sortable);
064        ComponentUtil.setBooleanProperty(component, ATTR_RESIZABLE, resizable);
065        ComponentUtil.setStringProperty(component, ATTR_ALIGN, align);
066        ComponentUtil.setMarkup(component, markup);
067        ComponentUtil.setStringProperty(component, ATTR_TIP, tip);
068        ComponentUtil.setStringProperty(component, ATTR_WIDTH, width);
069      }
070    
071      public void setMarkup(String markup) {
072        this.markup = markup;
073      }
074    
075      public String getAlign() {
076        return align;
077      }
078    
079      public void setAlign(String align) {
080        this.align = align;
081      }
082    
083      public String getSortable() {
084        return sortable;
085      }
086    
087      public void setSortable(String sortable) {
088        this.sortable = sortable;
089      }
090    
091      public String getResizable() {
092        return resizable;
093      }
094    
095      public void setResizable(String resizable) {
096        this.resizable = resizable;
097      }
098    
099      public void setTip(String tip) {
100        this.tip = tip;
101      }
102    
103      public void setWidth(String width) {
104        this.width = width;
105      }
106    }