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