1 26 27 package org.objectweb.openccm.explorer.CosTrading; 28 29 import org.objectweb.util.explorer.api.MenuItem; 30 import org.objectweb.util.explorer.api.MenuItemTreeView; 31 import org.objectweb.util.explorer.api.TreeView; 32 import org.omg.CosTrading.Link; 33 34 40 public class RemoveLink 41 implements MenuItem 42 { 43 44 50 56 62 68 71 public int getStatus(TreeView arg0){ 72 return MenuItem.ENABLED_STATUS; 73 } 74 75 78 public void actionPerformed(MenuItemTreeView e) throws Exception { 79 String name = e.getSelectedEntry().getName().toString(); 80 Link parent = (Link)e.getParentObject(); 81 try { 82 parent.remove_link(name); 83 } catch (org.omg.CosTrading.LinkPackage.IllegalLinkName ex) { 84 throw new Exception ("bad link name '" + ex.name + "'."); 85 } catch (org.omg.CosTrading.LinkPackage.UnknownLinkName ex) { 86 throw new Exception ("bad link name '" + ex.name + "'."); 87 } 88 } 89 } 90 | Popular Tags |