org.rhq.enterprise.gui.common.time.converter
Class RelativeDurationConverter

java.lang.Object
  extended by org.rhq.enterprise.gui.common.time.converter.RelativeDurationConverter
All Implemented Interfaces:
javax.faces.convert.Converter

public class RelativeDurationConverter
extends Object
implements javax.faces.convert.Converter

Convert the passed value in to a relative date compared to now. If the passed value is -1, the output will be empty (as a value of 0 returns the number of days since the epoch)

Author:
Joseph Marques

Field Summary
static TimeZone tz
           
 
Constructor Summary
RelativeDurationConverter()
           
 
Method Summary
static String format(long eventMillis)
           
 Object getAsObject(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String value)
           
 String getAsString(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tz

public static TimeZone tz
Constructor Detail

RelativeDurationConverter

public RelativeDurationConverter()
Method Detail

getAsObject

public Object getAsObject(javax.faces.context.FacesContext context,
                          javax.faces.component.UIComponent component,
                          String value)
Specified by:
getAsObject in interface javax.faces.convert.Converter

getAsString

public String getAsString(javax.faces.context.FacesContext context,
                          javax.faces.component.UIComponent component,
                          Object value)
Specified by:
getAsString in interface javax.faces.convert.Converter

format

public static String format(long eventMillis)


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.