KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SnowMailClient > view > actions > ChangeAccountPassword


1 package SnowMailClient.view.actions;
2
3 import SnowMailClient.MailEngine.*;
4 import SnowMailClient.*;
5 import SnowMailClient.model.*;
6 import SnowMailClient.model.accounts.*;
7 import SnowMailClient.view.*;
8 import SnowMailClient.view.dialogs.*;
9 import SnowMailClient.Language.Language;
10
11 import java.awt.*;
12 import java.awt.event.*;
13 import javax.swing.*;
14
15
16 /** this command is only avaiable for admin users
17 */

18 public final class ChangeAccountPassword extends AbstractAction
19 {
20    final private MailAccount ma;
21    final private JDialog parent;
22
23    public ChangeAccountPassword(MailAccount ma, JDialog parent)
24    {
25        super(Language.translate("Change password"));
26
27        this.ma = ma;
28        this.parent = parent;
29
30        putValue(AbstractAction.SMALL_ICON, SnowMailClientApp.loadImageIcon("pics/key.PNG"));
31
32        putValue(AbstractAction.ACCELERATOR_KEY,
33                  KeyStroke.getKeyStroke( KeyEvent.VK_P,
34                                          KeyEvent.CTRL_MASK ) );
35    }
36
37    public void actionPerformed(ActionEvent actionEvent)
38    {
39        ChangePasswordDialog dialog = new ChangePasswordDialog(ma, parent);
40        dialog.pack();
41        SnowMailClientApp.centerComponentOnMainFrame(dialog);
42        dialog.setVisible(true);
43    }
44
45 }
Popular Tags