001: /*
002: * Copyright 2005-2006 The Kuali Foundation.
003: *
004: *
005: * Licensed under the Educational Community License, Version 1.0 (the "License");
006: * you may not use this file except in compliance with the License.
007: * You may obtain a copy of the License at
008: *
009: * http://www.opensource.org/licenses/ecl1.php
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package edu.iu.uis.eden.lookupable;
018:
019: import java.util.HashMap;
020: import java.util.Map;
021:
022: import edu.iu.uis.eden.plugin.attributes.WorkflowLookupable;
023: import edu.iu.uis.eden.util.Utilities;
024:
025: /**
026: * Represents a column within a table in the user interface for Lookupables.
027: *
028: * @see WorkflowLookupable
029: *
030: * @author jhopf
031: */
032: public class Column {
033:
034: public static final String COLUMN_IS_SORTABLE_VALUE = "true";
035: public static final String COLUMN_NOT_SORTABLE_VALUE = "false";
036:
037: public static final String TEXT = "text";
038: public static final String INTEGER = "integer";
039: public static final String LONG = "long";
040: public static final String FLOAT = "float";
041: public static final String DATETIME = "datetime";
042:
043: private String columnTitle;
044: private String sortable;
045: private String key;
046: private String propertyName;
047: private String sortPropertyName;
048: private String type = TEXT;
049: private Map<String, String> displayParameters = new HashMap<String, String>();
050:
051: public Column() {
052:
053: }
054:
055: public Column(String columnTitle, String sortable,
056: String propertyName) {
057: this .columnTitle = columnTitle;
058: this .sortable = sortable;
059: this .propertyName = propertyName;
060: }
061:
062: public Column(String columnTitle, String sortable,
063: String propertyName, String sortPropertyName, String key,
064: Map<String, String> displayParameters) {
065: this .columnTitle = columnTitle;
066: this .sortable = sortable;
067: this .propertyName = propertyName;
068: this .sortPropertyName = sortPropertyName;
069: this .key = key;
070: this .displayParameters = displayParameters;
071: }
072:
073: public String getSortName() {
074: if (!Utilities.isEmpty(this .sortPropertyName)) {
075: return this .sortPropertyName;
076: }
077: return this .propertyName;
078: }
079:
080: /**
081: * @return the displayParameters
082: */
083: public Map<String, String> getDisplayParameters() {
084: return displayParameters;
085: }
086:
087: /**
088: * @param displayParameters the displayParameters to set
089: */
090: public void setDisplayParameters(
091: Map<String, String> displayParameters) {
092: this .displayParameters = displayParameters;
093: }
094:
095: /**
096: * @return the key
097: */
098: public String getKey() {
099: return key;
100: }
101:
102: /**
103: * @param key the key to set
104: */
105: public void setKey(String key) {
106: this .key = key;
107: }
108:
109: /**
110: * @return Returns the columnTitle.
111: */
112: public String getColumnTitle() {
113: return columnTitle;
114: }
115:
116: /**
117: * @param columnTitle
118: * The columnTitle to set.
119: */
120: public void setColumnTitle(String columnTitle) {
121: this .columnTitle = columnTitle;
122: }
123:
124: /**
125: * @return Returns the propertyName.
126: */
127: public String getPropertyName() {
128: return propertyName;
129: }
130:
131: /**
132: * @param propertyName
133: * The propertyName to set.
134: */
135: public void setPropertyName(String propertyName) {
136: this .propertyName = propertyName;
137: }
138:
139: /**
140: * @return the sortPropertyName
141: */
142: public String getSortPropertyName() {
143: return sortPropertyName;
144: }
145:
146: /**
147: * @param sortPropertyName the sortPropertyName to set
148: */
149: public void setSortPropertyName(String sortPropertyName) {
150: this .sortPropertyName = sortPropertyName;
151: }
152:
153: /**
154: * @return Returns the sortable.
155: */
156: public String getSortable() {
157: return sortable;
158: }
159:
160: /**
161: * @param sortable
162: * The sortable to set.
163: */
164: public void setSortable(String sortable) {
165: this .sortable = sortable;
166: }
167:
168: /**
169: * @return the type
170: */
171: public String getType() {
172: return type;
173: }
174:
175: /**
176: * @param type the type to set
177: */
178: public void setType(String type) {
179: this.type = type;
180: }
181: }
|