Package org.jboss.dashboard.provider

Examples of org.jboss.dashboard.provider.DataPropertyFormatter


    protected String formatCellValue(Table table, int row, int column) {
        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()));
    }
View Full Code Here


        // If property exist in any dashboard's data provider, get it and get its name
        DataProperty property = getDataProperty();
        if (property != null) return property.getName(l);

        // If property is static, use data property formatter to get its name.
        DataPropertyFormatter df = getDataPropertyFormatter();
        if (df != null) return df.formatName(propertyId, l);
        return propertyId;
    }
View Full Code Here

        return propertyId;
    }

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

        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

                List allowedValues = new ArrayList();
                String[] allowedArray = StringUtils.split(staticProperty.getProperty("allowedvalues"), ",");
                for (int j = 0; j < allowedArray.length && allowedArray != null; j++) {
                    String allowedStr = allowedArray[j];
                    try {
                        DataPropertyFormatter dpf = DataFormatterRegistry.lookup().getPropertyFormatter(propertyId);
                        allowedValues.add(dpf.parsePropertyValue(getStaticPropertyClass(propertyId), allowedStr));
                    } catch (Exception e) {
                        log.error("Can not  parse static prpoerty allowed value: " + allowedStr);
                        continue;
                    }
                }
View Full Code Here

    /**
     * Get the class for a given property.
     */
    public Class getPropertyClass(String propertyId) {
        DataPropertyFormatter dpf = DataFormatterRegistry.lookup().getPropertyFormatter(propertyId);
        DataProperty property = dashboard.getDataPropertyById(propertyId);
        if (property != null) return dpf.getPropertyClass(property);
        return getStaticPropertyClass(propertyId);
    }
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());
    }
View Full Code Here

    public String getDescription(Locale l) {
        DataFormatterRegistry dfr = DataFormatterRegistry.lookup();
        DataProperty property = getDomain().getProperty();
        if (property == null) return label;

        DataPropertyFormatter dpf = dfr.getPropertyFormatter(property.getPropertyId());
        return dpf.formatValue(property, label, l);
    }
View Full Code Here

                List allowedValues = new ArrayList();
                String[] allowedArray = StringUtils.split(staticProperty.getProperty("allowedvalues"), ",");
                for (int j = 0; allowedArray != null && j < allowedArray.length; j++) {
                    String allowedStr = allowedArray[j];
                    try {
                        DataPropertyFormatter dpf = DataFormatterRegistry.lookup().getPropertyFormatter(propertyId);
                        allowedValues.add(dpf.parsePropertyValue(getStaticPropertyClass(propertyId), allowedStr));
                    } catch (Exception e) {
                        log.error("Can not  parse static prpoerty allowed value: " + allowedStr);
                        continue;
                    }
                }
View Full Code Here

    /**
     * Get the class for a given property.
     */
    public Class getPropertyClass(String propertyId) {
        DataPropertyFormatter dpf = DataFormatterRegistry.lookup().getPropertyFormatter(propertyId);
        DataProperty property = dashboard.getDataPropertyById(propertyId);
        if (property != null) return dpf.getPropertyClass(property);
        return getStaticPropertyClass(propertyId);
    }
View Full Code Here

TOP

Related Classes of org.jboss.dashboard.provider.DataPropertyFormatter

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.