You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by al...@apache.org on 2010/08/22 21:34:37 UTC

svn commit: r987942 - in /myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5: event/ handler/ renderkit/input/delegate/

Author: aliok
Date: Sun Aug 22 19:34:36 2010
New Revision: 987942

URL: http://svn.apache.org/viewvc?rev=987942&view=rev
Log:
Some documentation
and some todo removal

Modified:
    myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/event/DropEvent.java
    myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DragSourceBehaviorHandler.java
    myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DropTargetBehaviorHandler.java
    myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/renderkit/input/delegate/HtmlTextInputSuggestionRendererHelper.java

Modified: myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/event/DropEvent.java
URL: http://svn.apache.org/viewvc/myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/event/DropEvent.java?rev=987942&r1=987941&r2=987942&view=diff
==============================================================================
--- myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/event/DropEvent.java (original)
+++ myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/event/DropEvent.java Sun Aug 22 19:34:36 2010
@@ -27,7 +27,15 @@ import javax.faces.event.FacesListener;
 
 import org.apache.myfaces.html5.behavior.DropTargetBehavior;
 
-//TODO: doc me
+/**
+ * This event is fired when a successful drop is done.
+ * <br/>
+ * 
+ * Holds the parameter and content-type <=> value map sent with the event.
+ * 
+ * @author Ali Ok
+ *
+ */
 public class DropEvent extends BehaviorEvent
 {
     private static final long serialVersionUID = 1L;
@@ -36,7 +44,6 @@ public class DropEvent extends BehaviorE
     private final Map<String, String> _dropDataMap;
     private final String _param;
 
-  //TODO: doc me
     public DropEvent(UIComponent component, DropTargetBehavior behavior, Map<String, String> dropDataMap, String param)
     {
         super(component, behavior);
@@ -57,7 +64,21 @@ public class DropEvent extends BehaviorE
         
     }
     
-  //TODO: doc me
+    /**
+     * Returns the values sent received from the client after a successful drop.
+     * <br/>
+     * ie.
+     * 
+     * <table>
+     * <tr>
+     * <th>Content-type</th>
+     * <th>Value</th>
+     * </tr>
+     * 
+     * 
+     *  
+     * @return
+     */
     public Map<String, String> getDropDataMap()
     {
         return _dropDataMap;

Modified: myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DragSourceBehaviorHandler.java
URL: http://svn.apache.org/viewvc/myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DragSourceBehaviorHandler.java?rev=987942&r1=987941&r2=987942&view=diff
==============================================================================
--- myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DragSourceBehaviorHandler.java (original)
+++ myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DragSourceBehaviorHandler.java Sun Aug 22 19:34:36 2010
@@ -142,7 +142,7 @@ public class DragSourceBehaviorHandler e
 
             // evaluating the _param's value expression doesn't this work if I put the dragSource in a datatable and try
             // to set the valueexpression using the var of table.
-            // XXX: see https://issues.apache.org/jira/browse/MYFACES-2616
+            // see https://issues.apache.org/jira/browse/MYFACES-2616
             // see the thread http://www.mail-archive.com/dev@myfaces.apache.org/msg46764.html
             // thus need to pass the valuexpression to the behavior, then the renderer can evaluate it. AjaxBehavior
             // does this with a map.

Modified: myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DropTargetBehaviorHandler.java
URL: http://svn.apache.org/viewvc/myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DropTargetBehaviorHandler.java?rev=987942&r1=987941&r2=987942&view=diff
==============================================================================
--- myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DropTargetBehaviorHandler.java (original)
+++ myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DropTargetBehaviorHandler.java Sun Aug 22 19:34:36 2010
@@ -44,8 +44,13 @@ import org.apache.myfaces.html5.renderki
 import org.apache.myfaces.html5.renderkit.util.ClientBehaviorEvents;
 import org.apache.myfaces.shared_html5.renderkit.RendererUtils;
 
+/* 
+ * Facelets tag handler for DropTargetBehavior.
+ *
+ * 
+ * DO NOT JAVADOC here since we don't want this doc to show up in Facelets doc.
+ */
 @JSFFaceletTag(name = "fx:dropTarget", behaviorClass="org.apache.myfaces.html5.behavior.DropTargetBehavior")
-// TODO: doc me
 public class DropTargetBehaviorHandler extends javax.faces.view.facelets.BehaviorHandler
 {
 
@@ -193,7 +198,7 @@ public class DropTargetBehaviorHandler e
                 dropTargetBehavior.addDropTargetBehaviorListener(new DropListener(expr));
             }
 
-            // XXX: see https://issues.apache.org/jira/browse/MYFACES-2616
+            // see https://issues.apache.org/jira/browse/MYFACES-2616
             // see the thread http://www.mail-archive.com/dev@myfaces.apache.org/msg46764.html
             // using the same approach in DropSourceBehavior too... see there for explanation!
             if (_action != null)
@@ -249,7 +254,7 @@ public class DropTargetBehaviorHandler e
             holder.addClientBehavior(ClientBehaviorEvents.DRAGOVER_EVENT, dropTargetBehavior);
             holder.addClientBehavior(ClientBehaviorEvents.DROP_EVENT, dropTargetBehavior);
         }
-        // XXX: check this out
+        //TODO: try in a composite component!
         /*
          * else if (UIComponent.isCompositeComponent(parent)) { // COPIED FROM AjaxHandler! // It is supposed that for
          * composite components, this tag should // add itself as a target, but note that on whole api does not exists

Modified: myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/renderkit/input/delegate/HtmlTextInputSuggestionRendererHelper.java
URL: http://svn.apache.org/viewvc/myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/renderkit/input/delegate/HtmlTextInputSuggestionRendererHelper.java?rev=987942&r1=987941&r2=987942&view=diff
==============================================================================
--- myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/renderkit/input/delegate/HtmlTextInputSuggestionRendererHelper.java (original)
+++ myfaces/gsoc/html5-comp-lib/trunk/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/renderkit/input/delegate/HtmlTextInputSuggestionRendererHelper.java Sun Aug 22 19:34:36 2010
@@ -53,21 +53,7 @@ public class HtmlTextInputSuggestionRend
 {
     static final char TABULATOR = '\t';
 
-    // //XXX: not using singleton since that approach is evil and needs thread safety which means performance penalty
-    // private static HtmlTextInputSuggestionRendererHelper instance;
-    //
-    // private HtmlTextInputSuggestionRendererHelper()
-    // {
-    // }
-    //    
-    // public HtmlTextInputSuggestionRendererHelper getInstance()
-    // {
-    // //implement thread safety
-    // if(HtmlTextInputSuggestionRendererHelper.instance == null)
-    // HtmlTextInputSuggestionRendererHelper.instance = new HtmlTextInputSuggestionRendererHelper();
-    //            
-    // return instance;
-    // }
+    // not using singleton since that approach is evil, not testable and needs thread safety which means performance penalty
 
     /*
      * (non-Javadoc)
@@ -255,22 +241,19 @@ public class HtmlTextInputSuggestionRend
 
         for (Iterator<SelectItem> iterator = selectItemsCollection.iterator(); iterator.hasNext();)
         {
-            // XXX: might throw an exception! don't handle, and let the user handle the exception
+            // might throw an exception! don't handle, and let the user handle the exception
             SelectItem selectItem = iterator.next();
 
             writer.write(TABULATOR);
 
             writer.startElement(HTML.OPTION_ELEM, null);
-            // XXX: do we need to set id of the generated option element?
 
             /*
              * we're writing an attribute, not text here: using <option value="value" label="Label" /> notation, not
              * <option value="value">Label</option>
              */
             String itemLabel = selectItem.getLabel();
-            // XXX: writeAttribute method escapes the label anyway. so ignore SelectItem#isEscape()...
-            // if(itemLabel!=null && !itemLabel.isEmpty() && selectItem.isEscape())
-            // itemLabel = ESCAPE(itemLabel);
+            // writeAttribute method escapes the label anyway. so ignore SelectItem#isEscape()...
             writer.writeAttribute(HTML.LABEL_ATTR, itemLabel, null);
 
             String itemStrValue = RendererUtils.getConvertedStringValue(facesContext, component, converter, selectItem);