summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2010-03-17 16:33:55 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2010-03-17 16:33:55 +0000
commite92b9743d74885dda10ec95f643b58d66de56942 (patch)
treeebbdd8f73862cb026e365892d2f0ba86ccb0958a
parentfd7311e75a64064036e6f56d02b2e5ededa5b10d (diff)
downloadvaadin-framework-e92b9743d74885dda10ec95f643b58d66de56942.tar.gz
vaadin-framework-e92b9743d74885dda10ec95f643b58d66de56942.zip
some javadocs
svn changeset:11941/svn branch:6.3
-rw-r--r--src/com/vaadin/ui/AbstractSelect.java18
-rw-r--r--src/com/vaadin/ui/Tree.java36
2 files changed, 40 insertions, 14 deletions
diff --git a/src/com/vaadin/ui/AbstractSelect.java b/src/com/vaadin/ui/AbstractSelect.java
index 74fdbb525d..45ff75a66e 100644
--- a/src/com/vaadin/ui/AbstractSelect.java
+++ b/src/com/vaadin/ui/AbstractSelect.java
@@ -21,6 +21,7 @@ import com.vaadin.data.Property;
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;
@@ -1769,7 +1770,7 @@ public abstract class AbstractSelect extends AbstractField implements
}
/**
- * TODO Javadoc!
+ * Helper implementation for subclasses that implement {@link DropTarget}.
*
* @since 6.3
*/
@@ -1781,11 +1782,13 @@ public abstract class AbstractSelect extends AbstractField implements
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) {
@@ -1794,8 +1797,8 @@ public abstract class AbstractSelect extends AbstractField implements
}
/**
- * 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() {
@@ -1803,8 +1806,7 @@ public abstract class AbstractSelect extends AbstractField implements
}
/**
- * TODO Javadoc!
- *
+ * Returns a detailed vertical location where the drop happened on Item.
*/
public VerticalDropLocation getDropLocation() {
String detail = (String) getData("detail");
diff --git a/src/com/vaadin/ui/Tree.java b/src/com/vaadin/ui/Tree.java
index 9f3649ebe9..7ad0a159e7 100644
--- a/src/com/vaadin/ui/Tree.java
+++ b/src/com/vaadin/ui/Tree.java
@@ -32,6 +32,7 @@ import com.vaadin.event.dd.DragAndDropEvent;
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;
@@ -103,7 +104,17 @@ public class Tree extends AbstractSelect implements Container.Hierarchical,
* 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
}
@@ -1111,7 +1122,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical,
}
/**
- * TODO Javadoc!
+ * A {@link DropTargetDetails} implementation with Tree specific api.
*
* @since 6.3
*/
@@ -1191,10 +1202,11 @@ public class Tree extends AbstractSelect implements Container.Hierarchical,
}
- /**
- * TODO Javadoc!
+ /*
+ * (non-Javadoc)
*
- * @since 6.3
+ * @see
+ * com.vaadin.event.dd.DropTarget#translateDropTargetDetails(java.util.Map)
*/
public TreeDropTargetDetails translateDropTargetDetails(
Map<String, Object> clientVariables) {
@@ -1202,7 +1214,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical,
}
/**
- * API for {@link TreeDropCriterion}
+ * Helper API for {@link TreeDropCriterion}
*
* @param itemId
* @return
@@ -1211,10 +1223,22 @@ public class Tree extends AbstractSelect implements Container.Hierarchical,
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;
}