Package net.suberic.util.thread

Examples of net.suberic.util.thread.ActionThread


      store.addConnectionListener(connectionListener);

    }

    if (storeThread == null) {
      storeThread = new ActionThread(this.getStoreID() + " - ActionThread");
      storeThread.start();
    }

    String defProfileString = Pooka.getProperty(getStoreProperty() + ".defaultProfile", "");
    if (defProfileString.length() < 1 || defProfileString.equalsIgnoreCase(UserProfile.S_DEFAULT_PROFILE_KEY)) {
View Full Code Here


  public void bounceMessage(Address[] addresses, boolean deleteOnSuccess, boolean expunge) {
    final Address[] final_addresses = addresses;
    final boolean final_delete = deleteOnSuccess;
    final boolean final_expunge = expunge;

    ActionThread folderThread = getMessageInfo().getFolderInfo().getFolderThread();
    folderThread.addToQueue(new javax.swing.AbstractAction() {
        public void actionPerformed(java.awt.event.ActionEvent ae) {
          try {
            getMessageInfo().bounceMessage(final_addresses);
            if (final_delete)
              deleteMessage(final_expunge);
View Full Code Here

  /**
   * Sets the deleteInProgress flag.
   */
  public void setDeleteInProgress(boolean newValue) {
    final boolean fNewValue = newValue;
    ActionThread folderThread = messageInfo.getFolderInfo().getFolderThread();
    javax.swing.AbstractAction deleteInProgressAction = new javax.swing.AbstractAction() {
        public void actionPerformed(java.awt.event.ActionEvent ae) {
          boolean orig = mDeleteInProgress;
          mDeleteInProgress = fNewValue;
          if (orig != mDeleteInProgress) {
            setRefresh(true);
            try {
              refreshMessage();
            } catch ( MessagingException me ) {
              me.printStackTrace();
            }
          }
        }
      };

      if (Thread.currentThread() != folderThread) {
        folderThread.addToQueue(deleteInProgressAction, new java.awt.event.ActionEvent(this, 0, "message-bounce"));
      } else {
        deleteInProgressAction.actionPerformed(null);
      }
  }
View Full Code Here

    return (Action)commands.get(name);
  }

  public Action[] getActions() {
    if (defaultActions == null) {
      ActionThread folderThread = messageInfo.getFolderInfo().getFolderThread();

      defaultActions = new Action[] {
        new ActionWrapper(new OpenAction(), folderThread),
        new ActionWrapper(new OpenDefaultDisplayAction(), folderThread),
        new ActionWrapper(new OpenFullDisplayAction(), folderThread),
View Full Code Here

      super("message-delete");
    }

    public void actionPerformed(ActionEvent e) {
      // should happen on UI thread.
      ActionThread folderThread = messageInfo.getFolderInfo().getFolderThread();

      if (getMessageUI() != null)
        getMessageUI().setBusy(true);
      FolderDisplayUI fw = getFolderDisplayUI();
      if (fw != null)
        fw.setBusy(true);

      if (fw != null && Pooka.getProperty("Pooka.fastDelete", "false").equalsIgnoreCase("true")) {
        List v = new ArrayList();
        v.add(MessageProxy.this);
        FolderDisplayPanel fdp = null;
        if (fw instanceof FolderInternalFrame) {
          fdp = ((FolderInternalFrame) fw).getFolderDisplay();
        } else if (fw instanceof PreviewFolderPanel) {
          fdp = ((PreviewFolderPanel) fw).getFolderDisplay();
        }
        if (fdp != null)
          fdp.moveSelectionOnRemoval(v);
      }


      folderThread.addToQueue(new javax.swing.AbstractAction() {
          public void actionPerformed(java.awt.event.ActionEvent ae) {
            try {
              deleteMessage();
            } finally {
View Full Code Here

    if (allStores.size() > 0) {
      si = (net.suberic.pooka.StoreInfo) allStores.get(0);
    }

    if (si != null) {
      ActionThread thread = si.getStoreThread();
      final net.suberic.pooka.StoreInfo storeInfo = si;

      // set our local variables to track what's going on.
      mOpenInboxException = null;
      mOpenInboxSuccessful = false;

      javax.swing.Action connectionAction = new javax.swing.AbstractAction() {
          public void actionPerformed(java.awt.event.ActionEvent ae) {
            try {
              storeInfo.connectStore();
              javax.swing.SwingUtilities.invokeLater( new Runnable() {

                  public void run() {
                    MailTreeNode mtn = null;
                    net.suberic.pooka.FolderInfo fi = storeInfo.getChild("INBOX");
                    if (fi != null) {
                      FolderNode fn = fi.getFolderNode();
                      Action openAction = fn.getAction("file-open");
                      openAction.actionPerformed(new java.awt.event.ActionEvent(this, 0, "file-open"));
                      mtn = fn;
                    } else {
                      mtn = storeInfo.getStoreNode();
                    }
                    if (mtn != null) {
                      javax.swing.JTree folderTree = ((FolderPanel)mtn.getParentContainer()).getFolderTree();
                      folderTree.scrollPathToVisible(new javax.swing.tree.TreePath(mtn.getPath()));
                    }

                    openInboxSuccess();
                  }
                });
            } catch (Exception me) {
              Pooka.getUIFactory().clearStatus();
              me.printStackTrace();
              int continueValue = handleInvalidEntry(me.getMessage());
              if (continueValue == JOptionPane.YES_OPTION) {
                getEditorPane().removeDisableMask(FirstRunWizardController.this);
                // remove all of the properties we just set.
                clearProperties();
                mState = "storeConfig";
                getEditorPane().loadState("storeConfig");
              } else {
                getEditorPane().getWizardContainer().closeWizard();
              }
            }
          }
        };

      thread.addToQueue(connectionAction, new java.awt.event.ActionEvent(this, 0, "connectStore"));
    }

  }
View Full Code Here

TOP

Related Classes of net.suberic.util.thread.ActionThread

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.