KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > swingclient > workflowadmin > definition > actions > UnloadPackage


1 package org.enhydra.shark.swingclient.workflowadmin.definition.actions;
2
3 import java.awt.event.*;
4
5 import javax.swing.*;
6
7
8
9 import org.enhydra.shark.api.client.wfservice.*;
10 import org.enhydra.shark.swingclient.*;
11 import org.enhydra.shark.swingclient.workflowadmin.*;
12 import org.enhydra.shark.swingclient.workflowadmin.definition.*;
13
14 /**
15  * Removes package imported in engine.
16  *
17  * @author Sasa Bojanic
18  * @version 1.0
19  */

20 public class UnloadPackage extends ActionBase {
21
22    public UnloadPackage(PackageManagement pdm) {
23       super(pdm);
24    }
25
26    public void actionPerformed(ActionEvent e) {
27       PackageManagement pdm=(PackageManagement)actionPanel;
28       SharkAdmin workflowAdmin=pdm.getWorkflowAdmin();
29       try {
30          String JavaDoc id=pdm.getSelectedPackageId();
31          String JavaDoc ver=pdm.getSelectedPackageVersion();
32 //System.out.println("The package to rem="+xmlFile);
33

34          SharkAdmin.getPackageAmin().closePackage(id,ver);
35          workflowAdmin.refresh(true);
36       } catch (PackageHasActiveProcesses nc){
37          JOptionPane.showMessageDialog(workflowAdmin.getFrame(),
38             ResourceManager.getLanguageDependentString("ErrorTheSelectedPackageCannotBeUnloadedAtTheMoment"),
39             workflowAdmin.getAppTitle(),JOptionPane.ERROR_MESSAGE);
40       } catch (PackageInUse piu) {
41          JOptionPane.showMessageDialog(workflowAdmin.getFrame(),
42             ResourceManager.getLanguageDependentString("ErrorTheSelectedPackageCannotBeUnloadedAtTheMoment"),
43             workflowAdmin.getAppTitle(),JOptionPane.ERROR_MESSAGE);
44       } catch (Exception JavaDoc be) {
45          JOptionPane.showMessageDialog(workflowAdmin.getFrame(),
46             ResourceManager.getLanguageDependentString("ErrorTheSelectedPackageCannotBeUnloadedAtTheMoment"),
47             workflowAdmin.getAppTitle(),JOptionPane.ERROR_MESSAGE);
48       }
49    }
50 }
51
52
Popular Tags