import com.vaadin.data.util.IndexedContainer;
import com.vaadin.event.DataBoundTransferable;
import com.vaadin.event.dd.DragAndDropEvent;
+import com.vaadin.event.dd.DropTarget;
import com.vaadin.event.dd.DropTargetDetailsImpl;
import com.vaadin.event.dd.acceptCriteria.ClientCriterion;
import com.vaadin.event.dd.acceptCriteria.ClientSideCriterion;
}
/**
- * TODO Javadoc!
+ * Helper implementation for subclasses that implement {@link DropTarget}.
*
* @since 6.3
*/
protected Object idOver;
/**
- * TODO Javadoc!
+ * Constructor that automatically converts itemIdOver key to
+ * corresponding item Id
*
*/
- AbstractSelectDropTargetDetails(Map<String, Object> rawVariables) {
- super(rawVariables);
+ protected AbstractSelectDropTargetDetails(
+ Map<String, Object> rawVariables) {
+ super(rawVariables, (DropTarget) AbstractSelect.this);
// eagar fetch itemid, mapper may be emptied
String keyover = (String) getData("itemIdOver");
if (keyover != null) {
}
/**
- * If the drag operation is currently over an Item, this method returns
- * the identifier of the Item.
+ * If the drag operation is currently over an {@link Item}, this method
+ * returns the identifier of that {@link Item}.
*
*/
public Object getItemIdOver() {
}
/**
- * TODO Javadoc!
- *
+ * Returns a detailed vertical location where the drop happened on Item.
*/
public VerticalDropLocation getDropLocation() {
String detail = (String) getData("detail");
import com.vaadin.event.dd.DragSource;
import com.vaadin.event.dd.DropHandler;
import com.vaadin.event.dd.DropTarget;
+import com.vaadin.event.dd.DropTargetDetails;
import com.vaadin.event.dd.acceptCriteria.ClientCriterion;
import com.vaadin.event.dd.acceptCriteria.ClientSideCriterion;
import com.vaadin.event.dd.acceptCriteria.ServerSideCriterion;
* Supported drag modes for Tree.
*/
public enum TreeDragMode {
- NONE, NODE
+ /**
+ * When drag mode is NONE, draggin from Tree is not supported. Browsers
+ * may still support selecting text/icons from Tree which can initiate
+ * HTML 5 style drag and drop operation.
+ */
+ NONE,
+ /**
+ * When drag mode is NODE, users can initiate drag from Tree nodes that
+ * represent {@link Item}s in from the backed {@link Container}.
+ */
+ NODE
// , SUBTREE
}
}
/**
- * TODO Javadoc!
+ * A {@link DropTargetDetails} implementation with Tree specific api.
*
* @since 6.3
*/
}
- /**
- * TODO Javadoc!
+ /*
+ * (non-Javadoc)
*
- * @since 6.3
+ * @see
+ * com.vaadin.event.dd.DropTarget#translateDropTargetDetails(java.util.Map)
*/
public TreeDropTargetDetails translateDropTargetDetails(
Map<String, Object> clientVariables) {
}
/**
- * API for {@link TreeDropCriterion}
+ * Helper API for {@link TreeDropCriterion}
*
* @param itemId
* @return
return itemIdMapper.key(itemId);
}
+ /**
+ * Sets the drag mode that controls how Tree behaves as a {@link DragSource}
+ * .
+ *
+ * @param dragMode
+ */
public void setDragMode(TreeDragMode dragMode) {
this.dragMode = dragMode;
}
+ /**
+ * @return the drag mode that controls how Tree behaves as a
+ * {@link DragSource}.
+ *
+ * @see TreeDragMode
+ */
public TreeDragMode getDragMode() {
return dragMode;
}