KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > corbaclient > workflowadmin > application > actions > AddApplicationMapping


1 package org.enhydra.shark.corbaclient.workflowadmin.application.actions;
2
3 import org.omg.WfBase.NameValue;
4 import java.awt.event.ActionEvent JavaDoc;
5 import java.util.HashMap JavaDoc;
6 import java.util.Map JavaDoc;
7 import org.enhydra.shark.corbaclient.ActionBase;
8 import org.enhydra.shark.corbaclient.workflowadmin.SharkAdmin;
9 import org.enhydra.shark.corbaclient.workflowadmin.application.ApplicationMapping;
10 import org.enhydra.shark.corbaclient.workflowadmin.application.ApplicationMappingManagement;
11
12 /**
13  * Creates new xpdl application to tool agent application mapping.
14  *
15  * @author Sasa Bojanic
16  * @version 1.0
17  */

18 public class AddApplicationMapping extends ActionBase {
19
20    public AddApplicationMapping (ApplicationMappingManagement pm) {
21       super(pm);
22    }
23
24    public void actionPerformed(ActionEvent JavaDoc e) {
25       ApplicationMappingManagement pmm=(ApplicationMappingManagement)actionPanel;
26       SharkAdmin workflowAdmin=pmm.getWorkflowAdmin();
27
28       NameValue[] allProc=null;
29       Map JavaDoc m=new HashMap JavaDoc();
30       try {
31          allProc=SharkAdmin.getMappingAdmin().getToolAgentsInfo();
32          for (int i=0; i<allProc.length; i++) {
33             m.put(allProc[i].the_name,allProc[i].the_value.extract_wstring());
34          }
35       } catch (Exception JavaDoc ex) {
36       }
37
38       ApplicationMapping pm=new ApplicationMapping(
39          pmm,
40          pmm.getApplicationKeyToApplication().values(),
41          m);
42       pm.showDialog();
43    }
44
45 }
46
Popular Tags