1 26 27 package org.objectweb.openccm.explorer.CosTrading; 28 29 import java.awt.Component ; 30 import java.awt.event.ActionEvent ; 31 32 import javax.swing.JOptionPane ; 33 34 import org.objectweb.openccm.corba.trader.TypeRepositoryFeed; 35 import org.objectweb.openccm.explorer.CosTrading.gui.AddServiceTypesPanel; 36 import org.objectweb.util.explorer.api.MenuItem; 37 import org.objectweb.util.explorer.api.MenuItemTreeView; 38 import org.objectweb.util.explorer.api.TreeView; 39 import org.omg.CosTradingRepos.ServiceTypeRepository; 40 41 49 public class AddServiceTypes 50 implements MenuItem 51 { 52 53 59 65 71 77 80 public int getStatus(TreeView arg0){ 81 return MenuItem.ENABLED_STATUS; 82 } 83 84 87 public void actionPerformed(MenuItemTreeView e) { 88 ServiceTypeRepository parent = (ServiceTypeRepository)e.getSelectedObject(); 89 90 AddServiceTypesPanel stp = new AddServiceTypesPanel(); 91 92 ActionEvent ae = (ActionEvent )e.getEvent(); 93 94 int result = 95 JOptionPane.showOptionDialog( 96 (Component ) ae.getSource(), 97 stp, 98 "Add trading service types", 99 JOptionPane.OK_CANCEL_OPTION, 100 JOptionPane.PLAIN_MESSAGE, 101 null, 102 null, 103 null); 104 105 if (result == 0) { 106 String filename = stp.getFileName(); 107 TypeRepositoryFeed trf = new TypeRepositoryFeed(); 108 trf.run(new String [] {filename}); 109 } 110 } 111 } 112 | Popular Tags |