Examples of PropertyFormatter


Examples of com.vaadin.data.util.PropertyFormatter

            public Field createField(Item item, Object propertyId,
                    Component uiContext) {
                AbstractField f = (AbstractField) DefaultFieldFactory.get()
                        .createField(item, propertyId, uiContext);
                if (propertyId.equals("age")) {
                    f.setPropertyDataSource(new PropertyFormatter() {

                        @Override
                        public Object parse(String formattedValue)
                                throws Exception {
                            String str = formattedValue.replaceAll("[^0-9.]",
View Full Code Here

Examples of com.vaadin.data.util.PropertyFormatter

        final Property property = item.getItemProperty(pid);
        if (property == null && !formatNullProperties) {
          return null;
        }//not exists

        PropertyFormatter propertyFormatter = instances.get(pid);
        if (propertyFormatter != null) {
            propertyFormatter.setPropertyDataSource(property);
            return propertyFormatter;
        }

        Class<? extends PropertyFormatter> propertyFormatterClass = classes.get(pid);
        if (propertyFormatterClass != null) {
            try {
                propertyFormatter = propertyFormatterClass.newInstance();
            } catch (InstantiationException e) {
                throw new IllegalStateException(
                        "getItemProperty: can't create "
                                + propertyFormatterClass.getName()
                                + " instance for PID=" + pid, e);
            } catch (IllegalAccessException e) {
                throw new IllegalStateException(
                        "getItemProperty: can't create "
                                + propertyFormatterClass.getName()
                                + " instance for PID=" + pid + ": IAE", e);
            }// t

            propertyFormatter.setPropertyDataSource(property);
            return propertyFormatter;
        }// i

        return property;// as is
    }//getItemProperty
View Full Code Here

Examples of com.vaadin.data.util.PropertyFormatter

            @Override
            public Component generateCell(Table source, final Object itemId, Object columnId) {
                Property prop = source.getItem(itemId).getItemProperty(columnId);
                if (prop.getType().equals(UserData.class)) {
                    Label l = new Label();       
                    l.setPropertyDataSource(new PropertyFormatter(prop) {
                        @Override
                        public String format(Object o) {
                            return ((UserData)o).getRealName();
                        }
View Full Code Here

Examples of com.vaadin.data.util.PropertyFormatter

  public void setPropertyDataSource(final Property newDataSource) {
    super.setPropertyDataSource(getPropertyFormatter(newDataSource));
  }

  protected PropertyFormatter getPropertyFormatter(final Property newDataSource) {
    PropertyFormatter propertyFormatter = new PropertyFormatter(newDataSource) {
      @Override
      public String format(Object value) {
        if (value == null) {
          return getNullRepresentation();
        }
View Full Code Here

Examples of com.vaadin.data.util.PropertyFormatter

  public void setPropertyDataSource(final Property newDataSource) {
    super.setPropertyDataSource(getPropertyFormatter(newDataSource));
  }

    protected PropertyFormatter getPropertyFormatter(Property newDataSource) {
        return new PropertyFormatter(newDataSource) {
            @Override
            public String format(Object value) {
                if (value == null) {
                    return getNullRepresentation();
                }
View Full Code Here

Examples of mondrian.spi.PropertyFormatter

            if (prop1.getName().equals(propertyName)) {
                prop = prop1;
                break;
            }
        }
        PropertyFormatter pf;
        if (prop != null && (pf = prop.getFormatter()) != null) {
            return pf.formatProperty(
                this, propertyName,
                getPropertyValue(propertyName));
        }

        Object val = getPropertyValue(propertyName);
View Full Code Here

Examples of mondrian.spi.PropertyFormatter

                    Property.NAME.description));
        }
        for (int i = 0; i < xmlLevel.properties.length; i++) {
            MondrianDef.Property xmlProperty = xmlLevel.properties[i];

            final PropertyFormatter formatter;
            final String propertyFormatterClassName;
            final Scripts.ScriptDefinition scriptDefinition;
            if (xmlProperty.propertyFormatter != null) {
                propertyFormatterClassName =
                    xmlProperty.propertyFormatter.className;
View Full Code Here

Examples of org.infinispan.configuration.format.PropertyFormatter

         displayName = "Cache configuration properties",
         dataType = DataType.TRAIT,
         displayType = DisplayType.SUMMARY
   )
   public Properties getConfigurationAsProperties() {
      return new PropertyFormatter().format(config);
   }
View Full Code Here

Examples of org.infinispan.configuration.format.PropertyFormatter

   /**
    * {@inheritDoc}
    */
   @ManagedAttribute(description = "Global configuration properties", displayName = "Global configuration properties", dataType = DataType.TRAIT, displayType = DisplayType.SUMMARY)
   public Properties getGlobalConfigurationAsProperties() {
      return new PropertyFormatter().format(globalConfiguration);
   }
View Full Code Here

Examples of org.infinispan.configuration.format.PropertyFormatter

   /**
    * {@inheritDoc}
    */
   @ManagedAttribute(description = "Global configuration properties", displayName = "Global configuration properties", dataType = DataType.TRAIT, displayType = DisplayType.SUMMARY)
   public Properties getGlobalConfigurationAsProperties() {
      return new PropertyFormatter().format(globalConfiguration);
   }
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.