Package org.springframework.beans.propertyeditors

Examples of org.springframework.beans.propertyeditors.CustomDateEditor


     * of the right type.
     */
    private void configureFactory() {
        SimpleDateFormat formatter = new SimpleDateFormat(DATE_PATTERN, Locale.US);
        formatter.setTimeZone(TimeZone.getTimeZone("America/New_York"));
        CustomDateEditor dateEditor =
            new CustomDateEditor(formatter, true);
        registerCustomEditor(Date.class, dateEditor);
    }
View Full Code Here


      for (T element : filteredDataList) {
        item = new TableItem(table, SWT.NONE);
        row = new String[mappings.size()];
        try {
          BeanWrapper bw = new BeanWrapperImpl(element);
          bw.registerCustomEditor(Date.class, new CustomDateEditor(DATE_FORMAT, true));
         
          for (Mapping mapping : mappings) {
            PropertyEditor editor = bw.findCustomEditor(null, mapping.getField());
            if( editor != null ) {
              try {
View Full Code Here

    T bean = null;
    if(selection != null){
      bean = (T) selection.getData("data");
      int pos = 0;
      BeanWrapper bw = new BeanWrapperImpl(bean);
      bw.registerCustomEditor(Date.class, new CustomDateEditor(DATE_FORMAT, true));
      for (Mapping mapping : mappings) {
        try {
          bw.setPropertyValue(mapping.getField(), selection.getText(pos));
        } catch (NullValueInNestedPathException e) {}
       
View Full Code Here

        binder.registerCustomEditor(Integer.class, null, new CustomNumberEditor(Integer.class, null, true));
        binder.registerCustomEditor(Float.class, null, new CustomNumberEditor(Float.class, null, true));
        binder.registerCustomEditor(Set.class, "tags", new TagCollectionEditor(Set.class, true));
        binder.registerCustomEditor(List.class, new CustomCollectionEditor(List.class, true));
        binder.registerCustomEditor(Text.class, new CustomTextEditor());
        binder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("dd/MM/yyyy"), true));
        binder.registerCustomEditor(GeoPt.class, new CustomGeoPointsEditor());
       
        //binder.registerCustomEditor(Link.class, new CustomLinkEditor());
        /*To validate and more actions. */
        super.initBinder(binder, request);
View Full Code Here

 
  @InitBinder
  public void initBinder(WebDataBinder binder)
  {
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
    CustomDateEditor editor = new CustomDateEditor(dateFormat, true);
    binder.registerCustomEditor(Date.class, editor);
  }
View Full Code Here

  @InitBinder
  private void dataBinder(WebDataBinder binder)
  {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    CustomDateEditor editor = new CustomDateEditor(dateFormat, true);
    binder.registerCustomEditor(Date.class, editor);
  }
View Full Code Here

{
  @InitBinder
  private void dateBinder(WebDataBinder binder)
  {
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
    CustomDateEditor editor = new CustomDateEditor(dateFormat, true);
    binder.registerCustomEditor(Date.class, editor);
  }
View Full Code Here

      // to actually be able to convert Multipart instance to byte[] we have to register a custom editor
      binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
      // now Spring knows how to handle multipart object and convert
     
      DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
      CustomDateEditor editor = new CustomDateEditor(df, true);
      binder.registerCustomEditor(Date.class, editor);
  }
View Full Code Here

    @InitBinder("systemNotificationForm")
    protected void initBinder(WebDataBinder binder) {
        binder.setValidator(systemNotificationValidator);
        SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm");
        sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
        binder.registerCustomEditor(Date.class, new CustomDateEditor(sdf, true));
        binder.registerCustomEditor(SystemNotificationType.class, new EnumEditor(SystemNotificationType.class));
        binder.registerCustomEditor(SystemNotificationSeverity.class, new EnumEditor(SystemNotificationSeverity.class));
        binder.registerCustomEditor(List.class, "types", new CustomCollectionEditor(List.class) {
            @Override
            protected Object convertElement(Object element) {
View Full Code Here

    @InitBinder("organization")
    protected void initBinder(WebDataBinder binder) {
        binder.setValidator(organizationValidator);
        binder.setBindEmptyMultipartFiles(false);
        binder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("MM/dd/yyyy"), true));
    }
View Full Code Here

TOP

Related Classes of org.springframework.beans.propertyeditors.CustomDateEditor

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.