> hrm, so lets see DateTimeField:
>
> public final boolean isRequired()
>     {
>         // prevent clients from overriding
>         return super.isRequired();
>     }
>
>     public FormComponent setRequired(boolean required)
>     {
>         dateField.setRequired(required);
>         return this;
>     }
>
>
> isnt this broken? isrequired() doesnt return the same value as
> setrequired().

You you're right, this would be it:

        public FormComponent setRequired(boolean required)
        {
                super.setRequired(required);
                dateField.setRequired(required);
                return this;
        }

> by making setrequired nonfinal the contract you have established is: you
> always have to override both setrequired and isrequired to make sure they
> return the same value, or call super in setrequired. and you havent done
> this just for the formcomponetpanel but you have leaked this across all
> formcomponents.
>
> i would much rather have datetimefield define the contract on its factory
> method for newdatetextfield() which 99.9% of people probably wont use.

You are just nitpicking. 99.9% of people won't override setRequired to
start with.

Eelco

Reply via email to