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 final class AddToHAMAction extends AbstractAction 20 { 21 FolderView folderView; 22 23 public AddToHAMAction(FolderView _folderView) 24 { 25 super(Language.translate("Set selected messages as HAM")); 26 this.folderView = _folderView; 27 28 30 31 33 34 folderView.getTableSelectionModel().addListSelectionListener( new ListSelectionListener() 35 { 36 public void valueChanged(ListSelectionEvent e) 37 { 38 setEnabled(folderView.getTableSelectionCount()>0); 39 } 40 }); 41 setEnabled(folderView.getTableSelectionCount()>0); 42 43 } 45 46 48 public void actionPerformed(ActionEvent e) 49 { 50 MailMessage[] messs = folderView.getSelectedMessages(); 51 for(MailMessage mess: messs) 52 { 53 mess.setHAM(true); 54 55 58 } 59 } 61 62 63 64 } | Popular Tags |