KickJava   Java API By Example, From Geeks To Geeks.

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


1 package SnowMailClient.view.actions;
2
3 import SnowMailClient.SnowMailClientApp;
4 import SnowMailClient.model.folders.*;
5 import SnowMailClient.model.*;
6 import SnowMailClient.view.folders.*;
7 import SnowMailClient.view.*;
8 import SnowMailClient.Language.Language;
9
10 import java.awt.*;
11 import java.awt.event.*;
12 import javax.swing.*;
13 import javax.swing.event.*;
14 import javax.swing.table.*;
15
16
17 /** delete the selected mail (move in the deleted folder)
18 */

19 public class RemoveSPAMCategory extends AbstractAction
20 {
21   FolderView folderView;
22
23   public RemoveSPAMCategory(FolderView _folderView)
24   {
25      super(Language.translate("Remove SPAM or HAM definition"));
26      this.folderView = _folderView;
27
28      //putValue(AbstractAction.SMALL_ICON, SnowMailClientApp.loadImageIcon("pics/addtospam.PNG"));
29

30
31      folderView.getTableSelectionModel().addListSelectionListener( new ListSelectionListener()
32      {
33         public void valueChanged(ListSelectionEvent e)
34         {
35            setEnabled(folderView.getTableSelectionCount()>0);
36         }
37      });
38      setEnabled(folderView.getTableSelectionCount()>0);
39
40   } // Constructor
41

42   public void actionPerformed(ActionEvent e)
43   {
44      MailMessage[] messs = folderView.getSelectedMessages();
45      for(MailMessage mess: messs)
46      {
47         mess.setHAM(false);
48         mess.setSPAM(false);
49
50         // ### should update here the stat
51
/* SnowMailClientApp.getInstance().getWordStatistic().addText(
52           mess.getMessageBody(), true); */

53      }
54     // folderView.getMailFolder().notifyMailFolderListener_of_ContentEdited();
55
}
56
57
58
59 } // RemoveSPAMCategory
Popular Tags