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

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


     */
    @Deprecated
    public static String formatTimestamp(long timestamp) {
        // NOTE: The below code was snarfed from org.rhq.enterprise.gui.legacy.taglib.DateFormatter.

        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),
View Full Code Here


        Boolean b = getIsElapsedTime();
        if (null == b) {
            b = Boolean.FALSE;
        }

        UnitsConstants unit = b.booleanValue() ? UnitsConstants.UNIT_DURATION : UnitsConstants.UNIT_DATE;
        String formatString;
        if ((format == null) || "".equals(format)) // old case with implicit format string
        {
            formatString = RequestUtils.message((HttpServletRequest) getPageContext().getRequest(),
                Constants.UNIT_FORMAT_PREFIX_KEY + "epoch-millis");
View Full Code Here

     *
     * @param date   The long to convert to a date.
     * @param asTime Whether to format this date as a time.
     */
    private String formatDate(Long date) {
        UnitsConstants unit = time.booleanValue() ? UnitsConstants.UNIT_DURATION : UnitsConstants.UNIT_DATE;
        String key = StringConstants.UNIT_FORMAT_PREFIX_KEY + "epoch-millis";

        if (!showTime.booleanValue()) {
            key += ".dateonly";
        }
View Full Code Here

TOP

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

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.