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"));
}
}