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.CosTradingRepos.ServiceTypeRepository; 33 34 42 public class RemoveServiceType 43 implements MenuItem 44 { 45 46 52 58 64 70 73 public int getStatus(TreeView arg0){ 74 return MenuItem.ENABLED_STATUS; 75 } 76 77 80 public void actionPerformed(MenuItemTreeView e) throws Exception { 81 String name = e.getSelectedEntry().getName().toString(); 82 ServiceTypeRepository parent = (ServiceTypeRepository)e.getParentObject(); 83 try { 84 parent.remove_type(name); 85 } catch (org.omg.CosTrading.IllegalServiceType ex) { 86 throw new Exception ("bad service type '" + ex.type + "'."); 87 } catch (org.omg.CosTrading.UnknownServiceType ex) { 88 throw new Exception ("bad service type '" + ex.type + "'."); 89 } catch (org.omg.CosTradingRepos.ServiceTypeRepositoryPackage.HasSubTypes ex) { 90 throw new Exception ("the service type '" + ex.the_type + "' have subtype '" + ex.sub_type +"'." ); 91 } 92 } 93 94 } 95 | Popular Tags |