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 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 id=pdm.getSelectedPackageId(); 31 String ver=pdm.getSelectedPackageVersion(); 32 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 be) { 45 JOptionPane.showMessageDialog(workflowAdmin.getFrame(), 46 ResourceManager.getLanguageDependentString("ErrorTheSelectedPackageCannotBeUnloadedAtTheMoment"), 47 workflowAdmin.getAppTitle(),JOptionPane.ERROR_MESSAGE); 48 } 49 } 50 } 51 52 | Popular Tags |