Example usage for org.apache.wicket Component remove

List of usage examples for org.apache.wicket Component remove

Introduction

In this page you can find the example usage for org.apache.wicket Component remove.

Prototype

public Component remove(final Behavior... behaviors) 

Source Link

Document

Removes behavior from component

Usage

From source file:org.wicketstuff.push.timer.TimerPushService.java

License:Apache License

public <EventType> TimerPushNode<EventType> installNode(final Component component,
        final IPushEventHandler<EventType> handler, final Duration pollingInterval) {
    Args.notNull(component, "component");
    Args.notNull(handler, "handler");
    Args.notNull(pollingInterval, "pollingInterval");

    TimerPushBehavior behavior = _findPushBehaviour(component);
    if (behavior != null && behavior.isStopped()) {
        component.remove(behavior);
        behavior = null;//  w w  w.ja va  2 s .  c o  m
    }
    if (behavior == null) {
        behavior = new TimerPushBehavior(pollingInterval);
        component.add(behavior);
    }
    final TimerPushNode<EventType> node = behavior.addNode(handler, pollingInterval);
    _onConnect(node);
    return node;
}