1 package net.suberic.pooka.filter; 2 import net.suberic.pooka.gui.MessageProxy; 3 import java.util.List ; 4 import java.util.ArrayList ; 5 import net.suberic.pooka.FolderInfo; 6 import net.suberic.pooka.Pooka; 7 8 11 public class MoveFilterAction implements FilterAction { 12 13 private FolderInfo targetFolder = null; 14 private String folderName = null; 15 16 public MoveFilterAction() { 17 } 18 19 29 public List performFilter(List filteredMessages) { 30 List moved = new ArrayList (); 31 for (int i = 0; i < filteredMessages.size(); i++) { 32 MessageProxy current = (MessageProxy) filteredMessages.get(i); 33 current.moveMessage(getTargetFolder(), false); 34 moved.add(current); 35 } 36 return moved; 37 } 38 39 45 46 public void initializeFilter(String sourceProperty) { 47 folderName = Pooka.getProperty(sourceProperty + ".targetFolder", ""); 48 } 49 50 55 public FolderInfo getTargetFolder() { 56 if (targetFolder == null) 57 targetFolder = Pooka.getStoreManager().getFolder(folderName); 58 59 return targetFolder; 60 } 61 62 } 63 | Popular Tags |