Igor Vaynberg created WICKET-5124:
-------------------------------------

             Summary: Improve ResourceReference#getDependencies() API
                 Key: WICKET-5124
                 URL: https://issues.apache.org/jira/browse/WICKET-5124
             Project: Wicket
          Issue Type: Improvement
    Affects Versions: 6.6.0
            Reporter: Igor Vaynberg
            Assignee: Igor Vaynberg
             Fix For: 7.0


currently the signature is

public Iterable<? extends HeaderItem> getDependencies()

which is awkward to use.

suppose i want a javascript reference that should include a css reference as a 
dependency, i cannot simply add it to iterable like this:

new ResourceReference(Some.class, "some.js") {
   Iterable getDependencies() {
     Iterable supers=super.getDependencies();
     // supers.add(CSS); <=== cannot do this, instead
     List list=new ArrayList();
     for (reference:supers) {
        list.add(reference);
     }
     // now i can finally add mine
     list.add(CSS);
     return list;
   }
}

instead  change Iterable to a List that is backed by a mutable one. this should 
make extending much easier. if List is too "open" create Appendable { append(); 
} backed by a list and use that.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to