You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Peter Ertl (JIRA)" <ji...@apache.org> on 2008/04/25 15:09:55 UTC

[jira] Created: (WICKET-1568) let converter of component handle the same generic type that the model of the component contains

let converter of component handle the same generic type that the model of the component contains
------------------------------------------------------------------------------------------------

                 Key: WICKET-1568
                 URL: https://issues.apache.org/jira/browse/WICKET-1568
             Project: Wicket
          Issue Type: Improvement
          Components: wicket
            Reporter: Peter Ertl
         Attachments: converter.patch

I think it will be straightforward to let the converter of a component handle the same type <T> that the component itself uses

----------------------

public class MyMoneyTextField extends TextField<BigDecimal>
{
  public MyMoneyTextField(final String id, final IModel<BigDecimal> model)
  {
    super(id, model);
  }

  // ...
  
  @Override
  public IConverter<BigDecimal> getConverter(final Class<BigDecimal> type)
  {
    return new IConverter<BigDecimal>()
    {
      public BigDecimal convertToObject(final String value, final Locale locale)
      {
        // ...
      }

      public String convertToString(final BigDecimal value, final Locale locale)
      {
        // ...
      }
    };
  }
}


I attached a patch that implements this change and ask you to take a look at and integrate it if you consider it right and helpful.

Best regards
Peter

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (WICKET-1568) contribution for wicket 1.4 generics (IConverter)

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johan Compagner closed WICKET-1568.
-----------------------------------

    Resolution: Fixed

> contribution for wicket 1.4 generics (IConverter)
> -------------------------------------------------
>
>                 Key: WICKET-1568
>                 URL: https://issues.apache.org/jira/browse/WICKET-1568
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4-M1
>            Reporter: Peter Ertl
>            Assignee: Johan Compagner
>             Fix For: 1.4-M2
>
>         Attachments: converter.patch
>
>
> I think it will be straightforward to let the converter of a component handle the same type <T> that the component itself uses
> ----------------------
> public class MyMoneyTextField extends TextField<BigDecimal>
> {
>   public MyMoneyTextField(final String id, final IModel<BigDecimal> model)
>   {
>     super(id, model);
>   }
>   // ...
>   
>   @Override
>   public IConverter<BigDecimal> getConverter(final Class<BigDecimal> type)
>   {
>     // no ugly casts here anymore :-)
>     //
>     return new IConverter<BigDecimal>()
>     {
>       public BigDecimal convertToObject(final String value, final Locale locale)
>       {
>         // ...
>       }
>       public String convertToString(final BigDecimal value, final Locale locale)
>       {
>         // ...
>       }
>     };
>   }
> }
> I attached a patch that implements this change and ask you to take a look at and integrate it if you consider it right and helpful.
> Best regards
> Peter

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1568) let converter of component handle the same generic type that the model of the component contains

Posted by "Peter Ertl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Ertl updated WICKET-1568:
-------------------------------

    Attachment: converter.patch

> let converter of component handle the same generic type that the model of the component contains
> ------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-1568
>                 URL: https://issues.apache.org/jira/browse/WICKET-1568
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: Peter Ertl
>         Attachments: converter.patch
>
>
> I think it will be straightforward to let the converter of a component handle the same type <T> that the component itself uses
> ----------------------
> public class MyMoneyTextField extends TextField<BigDecimal>
> {
>   public MyMoneyTextField(final String id, final IModel<BigDecimal> model)
>   {
>     super(id, model);
>   }
>   // ...
>   
>   @Override
>   public IConverter<BigDecimal> getConverter(final Class<BigDecimal> type)
>   {
>     return new IConverter<BigDecimal>()
>     {
>       public BigDecimal convertToObject(final String value, final Locale locale)
>       {
>         // ...
>       }
>       public String convertToString(final BigDecimal value, final Locale locale)
>       {
>         // ...
>       }
>     };
>   }
> }
> I attached a patch that implements this change and ask you to take a look at and integrate it if you consider it right and helpful.
> Best regards
> Peter

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1568) contribution for wicket 1.4 generics (IConverter)

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johan Compagner updated WICKET-1568:
------------------------------------

        Fix Version/s: 1.4-M2
    Affects Version/s: 1.4-M1

> contribution for wicket 1.4 generics (IConverter)
> -------------------------------------------------
>
>                 Key: WICKET-1568
>                 URL: https://issues.apache.org/jira/browse/WICKET-1568
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4-M1
>            Reporter: Peter Ertl
>            Assignee: Johan Compagner
>             Fix For: 1.4-M2
>
>         Attachments: converter.patch
>
>
> I think it will be straightforward to let the converter of a component handle the same type <T> that the component itself uses
> ----------------------
> public class MyMoneyTextField extends TextField<BigDecimal>
> {
>   public MyMoneyTextField(final String id, final IModel<BigDecimal> model)
>   {
>     super(id, model);
>   }
>   // ...
>   
>   @Override
>   public IConverter<BigDecimal> getConverter(final Class<BigDecimal> type)
>   {
>     // no ugly casts here anymore :-)
>     //
>     return new IConverter<BigDecimal>()
>     {
>       public BigDecimal convertToObject(final String value, final Locale locale)
>       {
>         // ...
>       }
>       public String convertToString(final BigDecimal value, final Locale locale)
>       {
>         // ...
>       }
>     };
>   }
> }
> I attached a patch that implements this change and ask you to take a look at and integrate it if you consider it right and helpful.
> Best regards
> Peter

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WICKET-1568) contribution for wicket 1.4 generics (IConverter)

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reassigned WICKET-1568:
-------------------------------------

    Assignee: Johan Compagner

