Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5124

Improve ResourceReference#getDependencies() API

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.6.0
    • Fix Version/s: 7.0.0-M1
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              mgrigorov Martin Tzvetanov Grigorov
              Reporter:
              ivaynberg Igor Vaynberg
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: