1 26 package org.objectweb.openccm.explorer.Components; 27 28 import org.objectweb.util.explorer.api.MenuItem; 29 import org.objectweb.util.explorer.api.MenuItemTreeView; 30 import org.objectweb.util.explorer.api.TreeView; 31 import org.omg.Components.CCMObject; 32 import org.omg.Components.PublisherDescription; 33 import org.omg.Components.SubscriberDescription; 34 35 43 public class UnsubscribeAction 44 implements MenuItem { 45 46 49 public int getStatus(TreeView arg0){ 50 return MenuItem.ENABLED_STATUS; 51 } 52 53 56 public void actionPerformed(MenuItemTreeView e) throws Exception { 57 SubscriberContainer sc = (SubscriberContainer) e.getSelectedObject(); 58 CCMObject component = sc.getComponent(); 59 PublisherDescription publisher = sc.getPublisher(); 60 SubscriberDescription subscriber = sc.getSubscriber(); 61 component.unsubscribe(publisher.name, subscriber.ck); 62 } 63 64 } 65 | Popular Tags |