01: /*
02: * Created on Mar 9, 2003
03: *
04: * Dbmjui is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU General Public License version 2 as
06: * published by the Free Software Foundation.
07: *
08: * Dbmjui is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * General Public License for more details.
12: *
13: * You should have received a copy of the GNU General Public
14: * License along with dbmjui; see the file COPYING. If not,
15: * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16: * Boston, MA 02111-1307, USA.
17: *
18: */
19: package fr.aliacom.dbmjui.ui;
20:
21: import java.text.SimpleDateFormat;
22: import java.util.Date;
23:
24: import fr.aliacom.common.ui.table.ILabelProvider;
25:
26: /**
27: * @author tom
28: *
29: * (c) 2001, 2003 Thomas Cataldo
30: */
31: public final class TimeStampLabelProvider implements ILabelProvider {
32:
33: private SimpleDateFormat formatter;
34:
35: public TimeStampLabelProvider() {
36: formatter = new SimpleDateFormat();
37: }
38:
39: /* (non-Javadoc)
40: * @see fr.aliacom.common.ui.table.ILabelProvider#getIconName(java.lang.Object, java.lang.Object)
41: */
42: public String getIconName(Object value, Object javaBean) {
43: return null;
44: }
45:
46: /* (non-Javadoc)
47: * @see fr.aliacom.common.ui.table.ILabelProvider#getText(java.lang.Object, java.lang.Object)
48: */
49: public String getText(Object value, Object javaBean) {
50: String ret = "";
51: if (value != null) {
52: ret = formatter.format((Date) value);
53: }
54: return ret;
55: }
56:
57: }
|