Sorry, I'll try to make myself more clear with an example. Since there is no more distinction between models and parameters, it would be very nice if we could write something like:

propModel = new PropertyResourceModel(key, component);

propModel.addModel("model1", model1);
propModel.addModel("model2", model2);

I think we could remove single model parameter from constructors to make PropertyResourceModel lighter and (IMHO) more clear, as we wouldn't need no more to pass null values to constructors to "fit" them to our needs.
That's my 2 Euro :)
Hi Andrea,

you can use any map you want. Nothing forbids you to change the map after you've handed it to PropertyResourceModel.

Have fun
Sven

On 09/25/2014 04:39 PM, Andrea Del Bene wrote:
Nice one Sven! But I'd like to make PropertyResourceModel more flexible. We could make models dynamically configurable with addModel/removeModel (this last implies not to use MicroMap as default map)
Repository: wicket
Updated Branches:
   refs/heads/WICKET-4972-PropertyResourceModel [created] fd6ed4d15


PropertyResourceModel as alternative to StringResourceModel


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/fd6ed4d1
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/fd6ed4d1
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/fd6ed4d1

Branch: refs/heads/WICKET-4972-PropertyResourceModel
Commit: fd6ed4d15e125dc93e1e068a73b37b59f740eb5c
Parents: adcb7a6
Author: svenmeier <[email protected]>
Authored: Thu Sep 25 14:51:18 2014 +0200
Committer: svenmeier <[email protected]>
Committed: Thu Sep 25 14:52:09 2014 +0200

----------------------------------------------------------------------
.../wicket/model/PropertyResourceModel.java | 589 +++++++++++++++++++
  .../wicket/model/StringResourceModel.java       |  17 +-
  ...ropertyResourceModelTest$TestPage.properties |  27 +
  .../wicket/model/PropertyResourceModelTest.java | 340 +++++++++++
  .../resource/loader/PropertiesResolverTest.java |   3 +-
  .../examples/ajax/builtin/RatingsPage.java      |   4 +-
  .../wicket/examples/compref/LabelPage.java      |   6 +-
  .../examples/compref/LabelPage.properties       |   2 +-
  .../examples/compref/LabelPage_ko.properties    |   2 +-
  .../examples/compref/LabelPage_no.properties    |   2 +-
  .../org/apache/wicket/examples/pub/Home.java    |   4 +-
  .../org/apache/wicket/examples/pub2/Home.java   |   4 +-
  .../wicket/examples/wizard/NewUserWizard.java   |  10 +-
  .../html/form/upload/UploadProgressBar.java     |   5 +-
  .../html/form/upload/UploadStatusResource.java  |   5 +-
  .../repeater/data/table/NavigatorLabel.java     |   6 +-
  .../wicket/extensions/rating/RatingPanel.java   |  19 +-
  .../extensions/rating/RatingPanel.properties    |   4 +-
  .../extensions/rating/RatingPanel_da.properties |   4 +-
  .../extensions/rating/RatingPanel_es.properties |   4 +-
  .../rating/RatingPanel_fr.properties.xml        |   4 +-
  .../extensions/rating/RatingPanel_hu.properties |   4 +-
  .../extensions/rating/RatingPanel_ko.properties |   4 +-
  .../extensions/rating/RatingPanel_nl.properties |   4 +-
  .../extensions/rating/RatingPanel_no.properties |   4 +-
  .../extensions/rating/RatingPanel_pl.properties |   4 +-
  .../rating/RatingPanel_ru.properties.xml        |   4 +-
  .../apache/wicket/util/collections/MiniMap.java | 104 ++++
  28 files changed, 1127 insertions(+), 62 deletions(-)
----------------------------------------------------------------------





Reply via email to