Coverage Report - org.kuali.rice.kns.web.ui.Column
 
Classes in this File Line Coverage Branch Coverage Complexity
Column
0%
0/75
0%
0/4
1.079
 
 1  
 /**
 2  
  * Copyright 2005-2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.kns.web.ui;
 17  
 
 18  
 import org.kuali.rice.core.web.format.Formatter;
 19  
 import org.kuali.rice.kns.lookup.HtmlData;
 20  
 import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData;
 21  
 import org.kuali.rice.kns.lookup.HtmlData.MultipleAnchorHtmlData;
 22  
 
 23  
 import java.util.ArrayList;
 24  
 import java.util.Comparator;
 25  
 import java.util.List;
 26  
 
 27  
 /**
 28  
  * Represents a Column in a result table
 29  
  * 
 30  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 31  
  */
 32  
 @Deprecated
 33  
 public class Column implements java.io.Serializable, PropertyRenderingConfigElement {
 34  
     private static final long serialVersionUID = -5916942413570667803L;
 35  
     private String columnTitle;
 36  0
     private String sortable = "true";
 37  
     private String propertyName;
 38  
     private String propertyValue;
 39  
     private Object unformattedPropertyValue;
 40  
     private String propertyURL;
 41  
     private HtmlData columnAnchor;
 42  
     private Formatter formatter;
 43  
     private Comparator comparator;
 44  0
     private boolean escapeXMLValue=true;
 45  
     
 46  
     private String alternateDisplayPropertyName;
 47  
     private String additionalDisplayPropertyName;
 48  
     
 49  
     private boolean total;
 50  
     
 51  
     /**
 52  
      * A comparator used to compare the propertyValue values
 53  
      */
 54  
     private Comparator valueComparator;
 55  
     
 56  
     /**
 57  
      * Represents the maximum column length.  If propertyValue's length exceeds this value, then 
 58  
      * it will be truncated to this length when displayed
 59  
      */
 60  
     private int maxLength;
 61  
     
 62  0
     public Column() {
 63  0
     }
 64  
     
 65  0
     public Column(String columnTitle, String propertyName) {
 66  0
         this.columnTitle = columnTitle;
 67  0
         this.propertyName = propertyName;
 68  0
     }
 69  
     
 70  0
     public Column(String columnTitle, String sortable, String propertyName) {
 71  0
         this.columnTitle = columnTitle;
 72  0
         this.sortable = sortable;
 73  0
         this.propertyName = propertyName;
 74  0
     }
 75  
 
 76  
     public Column(String columnTitle, String sortable, String propertyName, Comparator comparator) {
 77  0
         this(columnTitle, sortable, propertyName);
 78  0
         this.comparator = comparator;
 79  0
     }
 80  
 
 81  0
     public Column(String columnTitle, String propertyName, Formatter formatter) {
 82  0
         this.columnTitle = columnTitle;
 83  0
         this.propertyName = propertyName;
 84  0
         this.formatter = formatter;
 85  0
     }
 86  
 
 87  
     /**
 88  
      * @return Returns the comparator.
 89  
      */
 90  
     public Comparator getComparator() {
 91  0
         return comparator;
 92  
     }
 93  
 
 94  
 
 95  
     /**
 96  
      * @param comparator The comparator to set.
 97  
      */
 98  
     public void setComparator(Comparator comparator) {
 99  0
         this.comparator = comparator;
 100  0
     }
 101  
 
 102  
 
 103  
     /**
 104  
      * @return Returns the columnTitle.
 105  
      */
 106  
     public String getColumnTitle() {
 107  0
         return columnTitle;
 108  
     }
 109  
 
 110  
 
 111  
     /**
 112  
      * @param columnTitle The columnTitle to set.
 113  
      */
 114  
     public void setColumnTitle(String columnTitle) {
 115  0
         this.columnTitle = columnTitle;
 116  0
     }
 117  
 
 118  
 
 119  
     /**
 120  
      * @return Returns the propertyName.
 121  
      */
 122  
     public String getPropertyName() {
 123  0
         return propertyName;
 124  
     }
 125  
 
 126  
 
 127  
     /**
 128  
      * @param propertyName The propertyName to set.
 129  
      */
 130  
     public void setPropertyName(String propertyName) {
 131  0
         this.propertyName = propertyName;
 132  0
     }
 133  
 
 134  
 
 135  
     /**
 136  
      * @return Returns the sortable.
 137  
      */
 138  
     public String getSortable() {
 139  0
         return sortable;
 140  
     }
 141  
 
 142  
 
 143  
     /**
 144  
      * @param sortable The sortable to set.
 145  
      */
 146  
     public void setSortable(String sortable) {
 147  0
         this.sortable = sortable;
 148  0
     }
 149  
 
 150  
 
 151  
     /**
 152  
      * @return Returns the propertyURL.
 153  
      */
 154  
     public String getPropertyURL() {
 155  0
         return propertyURL;
 156  
     }
 157  
 
 158  
 
 159  
     /**
 160  
      * @param propertyURL The propertyURL to set.
 161  
      */
 162  
     public void setPropertyURL(String propertyURL) {
 163  0
         this.propertyURL = propertyURL;
 164  0
     }
 165  
 
 166  
         /**
 167  
          * @return the columnAnchor
 168  
          */
 169  
         public HtmlData getColumnAnchor() {
 170  0
                 return this.columnAnchor;
 171  
         }
 172  
 
 173  
         public boolean isMultipleAnchors(){
 174  0
                 return this.columnAnchor instanceof MultipleAnchorHtmlData;
 175  
         }
 176  
 
 177  
         public List<AnchorHtmlData> getColumnAnchors(){
 178  0
                 if(isMultipleAnchors())
 179  0
                         return ((MultipleAnchorHtmlData)this.columnAnchor).getAnchorHtmlData();
 180  0
                 List<AnchorHtmlData> htmlData = new ArrayList<AnchorHtmlData>();
 181  0
                 htmlData.add((AnchorHtmlData)columnAnchor);
 182  0
                 return htmlData;
 183  
         }
 184  
 
 185  
         public int getNumberOfColumnAnchors(){
 186  0
                 return getColumnAnchors().size();
 187  
         }
 188  
 
 189  
         /**
 190  
          * @param columnAnchor the columnAnchor to set
 191  
          */
 192  
         public void setColumnAnchor(HtmlData columnAnchor) {
 193  0
                 this.columnAnchor = columnAnchor;
 194  0
                 if(columnAnchor!=null) 
 195  0
                         setPropertyURL(((AnchorHtmlData)columnAnchor).getHref());
 196  0
         }
 197  
 
 198  
         /**
 199  
      * @return Returns the propertyValue.
 200  
      */
 201  
     public String getPropertyValue() {
 202  0
         return propertyValue;
 203  
     }
 204  
 
 205  
 
 206  
     /**
 207  
      * @param propertyValue The propertyValue to set.
 208  
      */
 209  
     public void setPropertyValue(String propertyValue) {
 210  0
         this.propertyValue = propertyValue;
 211  0
     }
 212  
     
 213  
     /**
 214  
      * @return Returns the formatter.
 215  
      */
 216  
     public Formatter getFormatter() {
 217  0
         return formatter;
 218  
     }
 219  
 
 220  
 
 221  
     /**
 222  
      * @param formatter The formatter to set.
 223  
      */
 224  
     public void setFormatter(Formatter formatter) {
 225  0
         this.formatter = formatter;
 226  0
     }
 227  
 
 228  
     public Comparator getValueComparator() {
 229  0
         return valueComparator;
 230  
     }
 231  
 
 232  
     public void setValueComparator(Comparator valueComparator) {
 233  0
         this.valueComparator = valueComparator;
 234  0
     }
 235  
 
 236  
     /**
 237  
      * Returns the maximum column length.  If propertyValue's length exceeds this value, then 
 238  
      * it will be truncated to this length when displayed
 239  
      * @return
 240  
      */
 241  
     public int getMaxLength() {
 242  0
         return maxLength;
 243  
     }
 244  
 
 245  
     /**
 246  
      * Sets the maximum column length.  If propertyValue's length exceeds this value, then 
 247  
      * it will be truncated to this length when displayed
 248  
      * @param maxColumnLength
 249  
      */
 250  
     public void setMaxLength(int maxColumnLength) {
 251  0
         this.maxLength = maxColumnLength;
 252  0
     }
 253  
 
 254  
         /**
 255  
          * @return the escapeXMLValue
 256  
          */
 257  
         public boolean isEscapeXMLValue() {
 258  0
                 return this.escapeXMLValue;
 259  
         }
 260  
 
 261  
         /**
 262  
          * @param escapeXMLValue the escapeXMLValue to set
 263  
          */
 264  
         public void setEscapeXMLValue(boolean escapeXMLValue) {
 265  0
                 this.escapeXMLValue = escapeXMLValue;
 266  0
         }
 267  
 
 268  
         public String getAlternateDisplayPropertyName() {
 269  0
                 return this.alternateDisplayPropertyName;
 270  
         }
 271  
 
 272  
         public void setAlternateDisplayPropertyName(String alternateDisplayPropertyName) {
 273  0
                 this.alternateDisplayPropertyName = alternateDisplayPropertyName;
 274  0
         }
 275  
 
 276  
         public String getAdditionalDisplayPropertyName() {
 277  0
                 return this.additionalDisplayPropertyName;
 278  
         }
 279  
 
 280  
         public void setAdditionalDisplayPropertyName(String additionalDisplayPropertyName) {
 281  0
                 this.additionalDisplayPropertyName = additionalDisplayPropertyName;
 282  0
         }
 283  
 
 284  
         public boolean isTotal() {
 285  0
                 return this.total;
 286  
         }
 287  
 
 288  
         public void setTotal(boolean total) {
 289  0
                 this.total = total;
 290  0
         }
 291  
 
 292  
         public Object getUnformattedPropertyValue() {
 293  0
                 return this.unformattedPropertyValue;
 294  
         }
 295  
 
 296  
         public void setUnformattedPropertyValue(Object unformattedPropertyValue) {
 297  0
                 this.unformattedPropertyValue = unformattedPropertyValue;
 298  0
         }
 299  
         
 300  
 }