Example usage for org.apache.wicket Component getBehaviorById

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

Introduction

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

Prototype

@Override
public final Behavior getBehaviorById(int id) 

Source Link

Usage

From source file:wicketdnd.DragSource.java

License:Apache License

/**
 * Get the drag source of the given request.
 * /*w  w w  .j av a  2 s  .  c o m*/
 * @param request
 *            request on which a drag happened
 * @return drag source
 */
final static DragSource read(Page page, Request request) {
    String path = request.getRequestParameters().getParameterValue("path").toString();
    Component component = page.get(path);
    if (component == null) {
        throw new PageExpiredException("No drag source found " + path);
    }

    int behavior = request.getRequestParameters().getParameterValue("behavior").toInt();
    return (DragSource) component.getBehaviorById(behavior);
}