Darn, I found why this method was in there. This is in 'registerListenerInterface' of class RequestCycle.

// If there is only one parameter, and it is RequestCycle
if (parameters.length == 1 && parameters[0] == RequestCycle.class)
{
// Save this interface method by the non-qualified class name
listenerInterfaceMethods.put(Classes.name(c), methods[i]);


// Done!
return;
}
// Failed to find interface method
throw new IllegalArgumentException("Internal error: " + c
+ " does not have a method that takes RequestCycle as a parameter");



as you can see from the code, only interfaces with one parameter being request cycle are accepted.


Now, DropDownChoice does this:

RequestCycle.registerListenerInterface(IOnChangeListener.class);

and has template method:

   /**
    * called when a selection changed.
    * @param cycle the request cycle
    */
   public final void selectionChanged(RequestCycle cycle)
   {
       Object value = internalUpdateModel(cycle);
       selectionChanged(cycle, value);
   }

When clients override DropDownChoice, *and* implement IOnChangeListener, the interface method will be called, and thus the template method with the two arguments.

So, it is used. But because you use introspection to check/ call interfaces, your IDE can't know about the dependencies.

I'm reversing the change as my projects don't work now.

Eelco


Eelco Hillenius wrote:

Sorry about not responding. Hmmm... I'm not sure why that's in there. Must be garbage; go ahead pls.

Eelco

Jonathan Locke wrote:


if nobody responds to this, i'm just going to remove it.

Jonathan Locke wrote:



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to