]> source.dussan.org Git - vaadin-framework.git/commitdiff
some javadocs
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 17 Mar 2010 16:33:55 +0000 (16:33 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 17 Mar 2010 16:33:55 +0000 (16:33 +0000)
svn changeset:11941/svn branch:6.3

src/com/vaadin/ui/AbstractSelect.java
src/com/vaadin/ui/Tree.java

index 74fdbb525dfbd378feb606c10d11a95681659beb..45ff75a66ebbb9c25a602ffd2426abb0ebfd4e4d 100644 (file)
@@ -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");
index 9f3649ebe9358b08197d58205abc261e664648b4..7ad0a159e77b164987ff9911c678d8f5f2111e0c 100644 (file)
@@ -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;
     }