View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.myfaces.custom.column;
20  
21  import javax.faces.component.UIColumn;
22  import javax.faces.component.behavior.ClientBehaviorHolder;
23  
24  /**
25   * A tag that extend h:column to provide HTML passthrough attributes. 
26   * Tag t:column can be used instead of h:column in a t:datatable. 
27   * It provides HTML passthrough attributes for header (th), footer 
28   * (td) and row cells (td). Unless otherwise specified, all 
29   * attributes accept static values or EL expressions.
30   * 
31   * @JSFComponent
32   *   name = "t:column"
33   *   class = "org.apache.myfaces.custom.column.HtmlSimpleColumn"
34   *   tagClass = "org.apache.myfaces.custom.column.HtmlColumnTag"
35   * @since 1.1.7
36   * @author Mathias Broekelmann (latest modification by $Author: lu4242 $)
37   * @version $Revision: 691856 $ $Date: 2008-09-03 21:40:30 -0500 (miƩ, 03 sep 2008) $
38   */
39  public abstract class AbstractHtmlSimpleColumn extends UIColumn implements HtmlColumn,
40      ClientBehaviorHolder
41  {
42      public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlColumn";
43  
44      
45      public boolean isGroupByValueSet()
46      {
47          return getGroupByValue() != null;
48      }
49      
50      /**
51       * This attribute tells the datatable to group by data in this column
52       * 
53       * @JSFProperty
54       *   defaultValue = "false"
55       */
56      public abstract boolean isGroupBy();
57  
58  
59      /**
60       *  Optional - Allows you configure where to get the value to 
61       *  check for the group change condition. Default: all children 
62       *  of the column cell will be checked
63       * 
64       * @JSFProperty
65       */
66      public abstract Object getGroupByValue();
67  
68      /**
69       * This attribute tells the datatable to make this column the 
70       * default sorted, when sortable=true
71       * 
72       * @JSFProperty
73       *   defaultValue = "false"
74       */
75      public abstract boolean isDefaultSorted();
76  
77      /**
78       * This attribute makes this column automaticaly sortable 
79       * by a row object's property
80       * 
81       * @JSFProperty
82       *   defaultValue = "false"
83       */
84      public abstract boolean isSortable();
85  
86      /**
87       *  This attribute tells row object's property by which 
88       *  sorting will be performed on this column
89       * 
90       * @JSFProperty
91       */    
92      public abstract String getSortPropertyName();
93  
94  }