Package org.jboss.dashboard.provider

Examples of org.jboss.dashboard.provider.DataPropertyFormatter.formatValue()


            for (int j = 0; j < dataSet.getProperties().length; j++) {
                Object dataSetValue = dataSet.getValueAt(i, j);
                DataProperty prop = dataSet.getPropertyByColumn(j);
                DataPropertyFormatter propFormatter = dataFormatterRegistry.getPropertyFormatter(prop.getPropertyId());
                String displayedValue = propFormatter.formatValue(prop, dataSetValue, Locale.ENGLISH);

                if (j > 0) buf.append(",");
                buf.append("\"" + displayedValue + "\"");
            }
            buf.append("}");
View Full Code Here


    // AbstractFilter implementation

    protected String formatForDisplay(String propertyId, Object value) {
        DataPropertyFormatter formatter = DataFormatterRegistry.lookup().getPropertyFormatter(propertyId);
        return formatter.formatValue(propertyId, value, LocaleManager.currentLocale());
    }

    protected String formatForComparison(String propertyId, Object value) {
        // Some types need to be prepared for comparison.
        if (value instanceof Number) return _numberComparisonFormat.format(value);
View Full Code Here

        DataPropertyFormatter dpf = DataFormatterRegistry.lookup().getPropertyFormatter(propId);
        Locale locale = LocaleManager.currentLocale();
       
        if (FILTER_MIN_VALUE.equals(commandName)) {
            Comparable min = filterProp.getPropertyMinValue();
            return dpf.formatValue(propId, min, locale);
        }
        if (FILTER_MAX_VALUE.equals(commandName)) {
            Comparable max = filterProp.getPropertyMaxValue();
            return dpf.formatValue(propId, max, locale);
        }
View Full Code Here

            Comparable min = filterProp.getPropertyMinValue();
            return dpf.formatValue(propId, min, locale);
        }
        if (FILTER_MAX_VALUE.equals(commandName)) {
            Comparable max = filterProp.getPropertyMaxValue();
            return dpf.formatValue(propId, max, locale);
        }
        if (FILTER_SELECTED.equals(commandName)) {
            List values = filterProp.getPropertySelectedValues();
            if (values.isEmpty()) return null;
View Full Code Here

            StringBuffer result = new StringBuffer();
            Iterator it = values.iterator();
            while (it.hasNext()) {
                Object value = it.next();
                if (result.length() > 0) result.append(separator);
                result.append(dpf.formatValue(propId, value, locale));
            }
            return result.toString();
        }
        if (FILTER_ALL.equals(commandName)) {
            List values = filterProp.getPropertyDistinctValues();
View Full Code Here

            StringBuffer result = new StringBuffer();
            Iterator it = values.iterator();
            while (it.hasNext()) {
                Object value = it.next();
                if (result.length() > 0) result.append(separator);
                result.append(dpf.formatValue(propId, value, locale));
            }
            return result.toString();
        }
        return "[" + commandName + ", command not supported]";
    }
View Full Code Here

    public String formatPropertyValue(Object value, Locale l) {
        DataProperty property = getDataProperty();
        DataPropertyFormatter df = getDataPropertyFormatter();
        if (df == null) return value == null ? "" : value.toString();
        if (property != null) return df.formatValue(property, value, l);
        return df.formatValue(propertyId,value,l);
    }

    public Object parsePropertyValue(String value) throws Exception {
        DataPropertyFormatter df = getDataPropertyFormatter();
View Full Code Here

    public String formatPropertyValue(Object value, Locale l) {
        DataProperty property = getDataProperty();
        DataPropertyFormatter df = getDataPropertyFormatter();
        if (df == null) return value == null ? "" : value.toString();
        if (property != null) return df.formatValue(property, value, l);
        return df.formatValue(propertyId,value,l);
    }

    public Object parsePropertyValue(String value) throws Exception {
        DataPropertyFormatter df = getDataPropertyFormatter();
        return isStaticProperty() ? df.parsePropertyValue(getPropertyClass(), value) : df.parsePropertyValue(getDataProperty(),value);
View Full Code Here

        DataSetTable dataSetTable = (DataSetTable) table;
        DataProperty property = dataSetTable.getDataProperty(column);
        if (property == null) return "";
       
        DataPropertyFormatter formatter = DataFormatterRegistry.lookup().getPropertyFormatter(property.getPropertyId());
        return StringEscapeUtils.escapeHtml(formatter.formatValue(property, table.getValueAt(row, column), LocaleManager.currentLocale()));
    }

    protected void renderFragment(String fragment) {
        super.renderFragment(fragment);
View Full Code Here

        DataFormatterRegistry dfr = DataFormatterRegistry.lookup();
        DataProperty property = getDomain().getProperty();
        if (property == null) return getLabel();

        DataPropertyFormatter dpf = dfr.getPropertyFormatter(property.getPropertyId());
        return dpf.formatValue(property, getLabel(), l);
    }

    public List getValues(DataProperty p) {
        List results = new ArrayList();
        List targetValues = p.getValues();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.