Re: remove all behaviors of a certain type

2009-10-27 Thread keithrbennett

Sean -

This is a little off topic, but for writing this kind of thing, I highly
recommend Google Collections framework.  You write a simple filter method
(called a Predicate), and then call Collections2.filter() to return a
collection over which you can iterate to remove the behaviors.

- Keith


Sean Sullivan-3 wrote:
 
 The Component class provides a method for removing a single IBehavior
 object:
 
 public Component remove(final IBehavior behavior)
 
 
 Is there a similar method that will allow me to remove all IBehaviors of a
 certain type?
 
 I'd like to be able to do this:
 
 
Panel p;
...
p.removeBehaviorsWithType(Clazz behaviorClass);
 
 
 Suggestions?
 
 
 Sean
 
 

-- 
View this message in context: 
http://www.nabble.com/remove-all-behaviors-of-a-certain-type-tp12099034p26079765.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: remove all behaviors of a certain type

2007-08-10 Thread Igor Vaynberg
you have getbehaviors() and removebehavior(), the rest belongs in some
WicketUtil class you write.

-igor


On 8/10/07, Sean Sullivan [EMAIL PROTECTED] wrote:

 The Component class provides a method for removing a single IBehavior
 object:

 public Component remove(final IBehavior behavior)


 Is there a similar method that will allow me to remove all IBehaviors of a
 certain type?

 I'd like to be able to do this:


Panel p;
...
p.removeBehaviorsWithType(Clazz behaviorClass);


 Suggestions?


 Sean



remove all behaviors of a certain type

2007-08-10 Thread Sean Sullivan
The Component class provides a method for removing a single IBehavior
object:

public Component remove(final IBehavior behavior)


Is there a similar method that will allow me to remove all IBehaviors of a
certain type?

I'd like to be able to do this:


   Panel p;
   ...
   p.removeBehaviorsWithType(Clazz behaviorClass);


Suggestions?


Sean