KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > corbaclient > workflowadmin > user > actions > RemoveUserAccount


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

17 public class RemoveUserAccount extends ActionBase {
18
19    public RemoveUserAccount (UserAccountManagement uam) {
20       super(uam);
21    }
22
23    public void actionPerformed(ActionEvent e) {
24       int r=JOptionPane.showConfirmDialog(actionPanel.getWindow(),
25             ResourceManager.
26                getLanguageDependentString("QuestionDoYouReallyWantToRemoveUserAccount"),
27             SharkClient.getAppTitle(),JOptionPane.YES_NO_OPTION);
28       if (r==JOptionPane.NO_OPTION) {
29          return;
30       }
31
32       UserAccountManagement uam=(UserAccountManagement)actionPanel;
33       SharkAdmin workflowAdmin=uam.getWorkflowAdmin();
34       try {
35          String JavaDoc username=(String JavaDoc)uam.getExistingUsersPanel().getColumnValueOfSelectedRow(0);
36
37          SharkAdmin.getUserGroupAmin().removeUser(username);
38          workflowAdmin.refresh(true);
39       } catch (Exception JavaDoc ex) {
40           JOptionPane.showMessageDialog(workflowAdmin.getFrame(),
41             ResourceManager.getLanguageDependentString("MessageUserAcountCannotBeRemovedAtTheMoment"),
42             workflowAdmin.getAppTitle(),JOptionPane.INFORMATION_MESSAGE);
43       }
44    }
45 }
46
47
Popular Tags