Examples of PropertyEditorRegistry


Examples of com.l2fprod.common.propertysheet.PropertyEditorRegistry

  public PropertyPanel(ManagedObject pManagedObject, Map<Class, PropertyEditor> pEditors) {
    super();
    try {
      managedObject = pManagedObject;
      if (pEditors != null) {
        PropertyEditorRegistry registry = (PropertyEditorRegistry) getEditorFactory();
        for (Class key : pEditors.keySet()) {
          registry.registerEditor(key, pEditors.get(key));
        }
      }
      setMode(PropertySheet.VIEW_AS_CATEGORIES);
      setSortingCategories(true);
      setSortingProperties(true);
View Full Code Here

Examples of org.springframework.beans.PropertyEditorRegistry

   * This implementation delegates to the
   * {@link #getPropertyEditorRegistry() PropertyEditorRegistry}'s
   * editor lookup facility, if available.
   */
  public PropertyEditor findEditor(String field, Class valueType) {
    PropertyEditorRegistry editorRegistry = getPropertyEditorRegistry();
    if (editorRegistry != null) {
      Class valueTypeToUse = valueType;
      if (valueTypeToUse == null) {
        valueTypeToUse = getFieldType(field);
      }
      return editorRegistry.findCustomEditor(valueTypeToUse, fixedField(field));
    }
    else {
      return null;
    }
  }
View Full Code Here

Examples of org.springframework.beans.PropertyEditorRegistry

   * This implementation delegates to the
   * {@link #getPropertyEditorRegistry() PropertyEditorRegistry}'s
   * editor lookup facility, if available.
   */
  public PropertyEditor findEditor(String field, Class<?> valueType) {
    PropertyEditorRegistry editorRegistry = getPropertyEditorRegistry();
    if (editorRegistry != null) {
      Class<?> valueTypeToUse = valueType;
      if (valueTypeToUse == null) {
        valueTypeToUse = getFieldType(field);
      }
      return editorRegistry.findCustomEditor(valueTypeToUse, fixedField(field));
    }
    else {
      return null;
    }
  }
View Full Code Here

Examples of org.springframework.beans.PropertyEditorRegistry

   * This implementation delegates to the
   * {@link #getPropertyEditorRegistry() PropertyEditorRegistry}'s
   * editor lookup facility, if available.
   */
  public PropertyEditor findEditor(String field, Class<?> valueType) {
    PropertyEditorRegistry editorRegistry = getPropertyEditorRegistry();
    if (editorRegistry != null) {
      Class<?> valueTypeToUse = valueType;
      if (valueTypeToUse == null) {
        valueTypeToUse = getFieldType(field);
      }
      return editorRegistry.findCustomEditor(valueTypeToUse, fixedField(field));
    }
    else {
      return null;
    }
  }
View Full Code Here

Examples of org.springframework.beans.PropertyEditorRegistry

   */
  protected void renderFromValue(Object resolvedValue, TagWriter tagWriter) throws JspException {
    BindStatus bindStatus = getBindStatus();
    PropertyEditor editor = null;
    if (resolvedValue != null && bindStatus.getErrors() instanceof BindingResult) {
      PropertyEditorRegistry editorRegistry = ((BindingResult) bindStatus.getErrors()).getPropertyEditorRegistry();
      if (editorRegistry != null) {
        editor = editorRegistry.findCustomEditor(resolvedValue.getClass(), bindStatus.getPath());
      }
    }
    tagWriter.writeAttribute("value", getDisplayString(resolvedValue, editor));
    if (SelectedValueComparator.isSelected(bindStatus, resolvedValue)) {
      tagWriter.writeAttribute("checked", "checked");
View Full Code Here

Examples of org.springframework.beans.PropertyEditorRegistry

  }

  private static boolean exhaustiveCollectionCompare(
      Collection collection, Object candidateValue, BindStatus bindStatus) {

    PropertyEditorRegistry editorRegistry = null;
    if (bindStatus.getErrors() instanceof BindingResult) {
      editorRegistry = ((BindingResult) bindStatus.getErrors()).getPropertyEditorRegistry();
    }
    Map convertedValueCache = new HashMap(1);
    PropertyEditor editor = null;
    boolean candidateIsString = (candidateValue instanceof String);
    if (editorRegistry != null && !candidateIsString) {
      editor = editorRegistry.findCustomEditor(candidateValue.getClass(), bindStatus.getPath());
    }
    for (Iterator it = collection.iterator(); it.hasNext();) {
      Object element = it.next();
      if (editor == null && editorRegistry != null && element != null && candidateIsString) {
        editor = editorRegistry.findCustomEditor(element.getClass(), bindStatus.getPath());
      }
      if (exhaustiveCompare(element, candidateValue, editor, convertedValueCache)) {
        return true;
      }
    }
View Full Code Here

Examples of org.springframework.beans.PropertyEditorRegistry

  }

  private static boolean exhaustiveCollectionCompare(
      Collection collection, Object candidateValue, BindStatus bindStatus) {

    PropertyEditorRegistry editorRegistry = null;
    if (bindStatus.getErrors() instanceof BindingResult) {
      editorRegistry = ((BindingResult) bindStatus.getErrors()).getPropertyEditorRegistry();
    }
    Map convertedValueCache = new HashMap(1);
    for (Iterator it = collection.iterator(); it.hasNext();) {
      Object element = it.next();
      PropertyEditor propertyEditor = null;
      if (element != null && editorRegistry != null) {
        propertyEditor = editorRegistry.findCustomEditor(element.getClass(), bindStatus.getPath());
      }
      if (exhaustiveCompare(element, candidateValue, propertyEditor, convertedValueCache)) {
        return true;
      }
    }
View Full Code Here

Examples of org.springframework.beans.PropertyEditorRegistry

     * Obtains the PropertyEditorRegistry instance.
     * @return The PropertyEditorRegistry
     */
    public PropertyEditorRegistry getPropertyEditorRegistry() {
        final HttpServletRequest servletRequest = getCurrentRequest();
        PropertyEditorRegistry registry = (PropertyEditorRegistry) servletRequest.getAttribute(GrailsApplicationAttributes.PROPERTY_REGISTRY);
        if (registry == null) {
            registry = new PropertyEditorRegistrySupport();
            PropertyEditorRegistryUtils.registerCustomEditors(this, registry, RequestContextUtils.getLocale(servletRequest));
            servletRequest.setAttribute(GrailsApplicationAttributes.PROPERTY_REGISTRY, registry);
        }
View Full Code Here

Examples of org.springframework.beans.PropertyEditorRegistry

   * {@link #getPropertyEditorRegistry() PropertyEditorRegistry}'s
   * editor lookup facility, if available.
   */
  @Override
  public PropertyEditor findEditor(String field, Class<?> valueType) {
    PropertyEditorRegistry editorRegistry = getPropertyEditorRegistry();
    if (editorRegistry != null) {
      Class<?> valueTypeToUse = valueType;
      if (valueTypeToUse == null) {
        valueTypeToUse = getFieldType(field);
      }
      return editorRegistry.findCustomEditor(valueTypeToUse, fixedField(field));
    }
    else {
      return null;
    }
  }
View Full Code Here

Examples of org.springframework.beans.PropertyEditorRegistry

   * This implementation delegates to the
   * {@link #getPropertyEditorRegistry() PropertyEditorRegistry}'s
   * editor lookup facility, if available.
   */
  public PropertyEditor findEditor(String field, Class valueType) {
    PropertyEditorRegistry editorRegistry = getPropertyEditorRegistry();
    if (editorRegistry != null) {
      Class valueTypeToUse = valueType;
      if (valueTypeToUse == null) {
        valueTypeToUse = getFieldType(field);
      }
      return editorRegistry.findCustomEditor(valueTypeToUse, fixedField(field));
    }
    else {
      return null;
    }
  }
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.