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