Author: tchemit Date: 2010-06-23 10:36:58 +0200 (Wed, 23 Jun 2010) New Revision: 1985 Url: http://nuiton.org/repositories/revision/jaxx/1985 Log: invoke method addChildNodes whatever there is childs to load (this is a hook) Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/JaxxNodeChildLoador.java Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/JaxxNodeChildLoador.java =================================================================== --- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/JaxxNodeChildLoador.java 2010-06-23 08:23:52 UTC (rev 1984) +++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/tree/JaxxNodeChildLoador.java 2010-06-23 08:36:58 UTC (rev 1985) @@ -24,7 +24,6 @@ */ package jaxx.runtime.swing.tree; -import org.apache.commons.collections.CollectionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -79,7 +78,7 @@ /** * Hook to create a child node given his {@code data}. * - * @param data the data of the node to create + * @param data the data of the node to create * @return the created node */ public abstract N createNode(O data); @@ -124,24 +123,24 @@ source); } - if (!CollectionUtils.isEmpty(datas)) { + // on charge les fils + addChildNodes(parentNode, datas); - // on charge les fils - addChildNodes(parentNode, datas); - } - // notifie le modele d'un ajout de noeuds JaxxTreeHelper.notifyChildNodesInserted(model, parentNode); } protected void addChildNodes(N parentNode, List<O> datas) { + // creation des noeuds fils - for (O o : datas) { - if (log.isInfoEnabled()) { - log.info("[" + parentNode + "] Will add child node for " + o); + if (datas != null) { + for (O o : datas) { + if (log.isInfoEnabled()) { + log.info("[" + parentNode + "] Will add child node for " + o); + } + N node = createNode(o); + parentNode.add(node); } - N node = createNode(o); - parentNode.add(node); } }
participants (1)
-
tchemit@users.nuiton.org