1 26 package org.objectweb.openccm.explorer.Components; 27 28 import org.objectweb.util.explorer.api.DropAction; 29 import org.objectweb.util.explorer.api.DropTreeView; 30 import org.omg.Components.EmitterDescription; 31 import org.omg.Components.CCMObject; 32 import org.omg.Components.ConsumerDescription; 33 34 44 public class ConnectConsumerOnDropAction 45 implements DropAction 46 { 47 48 54 60 66 72 75 public void execute(DropTreeView dropTreeView) 76 throws Exception 77 { 78 if(dropTreeView!=null){ 79 ConsumerDescription consumer = (ConsumerDescription) dropTreeView.getDragSourceObject(); 80 EmitterContainer ec = (EmitterContainer) dropTreeView.getSelectedObject(); 81 EmitterDescription emitter = ec.getEmitter(); 82 CCMObject component = ec.getComponent(); 83 if (component != null && emitter != null && consumer != null) { 84 component.connect_consumer(emitter.name, consumer.consumer); 85 } 86 } 87 } 88 89 } 90 | Popular Tags |