01: package com.sun.portal.app.sharedtasks.util;
02:
03: import com.sun.portal.app.sharedtasks.faces.beans.TaskUserSessionBackingBean;
04: import java.io.Serializable;
05: import java.text.DateFormat;
06: import java.util.ResourceBundle;
07:
08: /**
09: * Represents a calendar task.
10: *
11: * @author ashwin.mathew@sun.com
12: */
13: public class CalTaskListItem implements Serializable {
14:
15: private CalTask task;
16:
17: private boolean selected;
18:
19: public CalTaskListItem() {
20: this .task = new CalTask();
21: }
22:
23: public CalTaskListItem(CalTask task) {
24: this .task = task;
25: }
26:
27: public CalTask getTask() {
28: return task;
29: }
30:
31: public String getDueBy() {
32: TaskUserSessionBackingBean userSession = (TaskUserSessionBackingBean) TaskBeanFactory
33: .getBean(TaskUserSessionBackingBean.BEAN_NAME);
34:
35: ResourceBundle bundle = userSession.getResourceBundle();
36:
37: String dueBy = null;
38:
39: if (task.getNoDueDate().equals(Boolean.FALSE)) {
40: DateFormat formatter = DateFormat.getDateTimeInstance(
41: DateFormat.SHORT, DateFormat.SHORT, userSession
42: .getLocale());
43:
44: dueBy = formatter.format(task.getDueDate());
45: } else {
46: dueBy = bundle.getString(SharedConstants.KEY_NO_DUE_DATE);
47: }
48:
49: return dueBy;
50: }
51:
52: public boolean getSelected() {
53: return selected;
54: }
55:
56: public void setSelected(boolean selected) {
57: this .selected = selected;
58: }
59:
60: public String getSelectedValue() {
61: return task.getId() + SharedConstants.ID_RID_SEPARATOR
62: + task.getRid();
63: }
64:
65: public String getTitle() {
66: return task.getTitle();
67: }
68:
69: public void setTitle(String title) {
70: task.setTitle(title);
71: }
72:
73: public String getId() {
74: return task.getId();
75: }
76:
77: public void setId(String id) {
78: task.setId(id);
79: }
80:
81: public String getRid() {
82: return task.getRid();
83: }
84:
85: public void setRid(String rid) {
86: task.setRid(rid);
87: }
88:
89: public String getStatus() {
90: return task.getStatus();
91: }
92:
93: public void setStatus(String status) {
94: task.setStatus(status);
95: }
96:
97: }
|