Example usage for org.springframework.web.bind WebDataBinder registerCustomEditor

List of usage examples for org.springframework.web.bind WebDataBinder registerCustomEditor

Introduction

In this page you can find the example usage for org.springframework.web.bind WebDataBinder registerCustomEditor.

Prototype

@Override
    public void registerCustomEditor(@Nullable Class<?> requiredType, @Nullable String field,
            PropertyEditor propertyEditor) 

Source Link

Usage

From source file:com.healthcit.cacure.web.controller.BaseFormEditController.java

@InitBinder
public void initBinder(WebDataBinder dataBinder) {
    dataBinder.registerCustomEditor(null, "formSkip",
            new SkipPatternPropertyEditor<FormSkipRule>(FormSkipRule.class, skipDao));
}

From source file:de.berlios.jhelpdesk.web.manager.ticketcategory.TicketCategoryEditController.java

@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.registerCustomEditor(Long.class, null,
            new CustomNumberEditor(Long.class, NumberFormat.getNumberInstance(), true));
    binder.registerCustomEditor(Boolean.class, null, new CustomBooleanEditor(true));
}

From source file:org.easyj.rest.controller.TestEntityController.java

@InitBinder
public void customizeConversions(WebDataBinder binder) {
    DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
    binder.registerCustomEditor(Date.class, "testDate", new CustomDateEditor(df, true));
}

From source file:org.opentides.web.controller.WidgetController.java

@InitBinder
protected void registerEditor(WebDataBinder binder) throws Exception {
    binder.registerCustomEditor(Date.class, "lastCacheUpdate",
            new CustomDateEditor(new SimpleDateFormat("MMM dd, yyyy hh:mm:ss"), true));
}

From source file:org.hydroponics.web.controller.EditSchedule.java

@InitBinder()
public void initBinder(WebDataBinder binder) throws Exception {
    binder.registerCustomEditor(ArrayList.class, Constants.PAGE_EDIT_SCHEDULES,
            new CustomCollectionEditor(ArrayList.class) {
                protected Object convertElement(Object element) {
                    return super.convertElement(element);
                }// w  w w.j a  v a 2s  .  c o  m
            });
}

From source file:ru.mystamps.web.controller.AccountController.java

@InitBinder("registerAccountForm")
protected void registrationInitBinder(WebDataBinder binder) {
    binder.registerCustomEditor(String.class, "email", new StringTrimmerEditor(false));
}

From source file:ru.mystamps.web.controller.AccountController.java

@InitBinder("activateAccountForm")
protected void activationInitBinder(WebDataBinder binder) {
    binder.registerCustomEditor(String.class, "login", new StringTrimmerEditor(true));
    binder.registerCustomEditor(String.class, "name", new StringTrimmerEditor(true));
}

From source file:de.berlios.jhelpdesk.web.ticket.TicketNewController.java

@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.registerCustomEditor(User.class, "notifier", userEditor);
    binder.registerCustomEditor(TicketPriority.class, priorityEditor);
    binder.registerCustomEditor(TicketCategory.class, categoryEditor);
}

From source file:de.berlios.jhelpdesk.web.manager.ArticleController.java

@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.registerCustomEditor(ArticleCategory.class, "category", articleCategoryEditor);
    binder.registerCustomEditor(User.class, "author", userEditor);
    NumberFormat nf = NumberFormat.getNumberInstance();
    binder.registerCustomEditor(Long.class, null, new CustomNumberEditor(Long.class, nf, true));
}

From source file:de.berlios.jhelpdesk.web.manager.users.UserEditController.java

/**
 * Rejestruje edytory waciwoci niezbdne podczas edycji danych
 * uytkownika./*from www  .j  a v  a 2  s. c  o m*/
 *
 * @param binder
 *
 * @see WebDataBinder
 */
@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.registerCustomEditor(Role.class, "userRole", roleEditor);
    binder.registerCustomEditor(Long.class, null,
            new CustomNumberEditor(Long.class, NumberFormat.getNumberInstance(), true));
    binder.registerCustomEditor(Boolean.class, null, new CustomBooleanEditor(true));
}