01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/osp/tags/sakai_2-4-1/common/tool-lib/src/java/org/theospi/portfolio/list/tool/DecoratedColumn.java $
03: * $Id: DecoratedColumn.java 18592 2006-12-01 19:02:03Z chmaurer@iupui.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/
21:
22: /**
23: *
24: */package org.theospi.portfolio.list.tool;
25:
26: import org.apache.commons.logging.Log;
27: import org.apache.commons.logging.LogFactory;
28: import org.theospi.portfolio.list.model.Column;
29:
30: /**
31: * @author chrismaurer
32: *
33: */
34: public class DecoratedColumn {
35:
36: protected final transient Log logger = LogFactory
37: .getLog(getClass());
38:
39: private ListTool parent;
40: private Column base;
41:
42: public DecoratedColumn() {
43: }
44:
45: public DecoratedColumn(Column base, ListTool parent) {
46: this .base = base;
47: this .parent = parent;
48: }
49:
50: public String processActionSortDesc() {
51: return parent.processActionSort(this , ListTool.SORT_DESC);
52: }
53:
54: public String processActionSortAsc() {
55: return parent.processActionSort(this , ListTool.SORT_ASC);
56: }
57:
58: public boolean isSortable() {
59: return parent.getSortableColumns().contains(base.getName());
60: }
61:
62: public boolean isCurrentSortField() {
63: return parent.isCurrentSortField(base.getName());
64: }
65:
66: /**
67: * @return the base
68: */
69: public Column getBase() {
70: return base;
71: }
72:
73: /**
74: * @param base the base to set
75: */
76: public void setBase(Column base) {
77: this .base = base;
78: }
79:
80: /**
81: * @return the parent
82: */
83: public ListTool getParent() {
84: return parent;
85: }
86:
87: /**
88: * @param parent the parent to set
89: */
90: public void setParent(ListTool parent) {
91: this.parent = parent;
92: }
93:
94: }
|