Example usage for org.springframework.beans.propertyeditors CustomDateEditor CustomDateEditor

List of usage examples for org.springframework.beans.propertyeditors CustomDateEditor CustomDateEditor

Introduction

In this page you can find the example usage for org.springframework.beans.propertyeditors CustomDateEditor CustomDateEditor.

Prototype

public CustomDateEditor(DateFormat dateFormat, boolean allowEmpty) 

Source Link

Document

Create a new CustomDateEditor instance, using the given DateFormat for parsing and rendering.

Usage

From source file:com.quartzdesk.test.common.spring.CustomEditorRegistrar.java

@Override
public void registerCustomEditors(PropertyEditorRegistry registry) {
    registry.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), false));
}

From source file:org.parancoe.basicWebApp.controllers.BasicPropertyEditorRegistrar.java

public void registerCustomEditors(PropertyEditorRegistry reg) {
    reg.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("dd/MM/yyyy"), true));
}

From source file:org.parancoe.basicWebApp.controllers.BasicWebAppBindingInitializer.java

public void initBinder(WebDataBinder binder, WebRequest request) {
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    dateFormat.setLenient(false);//from  ww w  .j ava  2s .c  o m
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}

From source file:com.fahmi.hardinal.controller.ArticleController.java

@InitBinder //convert date 
public void initBinder(WebDataBinder binder) {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
    dateFormat.setLenient(false);/*from ww w . j  a v  a  2s  .c o  m*/
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}

From source file:com.bangla.store.controller.EmployeeController.java

@InitBinder
public void initialiseBinder(WebDataBinder binder) {
    binder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), true));
    SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
    binder.registerCustomEditor(Date.class, "officeStart", new CustomDateEditor(timeFormat, true));
    binder.registerCustomEditor(Date.class, "officeEnd", new CustomDateEditor(timeFormat, true));
    binder.setDisallowedFields("presentAddress", "picture", "nid", "permanentAddress", "fatherName",
            "emergencyContact", "employeeTelExt", "employeeDistrictId", "employeeAreaId",
            "employeeDesignationId", "employeeUserPassword", "employeeDepartmentId", "employeeGroupId",
            "employeeTotalSalary", "employeeStatus", "employeeRemarks", "dhakacomId", "shiftingId", "cLObtain",
            "cLSpent", "mLObtain", "mLSpent", "eLObtain", "eLSpent", "employeeCurrentStatus", "reason");

    binder.setAllowedFields("id", "employeeUserName", "employeeName", "employeeEmail", "employeeMobile",
            "dateOfBirth", "officeStart", "officeEnd", "effectDate");

}

From source file:com.oracle.weblogic.examples.spring.rest.ExampleController.java

@InitBinder
public void initBinder(WebDataBinder binder) {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}

From source file:com.aplikasi.penjualan.controller.DataBarangHtmlController.java

@InitBinder
public void initBinder(WebDataBinder binder) {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    dateFormat.setLenient(false);// w  ww . j a  v a 2s .c  om
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}

From source file:abm.jakaria.school.CommiteeController.java

@InitBinder
public void initBinder(WebDataBinder binder) {
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
    dateFormat.setLenient(false);//from   w w  w  . j  a  v  a 2 s.co  m
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}

From source file:com.mir00r.controller.HelloController.java

@InitBinder
public void MyInitBinder(WebDataBinder binder) {
    //binder.setDisallowedFields(new String[]{"empMobile"});
    SimpleDateFormat format = new SimpleDateFormat("yyyy-mm-dd");
    binder.registerCustomEditor(Date.class, "empDOB", new CustomDateEditor(format, false));
    //  binder.registerCustomEditor(String.class, "ename", new EmployeeNameEditor());
}

From source file:org.jdal.ui.bind.AbstractControlAccessor.java

/**
 * Create a ContolAccesor and set the control
 * @param control the control to set//from  w  ww.  j  a va 2  s .com
 */
public AbstractControlAccessor(Object control) {
    setControl(control);
    registerCustomEditor(Date.class,
            new CustomDateEditor(SimpleDateFormat.getDateInstance(SimpleDateFormat.SHORT), true));
}