KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

33          SharkAdmin.getPackageAmin().closePkgWithVersion(id,ver);
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
52
Popular Tags