1 18 19 package org.objectweb.jac.aspects.gui.swing; 20 21 import java.util.Date ; 22 import org.objectweb.jac.aspects.gui.DateHourFormat; 23 import org.objectweb.jac.core.rtti.FieldItem; 24 25 28 29 public class TimestampViewer extends FormatViewer 30 { 31 34 public TimestampViewer(Object value, Object substance, FieldItem field) { 35 super(value,substance,field); 36 } 37 38 Date date; 39 40 public TimestampViewer() { 41 } 42 43 public void setValue(Object value) { 44 if (value!=null) { 45 if (date==null) { 46 date = new Date (); 50 } 51 date.setTime(((Long )value).longValue()); 52 label.setText(format.format(date)); 53 } else { 54 label.setText(""); 55 } 56 } 57 58 protected void initFormat(FieldItem field) { 59 format = new DateHourFormat(field); 60 } 61 } 62 | Popular Tags |