Class Behaviors

java.lang.Object
de.agilecoders.wicket.core.util.Behaviors

public final class Behaviors extends Object
#### Description

Helper class for Behaviors

  • Method Details

    • remove

      public static boolean remove(Component component, Behavior checkBehavior)
      #### Description removes given behavior from given component if it was added before #### Usage if behavior was added to component: ```java myComponent.add(myBehavior); // ... Behaviors.remove(myComponent, myBehavior); // = true ```

      if behavior wasn't added to component before: ```java Behaviors.remove(myComponent, myBehavior); // = false ```

      Parameters:
      component - The Component to remove behavior from
      checkBehavior - The Behavior to remove
      Throws:
      IllegalArgumentException - if component is null
    • contains

      public static boolean contains(Component component, Behavior checkBehavior)
      #### Description

      checks whether given behavior was added to given component before

      #### Usage

      if behavior was added to component: ```java myComponent.add(myBehavior); // ... Behaviors.contains(myComponent, myBehavior); // = true ```

      if behavior wasn't added to component before: ```java Behaviors.contains(myComponent, myBehavior); // = false ```

      Parameters:
      component - The Component to check if behavior was set
      checkBehavior - The Behavior to check
      Throws:
      IllegalArgumentException - if component or behavior is null
    • contains

      public static boolean contains(Component component, Class<? extends Behavior> checkBehavior)
      #### Description checks whether given behavior class was added to given component before

      #### Usage

      if behavior was added to component: ```java myComponent.add(myBehavior); // ... Behaviors.contains(myComponent, MyBehavior.class); // = true ```

      if behavior wasn't added to component before: ```java Behaviors.contains(myComponent, MyBehavior.class); // = false ```

      Parameters:
      component - The Component to check if behavior was set
      checkBehavior - The Behavior class to check
      Throws:
      IllegalArgumentException - if component or behavior is null