KickJava   Java API By Example, From Geeks To Geeks.

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


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 UnloadPackages extends ActionBase {
21
22    public UnloadPackages(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 //System.out.println("The package to rem="+xmlFile);
32

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