i think you should leave the isenabled check. isbehavioraccepted does it, sure. but as users override it, will they remember to call super? its not in javadoc and is not enforced. and if they do not call super they can override what is behavior's choice not the components.
-igor On 3/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Author: ehillenius Date: Thu Mar 29 20:31:46 2007 New Revision: 523920 URL: http://svn.apache.org/viewvc?view=rev&rev=523920 Log: header contributions test on isBehaviorAccepted Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4 /wicket/src/main/java/wicket/Component.java Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4 /wicket/src/main/java/wicket/Component.java URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java?view=diff&rev=523920&r1=523919&r2=523920 ============================================================================== --- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java (original) +++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java Thu Mar 29 20:31:46 2007 @@ -1812,7 +1812,7 @@ while (iter.hasNext()) { IBehavior behavior = (IBehavior)iter.next(); - if (behavior instanceof IHeaderContributor && behavior.isEnabled(this)) + if (behavior instanceof IHeaderContributor && isBehaviorAccepted(behavior)) { ((IHeaderContributor)behavior).renderHead( container.getHeaderResponse()); }
