Package net.suberic.pooka.filter

Source Code of net.suberic.pooka.filter.DeleteFilterAction

package net.suberic.pooka.filter;
import net.suberic.pooka.gui.MessageProxy;
import java.util.List;

/**
* A FilterActions which deletes all of the given Messages.
*/
public class DeleteFilterAction implements FilterAction {

  public DeleteFilterAction() {

  }

  /**
   * Runs the filterAction on each MessageProxy in the filteredMessages
   * List.
   *
   * @param filteredMessages messages which have met the filter condition
   * and need to have the FilterAction performed on them.
   *
   * @return messages which are removed from their original folder
   * by the filter.
   */
  public List performFilter(List filteredMessages) {
    List deleted = new java.util.LinkedList();
    for (int i = 0; i < filteredMessages.size(); i++) {
      MessageProxy current = (MessageProxy) filteredMessages.get(i);
      current.deleteMessage(false);
      deleted.add(current);
    }

    return deleted;
  }

  /**
   * Initializes the FilterAction from the sourceProperty given.
   */

  public void initializeFilter(String sourceProperty) {
    // no initialization necessary.
  }
}
TOP

Related Classes of net.suberic.pooka.filter.DeleteFilterAction

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.