Package org.rhq.core.clientapi.util.units

Examples of org.rhq.core.clientapi.util.units.FormattedNumber


        UnitsConstants unit = UnitsConstants.UNIT_DATE;
        String key = StringConstants.UNIT_FORMAT_PREFIX_KEY + "epoch-millis";
        String formatString = RequestUtils.message(FacesContextUtility.getRequest(), key);
        DateFormatter.DateSpecifics specs = new DateFormatter.DateSpecifics();
        specs.setDateFormat(new SimpleDateFormat(formatString));
        FormattedNumber fmtd = UnitsFormat.format(new UnitNumber(timestamp, unit, ScaleConstants.SCALE_MILLI),
            FacesContextUtility.getRequest().getLocale(), specs);
        return fmtd.toString();
    }
View Full Code Here


        DateFormatter.DateSpecifics dateSpecs;

        dateSpecs = new DateFormatter.DateSpecifics();
        dateSpecs.setDateFormat(new SimpleDateFormat(formatString));
        FormattedNumber fmtd = UnitsFormat.format(new UnitNumber(newDate.doubleValue(), unit,
            ScaleConstants.SCALE_MILLI), getPageContext().getRequest().getLocale(), dateSpecs);
        buf.append(fmtd.toString());
        return buf.toString();
    }
View Full Code Here

        }

        String formatString = RequestUtils.message((HttpServletRequest) pageContext.getRequest(), key);
        DateSpecifics specs = new DateSpecifics();
        specs.setDateFormat(new SimpleDateFormat(formatString));
        FormattedNumber fmtd = UnitsFormat.format(new UnitNumber(date.doubleValue(), unit, ScaleConstants.SCALE_MILLI),
            pageContext.getRequest().getLocale(), specs);
        return fmtd.toString();
    }
View Full Code Here

                    DateSpecifics specs = new DateSpecifics();
                    specs.setDateFormat(new SimpleDateFormat(res.getMessage(Constants.UNIT_FORMAT_PREFIX_KEY
                        + "epoch-millis")));

                    FormattedNumber fmtd = UnitsFormat.format(new UnitNumber(alert.getCtime(),
                        UnitsConstants.UNIT_DATE, ScaleConstants.SCALE_MILLI), request.getLocale(), specs);

                    feed.addItem(alert.getAlertDefinition().getResource().getName() + " "
                        + alert.getAlertDefinition().getName(), link, fmtd.toString(), alert.getCtime());
                }
            }

            request.setAttribute("rssFeed", feed);
View Full Code Here

TOP

Related Classes of org.rhq.core.clientapi.util.units.FormattedNumber

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.