> contribution for wicket 1.4 generics (IConverter)
> -------------------------------------------------
>
>                 Key: WICKET-1568
>                 URL: https://issues.apache.org/jira/browse/WICKET-1568
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: Peter Ertl
>            Assignee: Johan Compagner
>         Attachments: converter.patch
>
>
> I think it will be straightforward to let the converter of a component handle the same type <T> that the component itself uses
> ----------------------
> public class MyMoneyTextField extends TextField<BigDecimal>
> {
>   public MyMoneyTextField(final String id, final IModel<BigDecimal> model)
>   {
>     super(id, model);
>   }
>   // ...
>   
>   @Override
>   public IConverter<BigDecimal> getConverter(final Class<BigDecimal> type)
>   {
>     // no ugly casts here anymore :-)
>     //
>     return new IConverter<BigDecimal>()
>     {
>       public BigDecimal convertToObject(final String value, final Locale locale)
>       {
>         // ...
>       }
>       public String convertToString(final BigDecimal value, final Locale locale)
>       {
>         // ...
>       }
>     };
>   }
> }
> I attached a patch that implements this change and ask you to take a look at and integrate it if you consider it right and helpful.
> Best regards
> Peter

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1568) contribution for wicket 1.4 generics (IConverter)

Posted by "Peter Ertl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Ertl updated WICKET-1568:
-------------------------------

    Summary: contribution for wicket 1.4 generics (IConverter)  (was: let converter of component handle the same generic type that the model of the component contains)

> contribution for wicket 1.4 generics (IConverter)
> -------------------------------------------------
>
>                 Key: WICKET-1568
>                 URL: https://issues.apache.org/jira/browse/WICKET-1568
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: Peter Ertl
>         Attachments: converter.patch
>
>
> I think it will be straightforward to let the converter of a component handle the same type <T> that the component itself uses
> ----------------------
> public class MyMoneyTextField extends TextField<BigDecimal>
> {
>   public MyMoneyTextField(final String id, final IModel<BigDecimal> model)
>   {
>     super(id, model);
>   }
>   // ...
>   
>   @Override
>   public IConverter<BigDecimal> getConverter(final Class<BigDecimal> type)
>   {
>     return new IConverter<BigDecimal>()
>     {
>       public BigDecimal convertToObject(final String value, final Locale locale)
>       {
>         // ...
>       }
>       public String convertToString(final BigDecimal value, final Locale locale)
>       {
>         // ...
>       }
>     };
>   }
> }
> I attached a patch that implements this change and ask you to take a look at and integrate it if you consider it right and helpful.
> Best regards
> Peter

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1568) contribution for wicket 1.4 generics (IConverter)

Posted by "Peter Ertl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Ertl updated WICKET-1568:
-------------------------------

    Description: 
I think it will be straightforward to let the converter of a component handle the same type <T> that the component itself uses

----------------------

public class MyMoneyTextField extends TextField<BigDecimal>
{
  public MyMoneyTextField(final String id, final IModel<BigDecimal> model)
  {
    super(id, model);
  }

  // ...
  
  @Override
  public IConverter<BigDecimal> getConverter(final Class<BigDecimal> type)
  {
    // no ugly casts here anymore :-)
    //
    return new IConverter<BigDecimal>()
    {
      public BigDecimal convertToObject(final String value, final Locale locale)
      {
        // ...
      }

      public String convertToString(final BigDecimal value, final Locale locale)
      {
        // ...
      }
    };
  }
}


I attached a patch that implements this change and ask you to take a look at and integrate it if you consider it right and helpful.

Best regards
Peter

  was:
I think it will be straightforward to let the converter of a component handle the same type <T> that the component itself uses

----------------------

public class MyMoneyTextField extends TextField<BigDecimal>
{
  public MyMoneyTextField(final String id, final IModel<BigDecimal> model)
  {
    super(id, model);
  }

  // ...
  
  @Override
  public IConverter<BigDecimal> getConverter(final Class<BigDecimal> type)
  {
    return new IConverter<BigDecimal>()
    {
      public BigDecimal convertToObject(final String value, final Locale locale)
      {
        // ...
      }

      public String convertToString(final BigDecimal value, final Locale locale)
      {
        // ...
      }
    };
  }
}


I attached a patch that implements this change and ask you to take a look at and integrate it if you consider it right and helpful.

Best regards
Peter


> contribution for wicket 1.4 generics (IConverter)
> -------------------------------------------------
>
>                 Key: WICKET-1568
>                 URL: https://issues.apache.org/jira/browse/WICKET-1568
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: Peter Ertl
>         Attachments: converter.patch
>
>
> I think it will be straightforward to let the converter of a component handle the same type <T> that the component itself uses
> ----------------------
> public class MyMoneyTextField extends TextField<BigDecimal>
> {
>   public MyMoneyTextField(final String id, final IModel<BigDecimal> model)
>   {
>     super(id, model);
>   }
>   // ...
>   
>   @Override
>   public IConverter<BigDecimal> getConverter(final Class<BigDecimal> type)
>   {
>     // no ugly casts here anymore :-)
>     //
>     return new IConverter<BigDecimal>()
>     {
>       public BigDecimal convertToObject(final String value, final Locale locale)
>       {
>         // ...
>       }
>       public String convertToString(final BigDecimal value, final Locale locale)
>       {
>         // ...
>       }
>     };
>   }
> }
> I attached a patch that implements this change and ask you to take a look at and integrate it if you consider it right and helpful.
> Best regards
> Peter

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.