KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > swingclient > workflowadmin > monitoring > actions > SuspendActivity


1 package org.enhydra.shark.swingclient.workflowadmin.monitoring.actions;
2
3 import java.awt.event.*;
4
5
6
7 import org.enhydra.shark.api.client.wfmodel.*;
8 import org.enhydra.shark.swingclient.*;
9 import org.enhydra.shark.swingclient.workflowadmin.*;
10 import org.enhydra.shark.swingclient.workflowadmin.monitoring.*;
11
12 import javax.swing.*;
13 import org.enhydra.jawe.xml.elements.*;
14
15 /**
16  * Suspends selected activity.
17  *
18  * @author Sasa Bojanic
19  * @version 1.0
20  */

21 public class SuspendActivity extends ActionBase {
22
23    public SuspendActivity (ManageActivities ma) {
24       super(ma);
25    }
26
27    public void actionPerformed(ActionEvent e) {
28       ManageActivities ma=(ManageActivities)actionPanel;
29       Activity act=ma.getSelectedActivity();
30       try {
31          WfActivity lastActivityForDefinition=ma.getLastActivityForDefinition(act,"open",1);
32          lastActivityForDefinition.suspend();
33          ma.updateListDisplay(act);
34          JOptionPane.showMessageDialog(ma.getWindow(),
35             lastActivityForDefinition.name()+": "+
36             ResourceManager.getLanguageDependentString(
37             "MessageActivityIsSuspended"),
38             SharkClient.getAppTitle(),JOptionPane.WARNING_MESSAGE);
39       } catch (Exception JavaDoc ex) {
40          JOptionPane.showMessageDialog(ma.getWindow(),
41             ResourceManager.getLanguageDependentString(
42             "MessageActivityCannotBeSuspended"),
43             SharkClient.getAppTitle(),JOptionPane.WARNING_MESSAGE);
44
45       }
46    }
47
48 }
49
50
Popular Tags