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 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 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 } 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 53 } 54 } 56 57 58 59 } | Popular Tags |