Example usage for org.apache.wicket Component getDefaultModelObject

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

Introduction

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

Prototype

public final Object getDefaultModelObject() 

Source Link

Document

Gets the backing model object.

Usage

From source file:wicketdnd.DragSource.java

License:Apache License

/**
 * Notification that a drop is about to happen - any implementation should
 * set the data on the given transfer or reject it.
 * //w w w. java 2  s  .  com
 * The default implementation uses the component's model object as transfer
 * data.
 * 
 * @param drag
 *            component to get data from
 * @param operation
 *            the drag's operation
 * @param transfer
 *            the transfer
 * @throws Reject
 *             may reject the drop
 * @see Transfer#setData(Object)
 * @see Transfer#reject()
 */
public void onBeforeDrop(Component drag, Transfer transfer) throws Reject {
    transfer.setData(drag.getDefaultModelObject());
}