Package net.suberic.pooka.filter

Examples of net.suberic.pooka.filter.FilterAction


  /**
   * Runs the configured spam action on this message.
   */
  public void runSpamAction() {
    FilterAction spamFilter = null;
    try {
      spamFilter = MessageFilter.generateFilterAction("Pooka.spamAction");
    } catch (Exception e) {
      int configureNow = Pooka.getUIFactory().showConfirmDialog("Spam action currently not configured.  Would you like to configure it now?", "Configure Spam action", javax.swing.JOptionPane.YES_NO_OPTION);
      if (configureNow == javax.swing.JOptionPane.YES_OPTION) {
        // show configure screen.
        Pooka.getUIFactory().showEditorWindow(Pooka.getProperty("Preferences.Spam.label", "Spam"), "Pooka.spamAction");
      }

    }
    if (spamFilter != null) {
      List l = new LinkedList();
      for (int i = 0; i < messages.length; i++) {
        l.add(messages[i].getMessageProxy());
      }
      java.util.List removed = spamFilter.performFilter(l);
      if (removed != null && removed.size() > 0) {
        try {
          getFolderInfo().expunge();
        } catch (OperationCancelledException oce) {
        } catch (MessagingException me) {
View Full Code Here


   * Generates a FilterAction from the given property.
   */
  public static FilterAction generateFilterAction(String actionProperty) throws ClassNotFoundException, InstantiationException , IllegalAccessException {
    String className = Pooka.getProperty(actionProperty + ".class", "");
    Class filterClass = Class.forName(className);
    FilterAction newAction = (FilterAction)filterClass.newInstance();
    newAction.initializeFilter(actionProperty);
    return newAction;
  }
View Full Code Here

  /**
   * Runs the configured spam action on this message.
   */
  public void runSpamAction() {
    FilterAction spamFilter = null;
    try {
      spamFilter = MessageFilter.generateFilterAction("Pooka.spamAction");
    } catch (Exception e) {
      int configureNow = Pooka.getUIFactory().showConfirmDialog("Spam action currently not configured.  Would you like to configure it now?", "Configure Spam action", javax.swing.JOptionPane.YES_NO_OPTION);
      if (configureNow == javax.swing.JOptionPane.YES_OPTION) {
        // show configure screen.
        Pooka.getUIFactory().showEditorWindow(Pooka.getProperty("Preferences.Spam.label", "Spam"), "Pooka.spamAction");
      }

    }
    if (spamFilter != null) {
      Vector v = new Vector();
      v.add(this.getMessageProxy());
      java.util.List removed = spamFilter.performFilter(v);
      if (removed != null && removed.size() > 0) {
        try {
          getFolderInfo().expunge();
        } catch (Exception me) {
          // throw it away
View Full Code Here

TOP

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

Copyright © 2018 www.massapicom. 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.