1 package org.enhydra.shark.corbaclient.workflowadmin.user.actions; 2 3 import java.awt.event.*; 4 import java.util.*; 5 6 7 import org.omg.WorkflowModel.*; 8 import org.enhydra.shark.corba.WorkflowService.*; 9 import org.enhydra.shark.corbaclient.*; 10 import org.enhydra.shark.corbaclient.workflowadmin.*; 11 import org.enhydra.shark.corbaclient.workflowadmin.user.*; 12 13 import javax.swing.JOptionPane ; 14 15 21 public class ChangeUserAccountSettings extends ActionBase { 22 23 public ChangeUserAccountSettings (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 try { 36 UserAccountSettings uas=new UserAccountSettings(); 37 uas.username=selectedUsername; 38 uas.firstname=(String )eup.getColumnValueOfSelectedRow(1); 39 uas.lastname=(String )eup.getColumnValueOfSelectedRow(2); 40 uas.email=(String )eup.getColumnValueOfSelectedRow(3); 41 UserAccount uad=null; 42 try { 43 uad=new UserAccount(workflowAdmin.getFrame(), 44 uas,UserAccount.CHANGE_SETTINGS); 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.updateUser(uas.username,uas.firstname,uas.lastname,uas.email); 53 eup.setColumnValueOfSelectedRow(1,uas.firstname); 54 eup.setColumnValueOfSelectedRow(2,uas.lastname); 55 eup.setColumnValueOfSelectedRow(3,uas.email); 56 } catch (Exception ex) { 57 JOptionPane.showMessageDialog(workflowAdmin, 58 ResourceManager.getLanguageDependentString("MessageCannotChangeUserSettings"), 59 ResourceManager.getLanguageDependentString("WorkflowAdminTitle"), 60 JOptionPane.ERROR_MESSAGE); 61 } 62 } catch (Exception ex) {} 63 64 } 65 } 66 | Popular Tags |