jastrachan | 15 Apr 09:44 2004
Picon

Re: Creating a groovy method in a java parent class for Thicky


On 15 Apr 2004, at 08:27, Paul Hammant wrote:
>> body() {
>>     panel(border:new TitledBorder("hey"))
>> }
>
> Ahh, that may help in terms of explanation.
>
> 'panel', being a builder method, understands groovy stuff in the curly 
> AND plain parenthesis.

Yep.

> 'body' as I have implemented it in Java, understands only the groovy 
> stuff in the curly parenthesis.   As such ...

body() is a Java method which only accepts one parameter, a closure (at 
least right now).

>  body(border:new TitledBorder("hey")) {
>      panel()
>   }
>
> would not work.

No - since you've not got a method called

body(Map arguments, Closure content) {
}

in your base class.

James
-------
http://radio.weblogs.com/0112098/

Gmane