You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2015/01/19 18:24:35 UTC

[jira] [Resolved] (WICKET-5795) LoadableDetachableModel/AbstractReadOnlyModel .of(Supplier) to support convenient lambda instantiation in Java8

     [ https://issues.apache.org/jira/browse/WICKET-5795?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-5795.
-------------------------------------
    Resolution: Won't Fix

Neither Wicket 6.x nor 7.x uses JDK 1.8 and/or Guava, so there is no way how to add such method.
For the time being (until Wicket 8.x) you should use local helper classes.

Feel free to contribute such helper class to WicketStuff Core jdk-1.8 modules (https://github.com/wicketstuff/core/tree/master/jdk-1.8-parent)

> LoadableDetachableModel/AbstractReadOnlyModel .of(Supplier<T>) to support convenient lambda instantiation in Java8
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-5795
>                 URL: https://issues.apache.org/jira/browse/WICKET-5795
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.18.0
>            Reporter: Hendy Irawan
>
> I propose adding static method {{LoadableDetachableModel/AbstractReadOnlyModel .of(Supplier<T>)}} so this can be used to quickly create ad-hoc models in Java8 using lambda syntax. (but does not require Java8 in any way). [{{Supplier}} is from Guava library|http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Supplier.html].
> Sample usage:
> {code}
> add(new Label("slug", 
>     LoadableDetachableModel.of( () -> personRepo.slugFor(getModelObject()) )));
> {code}
> Similar approach for other abstract classes can also be useful for implementing typically single methods like {{onSubmit}}, {{onClick}}, {{onConfigure}}, etc.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)