01: package org.obe.worklist;
02:
03: import org.obe.client.api.model.TemporalStatus;
04:
05: import java.io.Serializable;
06:
07: /**
08: * @author Adrian Price
09: */
10: public abstract class TemporalStatusBean implements Serializable {
11: private static final long serialVersionUID = -3065792134472046621L;
12:
13: protected TemporalStatusBean() {
14: }
15:
16: public abstract TemporalStatus getTemporalStatus();
17:
18: public final String getTemporalStatusStyle() {
19: return getTemporalStatusStyle(getTemporalStatus());
20: }
21:
22: protected final String getTemporalStatusStyle(TemporalStatus status) {
23: switch (status.value()) {
24: case TemporalStatus.UNDEFINED_INT:
25: return "undefined-status";
26: case TemporalStatus.NORMAL_INT:
27: return "normal-status";
28: case TemporalStatus.WARNING_INT:
29: return "warning-status";
30: case TemporalStatus.OVERDUE_INT:
31: return "overdue-status";
32: default:
33: return null;
34: }
35: }
36:
37: }
|