|  1 |     | 
     | 
  |  2 |     | 
     | 
  |  3 |     | 
     | 
  |  4 |     | 
     | 
  |  5 |     | 
     | 
  |  6 |     | 
     | 
  |  7 |     | 
     | 
  |  8 |     | 
     | 
  |  9 |     | 
     | 
  |  10 |     | 
     | 
  |  11 |     | 
     | 
  |  12 |     | 
     | 
  |  13 |     | 
     | 
  |  14 |     | 
     | 
  |  15 |     | 
     | 
  |  16 |     | 
   package org.kuali.rice.kns.web.ui;  | 
  |  17 |     | 
     | 
  |  18 |     | 
   import java.util.ArrayList;  | 
  |  19 |     | 
   import java.util.Comparator;  | 
  |  20 |     | 
   import java.util.List;  | 
  |  21 |     | 
     | 
  |  22 |     | 
   import org.kuali.rice.core.web.format.Formatter;  | 
  |  23 |     | 
   import org.kuali.rice.kns.lookup.HtmlData;  | 
  |  24 |     | 
   import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData;  | 
  |  25 |     | 
   import org.kuali.rice.kns.lookup.HtmlData.MultipleAnchorHtmlData;  | 
  |  26 |     | 
     | 
  |  27 |     | 
     | 
  |  28 |     | 
     | 
  |  29 |     | 
     | 
  |  30 |     | 
     | 
  |  31 |     | 
     | 
  |  32 |     | 
   public class Column implements java.io.Serializable, PropertyRenderingConfigElement { | 
  |  33 |     | 
       private static final long serialVersionUID = -5916942413570667803L;  | 
  |  34 |     | 
       private String columnTitle;  | 
  |  35 |    0 |        private String sortable = "true";  | 
  |  36 |     | 
       private String propertyName;  | 
  |  37 |     | 
       private String propertyValue;  | 
  |  38 |     | 
       private Object unformattedPropertyValue;  | 
  |  39 |     | 
       private String propertyURL;  | 
  |  40 |     | 
       private HtmlData columnAnchor;  | 
  |  41 |     | 
       private Formatter formatter;  | 
  |  42 |     | 
       private Comparator comparator;  | 
  |  43 |    0 |        private boolean escapeXMLValue=true;  | 
  |  44 |     | 
         | 
  |  45 |     | 
       private String alternateDisplayPropertyName;  | 
  |  46 |     | 
       private String additionalDisplayPropertyName;  | 
  |  47 |     | 
         | 
  |  48 |     | 
       private boolean total;  | 
  |  49 |     | 
         | 
  |  50 |     | 
         | 
  |  51 |     | 
     | 
  |  52 |     | 
     | 
  |  53 |     | 
       private Comparator valueComparator;  | 
  |  54 |     | 
         | 
  |  55 |     | 
         | 
  |  56 |     | 
     | 
  |  57 |     | 
     | 
  |  58 |     | 
     | 
  |  59 |     | 
       private int maxLength;  | 
  |  60 |     | 
         | 
  |  61 |    0 |        public Column() { | 
  |  62 |    0 |        }  | 
  |  63 |     | 
         | 
  |  64 |    0 |        public Column(String columnTitle, String propertyName) { | 
  |  65 |    0 |            this.columnTitle = columnTitle;  | 
  |  66 |    0 |            this.propertyName = propertyName;  | 
  |  67 |    0 |        }  | 
  |  68 |     | 
         | 
  |  69 |    0 |        public Column(String columnTitle, String sortable, String propertyName) { | 
  |  70 |    0 |            this.columnTitle = columnTitle;  | 
  |  71 |    0 |            this.sortable = sortable;  | 
  |  72 |    0 |            this.propertyName = propertyName;  | 
  |  73 |    0 |        }  | 
  |  74 |     | 
     | 
  |  75 |     | 
       public Column(String columnTitle, String sortable, String propertyName, Comparator comparator) { | 
  |  76 |    0 |            this(columnTitle, sortable, propertyName);  | 
  |  77 |    0 |            this.comparator = comparator;  | 
  |  78 |    0 |        }  | 
  |  79 |     | 
     | 
  |  80 |    0 |        public Column(String columnTitle, String propertyName, Formatter formatter) { | 
  |  81 |    0 |            this.columnTitle = columnTitle;  | 
  |  82 |    0 |            this.propertyName = propertyName;  | 
  |  83 |    0 |            this.formatter = formatter;  | 
  |  84 |    0 |        }  | 
  |  85 |     | 
     | 
  |  86 |     | 
         | 
  |  87 |     | 
     | 
  |  88 |     | 
     | 
  |  89 |     | 
       public Comparator getComparator() { | 
  |  90 |    0 |            return comparator;  | 
  |  91 |     | 
       }  | 
  |  92 |     | 
     | 
  |  93 |     | 
     | 
  |  94 |     | 
         | 
  |  95 |     | 
     | 
  |  96 |     | 
     | 
  |  97 |     | 
       public void setComparator(Comparator comparator) { | 
  |  98 |    0 |            this.comparator = comparator;  | 
  |  99 |    0 |        }  | 
  |  100 |     | 
     | 
  |  101 |     | 
     | 
  |  102 |     | 
         | 
  |  103 |     | 
     | 
  |  104 |     | 
     | 
  |  105 |     | 
       public String getColumnTitle() { | 
  |  106 |    0 |            return columnTitle;  | 
  |  107 |     | 
       }  | 
  |  108 |     | 
     | 
  |  109 |     | 
     | 
  |  110 |     | 
         | 
  |  111 |     | 
     | 
  |  112 |     | 
     | 
  |  113 |     | 
       public void setColumnTitle(String columnTitle) { | 
  |  114 |    0 |            this.columnTitle = columnTitle;  | 
  |  115 |    0 |        }  | 
  |  116 |     | 
     | 
  |  117 |     | 
     | 
  |  118 |     | 
         | 
  |  119 |     | 
     | 
  |  120 |     | 
     | 
  |  121 |     | 
       public String getPropertyName() { | 
  |  122 |    0 |            return propertyName;  | 
  |  123 |     | 
       }  | 
  |  124 |     | 
     | 
  |  125 |     | 
     | 
  |  126 |     | 
         | 
  |  127 |     | 
     | 
  |  128 |     | 
     | 
  |  129 |     | 
       public void setPropertyName(String propertyName) { | 
  |  130 |    0 |            this.propertyName = propertyName;  | 
  |  131 |    0 |        }  | 
  |  132 |     | 
     | 
  |  133 |     | 
     | 
  |  134 |     | 
         | 
  |  135 |     | 
     | 
  |  136 |     | 
     | 
  |  137 |     | 
       public String getSortable() { | 
  |  138 |    0 |            return sortable;  | 
  |  139 |     | 
       }  | 
  |  140 |     | 
     | 
  |  141 |     | 
     | 
  |  142 |     | 
         | 
  |  143 |     | 
     | 
  |  144 |     | 
     | 
  |  145 |     | 
       public void setSortable(String sortable) { | 
  |  146 |    0 |            this.sortable = sortable;  | 
  |  147 |    0 |        }  | 
  |  148 |     | 
     | 
  |  149 |     | 
     | 
  |  150 |     | 
         | 
  |  151 |     | 
     | 
  |  152 |     | 
     | 
  |  153 |     | 
       public String getPropertyURL() { | 
  |  154 |    0 |            return propertyURL;  | 
  |  155 |     | 
       }  | 
  |  156 |     | 
     | 
  |  157 |     | 
     | 
  |  158 |     | 
         | 
  |  159 |     | 
     | 
  |  160 |     | 
     | 
  |  161 |     | 
       public void setPropertyURL(String propertyURL) { | 
  |  162 |    0 |            this.propertyURL = propertyURL;  | 
  |  163 |    0 |        }  | 
  |  164 |     | 
     | 
  |  165 |     | 
             | 
  |  166 |     | 
     | 
  |  167 |     | 
     | 
  |  168 |     | 
           public HtmlData getColumnAnchor() { | 
  |  169 |    0 |                    return this.columnAnchor;  | 
  |  170 |     | 
           }  | 
  |  171 |     | 
     | 
  |  172 |     | 
           public boolean isMultipleAnchors(){ | 
  |  173 |    0 |                    return this.columnAnchor instanceof MultipleAnchorHtmlData;  | 
  |  174 |     | 
           }  | 
  |  175 |     | 
     | 
  |  176 |     | 
           public List<AnchorHtmlData> getColumnAnchors(){ | 
  |  177 |    0 |                    if(isMultipleAnchors())  | 
  |  178 |    0 |                            return ((MultipleAnchorHtmlData)this.columnAnchor).getAnchorHtmlData();  | 
  |  179 |    0 |                    List<AnchorHtmlData> htmlData = new ArrayList<AnchorHtmlData>();  | 
  |  180 |    0 |                    htmlData.add((AnchorHtmlData)columnAnchor);  | 
  |  181 |    0 |                    return htmlData;  | 
  |  182 |     | 
           }  | 
  |  183 |     | 
     | 
  |  184 |     | 
           public int getNumberOfColumnAnchors(){ | 
  |  185 |    0 |                    return getColumnAnchors().size();  | 
  |  186 |     | 
           }  | 
  |  187 |     | 
     | 
  |  188 |     | 
             | 
  |  189 |     | 
     | 
  |  190 |     | 
     | 
  |  191 |     | 
           public void setColumnAnchor(HtmlData columnAnchor) { | 
  |  192 |    0 |                    this.columnAnchor = columnAnchor;  | 
  |  193 |    0 |                    if(columnAnchor!=null)   | 
  |  194 |    0 |                            setPropertyURL(((AnchorHtmlData)columnAnchor).getHref());  | 
  |  195 |    0 |            }  | 
  |  196 |     | 
     | 
  |  197 |     | 
             | 
  |  198 |     | 
     | 
  |  199 |     | 
     | 
  |  200 |     | 
       public String getPropertyValue() { | 
  |  201 |    0 |            return propertyValue;  | 
  |  202 |     | 
       }  | 
  |  203 |     | 
     | 
  |  204 |     | 
     | 
  |  205 |     | 
         | 
  |  206 |     | 
     | 
  |  207 |     | 
     | 
  |  208 |     | 
       public void setPropertyValue(String propertyValue) { | 
  |  209 |    0 |            this.propertyValue = propertyValue;  | 
  |  210 |    0 |        }  | 
  |  211 |     | 
         | 
  |  212 |     | 
         | 
  |  213 |     | 
     | 
  |  214 |     | 
     | 
  |  215 |     | 
       public Formatter getFormatter() { | 
  |  216 |    0 |            return formatter;  | 
  |  217 |     | 
       }  | 
  |  218 |     | 
     | 
  |  219 |     | 
     | 
  |  220 |     | 
         | 
  |  221 |     | 
     | 
  |  222 |     | 
     | 
  |  223 |     | 
       public void setFormatter(Formatter formatter) { | 
  |  224 |    0 |            this.formatter = formatter;  | 
  |  225 |    0 |        }  | 
  |  226 |     | 
     | 
  |  227 |     | 
       public Comparator getValueComparator() { | 
  |  228 |    0 |            return valueComparator;  | 
  |  229 |     | 
       }  | 
  |  230 |     | 
     | 
  |  231 |     | 
       public void setValueComparator(Comparator valueComparator) { | 
  |  232 |    0 |            this.valueComparator = valueComparator;  | 
  |  233 |    0 |        }  | 
  |  234 |     | 
     | 
  |  235 |     | 
         | 
  |  236 |     | 
     | 
  |  237 |     | 
     | 
  |  238 |     | 
     | 
  |  239 |     | 
     | 
  |  240 |     | 
       public int getMaxLength() { | 
  |  241 |    0 |            return maxLength;  | 
  |  242 |     | 
       }  | 
  |  243 |     | 
     | 
  |  244 |     | 
         | 
  |  245 |     | 
     | 
  |  246 |     | 
     | 
  |  247 |     | 
     | 
  |  248 |     | 
     | 
  |  249 |     | 
       public void setMaxLength(int maxColumnLength) { | 
  |  250 |    0 |            this.maxLength = maxColumnLength;  | 
  |  251 |    0 |        }  | 
  |  252 |     | 
     | 
  |  253 |     | 
             | 
  |  254 |     | 
     | 
  |  255 |     | 
     | 
  |  256 |     | 
           public boolean isEscapeXMLValue() { | 
  |  257 |    0 |                    return this.escapeXMLValue;  | 
  |  258 |     | 
           }  | 
  |  259 |     | 
     | 
  |  260 |     | 
             | 
  |  261 |     | 
     | 
  |  262 |     | 
     | 
  |  263 |     | 
           public void setEscapeXMLValue(boolean escapeXMLValue) { | 
  |  264 |    0 |                    this.escapeXMLValue = escapeXMLValue;  | 
  |  265 |    0 |            }  | 
  |  266 |     | 
     | 
  |  267 |     | 
           public String getAlternateDisplayPropertyName() { | 
  |  268 |    0 |                    return this.alternateDisplayPropertyName;  | 
  |  269 |     | 
           }  | 
  |  270 |     | 
     | 
  |  271 |     | 
           public void setAlternateDisplayPropertyName(String alternateDisplayPropertyName) { | 
  |  272 |    0 |                    this.alternateDisplayPropertyName = alternateDisplayPropertyName;  | 
  |  273 |    0 |            }  | 
  |  274 |     | 
     | 
  |  275 |     | 
           public String getAdditionalDisplayPropertyName() { | 
  |  276 |    0 |                    return this.additionalDisplayPropertyName;  | 
  |  277 |     | 
           }  | 
  |  278 |     | 
     | 
  |  279 |     | 
           public void setAdditionalDisplayPropertyName(String additionalDisplayPropertyName) { | 
  |  280 |    0 |                    this.additionalDisplayPropertyName = additionalDisplayPropertyName;  | 
  |  281 |    0 |            }  | 
  |  282 |     | 
     | 
  |  283 |     | 
           public boolean isTotal() { | 
  |  284 |    0 |                    return this.total;  | 
  |  285 |     | 
           }  | 
  |  286 |     | 
     | 
  |  287 |     | 
           public void setTotal(boolean total) { | 
  |  288 |    0 |                    this.total = total;  | 
  |  289 |    0 |            }  | 
  |  290 |     | 
     | 
  |  291 |     | 
           public Object getUnformattedPropertyValue() { | 
  |  292 |    0 |                    return this.unformattedPropertyValue;  | 
  |  293 |     | 
           }  | 
  |  294 |     | 
     | 
  |  295 |     | 
           public void setUnformattedPropertyValue(Object unformattedPropertyValue) { | 
  |  296 |    0 |                    this.unformattedPropertyValue = unformattedPropertyValue;  | 
  |  297 |    0 |            }  | 
  |  298 |     | 
             | 
  |  299 |     | 
   }  |