KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SnowMailClient > view > traceView > TraceViewDialog


1 package SnowMailClient.view.traceView;
2
3 import java.awt.*;
4 import javax.swing.*;
5 import javax.swing.event.*;
6 import java.util.*;
7
8 import SnowMailClient.model.*;
9 import snow.utils.gui.*;
10 import SnowMailClient.Language.Language;
11
12 /** display the parsed path from EXAMPLE:
13
14 Received: (qmail 11802 invoked by uid 65534); 26 Mar 2004 02:30:05 -0000
15 Received: from britney.music.ch (EHLO britney.music.ch) (213.189.140.132)
16   by mx0.gmx.net (mx052) with SMTP; 26 Mar 2004 03:30:05 +0100
17 Received: from britney.music.ch (localhost [127.0.0.1])
18     by britney.music.ch (8.12.7/8.12.7/SuSE Linux 0.6) with ESMTP id i2Q2U3Y7024637
19     for <akimo@gmx.ch>; Fri, 26 Mar 2004 03:30:03 +0100
20 Received: (from music039@localhost)
21     by britney.music.ch (8.12.7/8.12.7/Submit) id i2Q2U3LG024636;
22     Fri, 26 Mar 2004 03:30:03 +0100
23
24 */

25 public class TraceViewDialog extends JDialog
26 {
27   Header header;
28   JTable table = new JTable();
29   TraceModel traceModel = new TraceModel();
30
31   public TraceViewDialog(JFrame ref, Header header)
32   {
33      super(ref, Language.translate("Trace"), true);
34      this.header = header;
35      this.getContentPane().setLayout(new BorderLayout());
36      this.getContentPane().add(new JScrollPane(table), BorderLayout.CENTER);
37
38      Vector<HeaderEntry> hes = header.getAllEntries("Received");
39      for(HeaderEntry he: hes)
40      {
41         traceModel.addItem(new TraceItem(he.getValue()));
42      }
43
44      table.setModel(traceModel);
45
46      CloseControlPanel ccp = new CloseControlPanel(this, false, false, Language.translate("Close"));
47      this.getContentPane().add(ccp, BorderLayout.SOUTH);
48
49      setSize(1000,300);
50      setLocationRelativeTo(null);
51
52      setVisible(true);
53   } // Constructor
54

55
56
57
58
59 } // TraceViewDialog
Popular Tags