1 26 package org.objectweb.util.explorer.parser.lib; 27 28 import java.util.Iterator ; 29 import java.util.List ; 30 31 import org.objectweb.util.explorer.core.common.api.ExplorerConstants; 32 import org.objectweb.util.explorer.core.dnd.api.DnDDescription; 33 import org.objectweb.util.explorer.core.dnd.lib.BasicDnDDescription; 34 import org.objectweb.util.explorer.explorerConfig.DropAction; 35 import org.objectweb.util.explorer.explorerConfig.Node; 36 37 45 public class DnDManager 46 extends AbstractNodeParser 47 { 48 49 55 61 67 protected DnDDescription getDnDDescription(DropAction dropAction){ 68 DnDDescription desc = new BasicDnDDescription(); 69 desc.setType(dropAction.getType()); 70 desc.setLabel(dropAction.getLabel()); 71 desc.setCodeDescription(ParserUtils.getCodeDescription(dropAction.getCode())); 72 return desc; 73 } 74 75 81 84 public void parseNode(Object key, Node node) { 85 List l = node.getDropActionList(); 86 Iterator it = l.iterator(); 87 while (it.hasNext()) { 88 DropAction element = (DropAction) it.next(); 89 DnDDescription dndDesc = getDnDDescription(element); 90 if(dndDesc!=null && !dndDesc.isEmpty()){ 91 getFeeder().feed(ExplorerConstants.DND_PROPERTY, key, dndDesc); 92 } 93 } 94 } 95 96 } 97 98 99 | Popular Tags |