KickJava   Java API By Example, From Geeks To Geeks.

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


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 snow.utils.gui.*;
9
10 import SnowMailClient.view.dialogs.*;
11 import SnowMailClient.Language.Language;
12 import snow.lookandfeel.*;
13
14 import java.awt.*;
15 import java.awt.event.*;
16 import javax.swing.*;
17
18
19 /**
20 */

21 public class ViewAccountLog extends AbstractAction
22 {
23    MailAccount account;
24    JDialog ref;
25
26    public ViewAccountLog(JDialog ref, MailAccount account)
27    {
28        super(Language.translate("View account log"));
29        this.account = account;
30        this.ref= ref;
31
32        putValue(AbstractAction.SMALL_ICON, SnowMailClientApp.loadImageIcon("pics/log.PNG"));
33        putValue(AbstractAction.ACCELERATOR_KEY,
34                  KeyStroke.getKeyStroke( KeyEvent.VK_L,
35                                          KeyEvent.CTRL_MASK ) );
36    }
37
38    public void actionPerformed(ActionEvent actionEvent)
39    {
40       JDialog dialog = new JDialog( ref,
41         Language.translate("Log of account %",account.getAddress()), false);
42       dialog.getContentPane().setLayout(new BorderLayout());
43       JTextPane textPane= new JTextPane();
44       textPane.setDocument(account.getAccountLog().doc);
45       dialog.getContentPane().add(new JScrollPane(textPane), BorderLayout.CENTER);
46
47       CloseControlPanel ccp = new CloseControlPanel(dialog, false, true, Language.translate("Close"));
48       dialog.getContentPane().add(ccp, BorderLayout.SOUTH);
49
50       dialog.setSize(ThemesManager.getLabelFontSize()*40, ThemesManager.getLabelFontSize()*35);
51       SnowMailClientApp.centerComponentOnMainFrame(dialog);
52
53       dialog.setVisible(true);
54    }
55
56 }
57  // ViewAccountLog
Popular Tags