KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > swingclient > workflowadmin > application > actions > RemoveApplicationMapping


1 package org.enhydra.shark.swingclient.workflowadmin.application.actions;
2
3 import java.awt.event.*;
4 import javax.swing.*;
5
6
7 import org.enhydra.shark.swingclient.*;
8 import org.enhydra.shark.swingclient.workflowadmin.*;
9 import org.enhydra.shark.swingclient.workflowadmin.application.*;
10
11 /**
12  * Removes xpdl application to tool agent application mapping.
13  *
14  * @author Sasa Bojanic
15  * @version 1.0
16  */

17 public class RemoveApplicationMapping extends ActionBase {
18
19    public RemoveApplicationMapping (ApplicationMappingManagement pm) {
20       super(pm);
21    }
22
23    public void actionPerformed(ActionEvent e) {
24       ApplicationMappingManagement pm=(ApplicationMappingManagement)actionPanel;
25       SharkAdmin workflowAdmin=pm.getWorkflowAdmin();
26
27       try {
28          String JavaDoc packageId=(String JavaDoc)pm.getExistingMappingsPanel().getColumnValueOfSelectedRow(0);
29          String JavaDoc processDefinitionId=(String JavaDoc)pm.getExistingMappingsPanel().getColumnValueOfSelectedRow(1);
30          String JavaDoc appId=(String JavaDoc)pm.getExistingMappingsPanel().getColumnValueOfSelectedRow(2);
31
32          SharkAdmin.getApplicationMappingsAdmin().removeApplicationMapping(packageId,processDefinitionId,appId);
33       } catch (Exception JavaDoc ex) {
34          JOptionPane.showMessageDialog(pm.getWindow(),
35                ResourceManager.getLanguageDependentString("MessageMappingCannotBeRemovedAtTheMoment"),
36                ResourceManager.getLanguageDependentString("WorkflowAdminTitle"),
37                JOptionPane.INFORMATION_MESSAGE);
38          return;
39       }
40       pm.refresh(true);
41    }
42
43 }
44
Popular Tags