1 package org.enhydra.shark.swingclient.workflowadmin.user.actions; 2 3 import java.awt.event.*; 4 import java.util.*; 5 6 7 8 import org.enhydra.shark.api.client.wfservice.*; 9 import org.enhydra.shark.swingclient.*; 10 import org.enhydra.shark.swingclient.workflowadmin.*; 11 import org.enhydra.shark.swingclient.workflowadmin.user.*; 12 13 import javax.swing.JOptionPane ; 14 15 21 public class ChangeUserAccountPassword extends ActionBase { 22 23 public ChangeUserAccountPassword (UserAccountManagement uam) { 24 super(uam); 25 } 26 27 public void actionPerformed(ActionEvent e) { 28 UserGroupAdministration uga=SharkAdmin.getUserGroupAmin(); 29 UserAccountManagement uam=(UserAccountManagement)actionPanel; 30 SharkAdmin workflowAdmin=uam.getWorkflowAdmin(); 31 TablePanel eup=uam.getExistingUsersPanel(); 32 33 String selectedUsername=(String )eup.getColumnValueOfSelectedRow(0); 34 35 UserAccountSettings uas=new UserAccountSettings(); 36 uas.username=selectedUsername; 37 uas.firstname=(String )eup.getColumnValueOfSelectedRow(1); 38 uas.lastname=(String )eup.getColumnValueOfSelectedRow(2); 39 uas.email=(String )eup.getColumnValueOfSelectedRow(3); 40 41 UserAccount uad=null; 42 try { 43 uad=new UserAccount(workflowAdmin.getFrame(), 44 uas,UserAccount.CHANGE_PASSWORD); 45 uad.showDialog(); 46 } catch (Exception ex) { 47 System.out.println("Cannot create dialog of given type"); 48 return; 49 } 50 if (uas.username==null) return; 51 try { 52 uga.setPassword(uas.username,uas.password); 53 } catch (Exception ex) { 54 JOptionPane.showMessageDialog(workflowAdmin, 55 ResourceManager.getLanguageDependentString("MessageCannotChangeUserSettings"), 56 ResourceManager.getLanguageDependentString("WorkflowAdminTitle"), 57 JOptionPane.ERROR_MESSAGE); 58 59 } 60 } 61 } 62 | Popular Tags |