Some documentation
and some todo removal
git-svn-id: https://svn.apache.org/repos/asf/myfaces/gsoc/html5-comp-lib/trunk@987942 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/event/DropEvent.java b/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/event/DropEvent.java
index 6350396..0c25867 100644
--- a/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/event/DropEvent.java
+++ b/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/event/DropEvent.java
@@ -27,7 +27,15 @@
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 @@
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 @@
}
- //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;
diff --git a/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DragSourceBehaviorHandler.java b/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DragSourceBehaviorHandler.java
index 8f1748b..fd47e08 100644
--- a/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DragSourceBehaviorHandler.java
+++ b/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DragSourceBehaviorHandler.java
@@ -142,7 +142,7 @@
// 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.
diff --git a/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DropTargetBehaviorHandler.java b/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DropTargetBehaviorHandler.java
index 2d9d053..656fb2c 100644
--- a/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DropTargetBehaviorHandler.java
+++ b/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/handler/DropTargetBehaviorHandler.java
@@ -44,8 +44,13 @@
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 @@
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 @@
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
diff --git a/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/renderkit/input/delegate/HtmlTextInputSuggestionRendererHelper.java b/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/renderkit/input/delegate/HtmlTextInputSuggestionRendererHelper.java
index 1022ce2..c260ed5 100644
--- a/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/renderkit/input/delegate/HtmlTextInputSuggestionRendererHelper.java
+++ b/html5-comp-lib-core/src/main/java/org/apache/myfaces/html5/renderkit/input/delegate/HtmlTextInputSuggestionRendererHelper.java
@@ -53,21 +53,7 @@
{
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 @@
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);