KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > suberic > pooka > gui > MainPanel


1 package net.suberic.pooka.gui;
2 import net.suberic.pooka.Pooka;
3 import net.suberic.pooka.StoreInfo;
4 import java.util.*;
5 import java.awt.*;
6 import java.awt.event.*;
7 import java.io.*;
8 import java.beans.*;
9 import javax.swing.*;
10 import javax.swing.text.*;
11 import javax.swing.border.*;
12 import javax.mail.Session JavaDoc;
13 import javax.mail.MessagingException JavaDoc;
14 import javax.mail.event.MessageCountEvent JavaDoc;
15 import javax.help.*;
16 import java.util.logging.Logger JavaDoc;
17
18 import net.suberic.pooka.MailQueue;
19 import net.suberic.pooka.UserProfile;
20 import net.suberic.util.gui.*;
21
22 /**
23  * The main panel for PookaMail
24  *
25  * @author Allen Petersen
26  * @version $Id: MainPanel.java 1685 2007-06-20 16:27:44Z akp $
27  */

28
29 public class MainPanel extends JPanel implements net.suberic.pooka.UserProfileContainer, ActionContainer {
30   private JSplitPane splitPane;
31   private ConfigurableMenuBar mainMenu;
32   private ConfigurableToolbar mainToolbar;
33   private FolderPanel folderPanel;
34   private ContentPanel contentPanel;
35   private InfoPanel infoPanel;
36   private Session JavaDoc session;
37   private MailQueue mailQueue;
38   private UserProfile currentUser = null;
39   private ConfigurableKeyBinding keyBindings;
40
41   protected PookaFocusManager focusManager;
42
43   // status
44
private static int CONTENT_LAST = 0;
45   private static int FOLDER_LAST = 5;
46
47   public MainPanel(JFrame frame) {
48     session = Pooka.getDefaultSession();
49
50     mailQueue = new MailQueue(Pooka.getDefaultSession());
51
52   }
53
54   /**
55    * This actually sets up the main panel.
56    */

57   public void configureMainPanel() {
58     // set supported actions
59
// this.setLayout(new BorderLayout());
60
// create the menu bar.
61

62     this.setLayout(new BorderLayout());
63
64     contentPanel = Pooka.getUIFactory().createContentPanel();
65     folderPanel = new FolderPanel(this);
66     infoPanel = new InfoPanel();
67     infoPanel.setMessage("Pooka");
68
69     splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
70
71     splitPane.setLeftComponent(folderPanel);
72     splitPane.setRightComponent(contentPanel.getUIComponent());
73     splitPane.setDividerLocation(folderPanel.getPreferredSize().width + 1);
74
75     this.add("Center", splitPane);
76
77     mainMenu = new ConfigurableMenuBar("MenuBar", Pooka.getResources());
78     mainToolbar = Pooka.getUIFactory().createMainToolbar();
79
80     if (mainToolbar != null)
81       this.add("North", mainToolbar);
82
83     keyBindings = new ConfigurableKeyBinding(this, "MainPanel.keyBindings", Pooka.getResources());
84     //keyBindings.setCondition(JComponent.WHEN_IN_FOCUSED_WINDOW);
85
keyBindings.setCondition(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
86
87     Pooka.getHelpBroker().enableHelpKey(this, "pooka.intro", Pooka.getHelpBroker().getHelpSet());
88
89     getParentFrame().addWindowListener(new WindowAdapter() {
90         public void windowClosing(WindowEvent e) {
91           exitPooka(true);
92         }
93       });
94
95     focusManager = new PookaFocusManager();
96
97     this.addFocusListener(new FocusAdapter() {
98         public void focusGained(FocusEvent e) {
99           // we never want focus.
100
focusManager.passFocus();
101         }
102       });
103
104     // set the initial currentUser
105
refreshCurrentUser();
106
107     // set up the MessageNotificationManager.
108
if (Pooka.getUIFactory().getMessageNotificationManager() != null) {
109       Pooka.getUIFactory().getMessageNotificationManager().setMainPanel(this);
110     }
111     // select the content panel.
112
contentPanel.getUIComponent().requestFocusInWindow();
113
114   }
115
116   /**
117    * This gets all the actions associated with this panel. Useful for
118    * populating the MenuBar and Toolbar.
119    *
120    * The method actually returns the Panel's defaultActions plus the
121    * actions of the folderPanel and/or contentPanel, depending on which
122    * one currently has the focus.
123    */

124   public Action[] getActions() {
125     Action[] actions = getDefaultActions();
126     Component focusedComponent = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
127
128     boolean foundParent = false;
129
130     if (focusedComponent != null) {
131       if (contentPanel != null) {
132         if (SwingUtilities.isDescendingFrom(focusedComponent, contentPanel.getUIComponent())) {
133           foundParent = true;
134           focusManager.setLastStatus(CONTENT_LAST);
135           if (contentPanel.getActions() != null) {
136             actions = TextAction.augmentList(contentPanel.getActions(), actions);
137           }
138         }
139       }
140
141       if (! foundParent && folderPanel != null) {
142         if (SwingUtilities.isDescendingFrom(focusedComponent, folderPanel)) {
143           foundParent = true;
144           focusManager.setLastStatus(FOLDER_LAST);
145           if (folderPanel.getActions() != null) {
146             actions = TextAction.augmentList(folderPanel.getActions(), actions);
147           }
148         }
149       }
150     }
151
152     if (! foundParent) {
153       // if no parent is found, get the actions from the last selected
154
// item.
155
int lastStatus = focusManager.getLastStatus();
156       if (lastStatus == CONTENT_LAST && contentPanel != null) {
157         if (contentPanel.getActions() != null) {
158           actions = TextAction.augmentList(contentPanel.getActions(), actions);
159         }
160       } else if (lastStatus == FOLDER_LAST && folderPanel != null) {
161         if (folderPanel.getActions() != null) {
162           actions = TextAction.augmentList(folderPanel.getActions(), actions);
163         }
164
165       }
166     }
167     return actions;
168   }
169
170
171   /**
172    * Called by ExtendedDesktopManager every time the focus on the windows
173    * changes. Resets the Actions associated with the menu items and toolbar
174    * to the ones in the active window.
175    *
176    * Also called when the selected message in a FolderWindow is changed.
177    */

178
179   public void refreshActiveMenus() {
180     Action[] currentActions = getActions();
181     mainMenu.setActive(currentActions);
182     if (mainToolbar != null)
183       mainToolbar.setActive(currentActions);
184     contentPanel.refreshActiveMenus();
185     keyBindings.setActive(currentActions);
186     if (Pooka.getUIFactory().getMessageNotificationManager() != null)
187       Pooka.getUIFactory().getMessageNotificationManager().clearNewMessageFlag();
188   }
189
190   /**
191    * refreshCurrentUser() is called to get a new value for the currently
192    * selected item. In MainPanel, all it does is tries to get a
193    * UserProfile from the currently selected object in the ContentPanel.
194    * If there is no object in the ContentPanel which gives a default
195    * UserProfile, it then checks the FolderPanel. If neither of these
196    * returns a UserProfile, then the default UserProfile is returned.
197    */

198   protected void refreshCurrentUser() {
199     UserProfile selectedProfile = getDefaultProfile();
200     if (selectedProfile != null) {
201       currentUser = selectedProfile;
202     } else {
203       currentUser = Pooka.getPookaManager().getUserProfileManager().getDefaultProfile();
204     }
205   }
206
207   /**
208    * As defined in net.suberic.pooka.UserProfileContainer.
209    *
210    * Note that this method can return null, and is primarily used to
211    * get the currentUser. If you want to get the current default
212    * profile, use getCurrentUser() instead.
213    */

214   public UserProfile getDefaultProfile() {
215     UserProfile returnValue = null;
216
217     if (contentPanel != null) {
218       returnValue = contentPanel.getDefaultProfile();
219     }
220
221     if (returnValue != null)
222       return returnValue;
223
224     if (folderPanel != null)
225       returnValue = folderPanel.getDefaultProfile();
226
227     return returnValue;
228
229   }
230
231   public UserProfile getCurrentUser() {
232     return currentUser;
233   }
234
235   /**
236    * This exits Pooka.
237    */

238   public void exitPooka(boolean exitToIcon) {
239     if (! processUnsentMessages())
240       return;
241
242     if (contentPanel instanceof MessagePanel &&
243         ((MessagePanel)contentPanel).isSavingWindowLocations()) {
244       ((MessagePanel)contentPanel).saveWindowLocations();
245     }
246
247     Pooka.setProperty("Pooka.hsize", Integer.toString(this.getParentFrame().getWidth()));
248     Pooka.setProperty("Pooka.vsize", Integer.toString(this.getParentFrame().getHeight()));
249     Pooka.setProperty("Pooka.folderPanel.hsize", Integer.toString(folderPanel.getWidth()));
250     Pooka.setProperty("Pooka.folderPanel.vsize", Integer.toString(folderPanel.getHeight()));
251     Pooka.setProperty("Pooka.lastX", Integer.toString(this.getParentFrame().getX()));
252     Pooka.setProperty("Pooka.lastY", Integer.toString(this.getParentFrame().getY()));
253     contentPanel.savePanelSize();
254
255     if (contentPanel.isSavingOpenFolders()) {
256       contentPanel.saveOpenFolders();
257     }
258
259     if (exitToIcon && Pooka.getProperty("Pooka.exitToIcon", "false").equalsIgnoreCase("true") && Pooka.getUIFactory().getMessageNotificationManager().getTrayIcon() != null) {
260       Pooka.sStartupManager.stopPookaToTray(this);
261     } else {
262       Pooka.exitPooka(0, this);
263     }
264   }
265
266   /**
267    * Checks to see if there are any unsent messages. If there are,
268    * then find out if we want to save them as drafts, send them, or
269    * forget them.
270    *
271    * Returns true if all of the messages are processed, false if the
272    * user cancels out.
273    */

274   public boolean processUnsentMessages() {
275     Vector unsentMessages = NewMessageProxy.getUnsentProxies();
276     boolean cancel = false;
277     Vector unsentCopy = new Vector(unsentMessages);
278     for (int i = 0; !cancel && i < unsentCopy.size(); i++) {
279       NewMessageProxy current = (NewMessageProxy)unsentCopy.get(i);
280       if (current.promptForClose()) {
281         NewMessageUI nmui = current.getNewMessageUI();
282         // FIXME
283
if (nmui != null) {
284           nmui.openMessageUI();
285           int saveDraft = nmui.promptSaveDraft();
286           switch (saveDraft) {
287           case JOptionPane.YES_OPTION:
288             current.saveDraft();
289             break;
290           case JOptionPane.NO_OPTION:
291             nmui.setModified(false);
292             nmui.closeMessageUI();
293             break;
294           case JOptionPane.CANCEL_OPTION:
295             cancel = true;
296           }
297         }
298       }
299     }
300
301     return ! cancel;
302   }
303
304   // Accessor methods.
305
// These shouldn't all be public.
306

307   public ConfigurableMenuBar getMainMenu() {
308     return mainMenu;
309   }
310
311   public InfoPanel getInfoPanel() {
312     return infoPanel;
313   }
314
315   public void setMainMenu(ConfigurableMenuBar newMainMenu) {
316     mainMenu=newMainMenu;
317   }
318
319   public ConfigurableToolbar getMainToolbar() {
320     return mainToolbar;
321   }
322
323   public ConfigurableKeyBinding getKeyBindings() {
324     return keyBindings;
325   }
326
327   public void setKeyBindings(ConfigurableKeyBinding newKeyBindings) {
328     keyBindings = newKeyBindings;
329   }
330
331
332   public void setMainToolbar(ConfigurableToolbar newMainToolbar) {
333     if (mainToolbar != null)
334       this.remove(mainToolbar);
335
336     mainToolbar = newMainToolbar;
337
338     if (mainToolbar != null)
339       this.add("North", mainToolbar);
340
341   }
342
343   public ContentPanel getContentPanel() {
344     return contentPanel;
345   }
346
347   public void setContentPanel(ContentPanel newCp) {
348     contentPanel = newCp;
349     splitPane.setRightComponent(newCp.getUIComponent());
350     this.repaint();
351   }
352
353   public FolderPanel getFolderPanel() {
354     return folderPanel;
355   }
356
357   public Session JavaDoc getSession() {
358     return session;
359   }
360
361   public MailQueue getMailQueue() {
362     return mailQueue;
363   }
364
365   public Action[] getDefaultActions() {
366     return defaultActions;
367   }
368
369   public PookaFocusManager getFocusManager() {
370     return focusManager;
371   }
372
373   /**
374    * Find the hosting frame, for the file-chooser dialog.
375    */

376   public JFrame getParentFrame() {
377     return (JFrame) getTopLevelAncestor();
378   }
379
380   //-----------actions----------------
381
// Actions supported by the main Panel itself. These should always
382
// be available, even when no documents are open.
383

384   private Action[] defaultActions = {
385     new ExitAction(),
386     new EditUserConfigAction(),
387     new EditStoreConfigAction(),
388     new EditPreferencesAction(),
389     new EditAddressBookAction(),
390     new EditOutgoingServerAction(),
391     new EditConnectionAction(),
392     new EditInterfaceAction(),
393     new EditCryptoAction(),
394     new EditAllPreferencesAction(),
395     new HelpAboutAction(),
396     new HelpLicenseAction(),
397     new HelpAction(),
398     new HelpKeyBindingsAction(),
399     new SelectMessagePanelAction(),
400     new SelectFolderPanelAction(),
401     new NewMessageAction(),
402     new ExportConfigAction()
403   };
404
405
406   /*
407    * TODO: This really needs to check and ask if you want to save any
408    * modified documents. Of course, we don't check to see if the docs
409    * are modified yet, so this will do for now.
410    */

411   class ExitAction extends AbstractAction {
412
413     ExitAction() {
414       super("file-exit");
415     }
416
417     public void actionPerformed(ActionEvent e) {
418       exitPooka(false);
419     }
420   }
421
422   class ActivateWindowAction extends AbstractAction {
423
424     ActivateWindowAction() {
425       super("activate-window");
426     }
427
428     public void actionPerformed(ActionEvent e) {
429       try {
430         ((JInternalFrame)(((MessagePanel)contentPanel).getComponent(Integer.parseInt(e.getActionCommand())))).setSelected(true);
431       } catch (java.beans.PropertyVetoException JavaDoc pve) {
432       } catch (NumberFormatException JavaDoc nfe) {
433       }
434     }
435   }
436
437   class EditUserConfigAction extends AbstractAction {
438
439     EditUserConfigAction() {
440       super("cfg-users");
441     }
442
443     public void actionPerformed(ActionEvent e) {
444       Pooka.getUIFactory().showEditorWindow(Pooka.getProperty("title.userConfig", "Edit User Information"), "UserProfile.editor");
445     }
446   }
447
448
449   class EditStoreConfigAction extends AbstractAction {
450
451     EditStoreConfigAction() {
452       super("cfg-stores");
453     }
454
455     public void actionPerformed(ActionEvent e) {
456
457       Pooka.getUIFactory().showEditorWindow(Pooka.getProperty("title.storeConfig", "Edit Mailbox Information"), "Store");
458     }
459   }
460
461   class EditPreferencesAction extends AbstractAction {
462
463     EditPreferencesAction() {
464       super("cfg-prefs");
465     }
466
467     public void actionPerformed(ActionEvent e) {
468       Pooka.getUIFactory().showEditorWindow(Pooka.getProperty("title.preferences", "Edit Preferences"), "Preferences");
469     }
470   }
471
472   class EditAddressBookAction extends AbstractAction {
473
474     EditAddressBookAction() {
475       super("cfg-address-book");
476     }
477
478     public void actionPerformed(ActionEvent e) {
479       Pooka.getUIFactory().showEditorWindow(Pooka.getProperty("title.addressBook", "Address Book Editor"), "AddressBook.editor");
480     }
481   }
482
483   class EditOutgoingServerAction extends AbstractAction {
484
485     EditOutgoingServerAction() {
486       super("cfg-outgoing");
487     }
488
489     public void actionPerformed(ActionEvent e) {
490       Pooka.getUIFactory().showEditorWindow(Pooka.getProperty("title.outgoingServer", "Outgoing Mail Editor"), "OutgoingServer.editor");
491     }
492   }
493
494   class EditConnectionAction extends AbstractAction {
495
496     EditConnectionAction() {
497       super("cfg-connection");
498     }
499
500     public void actionPerformed(ActionEvent e) {
501       Pooka.getUIFactory().showEditorWindow(Pooka.getProperty("title.connectionEditor", "Connection Editor"), "Connection.editor");
502     }
503   }
504
505   class EditCryptoAction extends AbstractAction {
506
507     EditCryptoAction() {
508       super("cfg-crypto");
509     }
510
511     public void actionPerformed(ActionEvent e) {
512       Pooka.getUIFactory().showEditorWindow(Pooka.getProperty("title.cryptoEditor", "Encryption Editor"), "EncryptionManager");
513     }
514   }
515
516   class EditInterfaceAction extends AbstractAction {
517
518     EditInterfaceAction() {
519       super("cfg-interface-style");
520     }
521
522     public void actionPerformed(ActionEvent e) {
523       Pooka.getUIFactory().showEditorWindow(Pooka.getProperty("title.interfaceEditor", "User Interface Editor"), "Pooka.interface");
524     }
525   }
526
527   class EditAllPreferencesAction extends AbstractAction {
528
529     EditAllPreferencesAction() {
530       super("cfg-all-prefs");
531     }
532
533     public void actionPerformed(ActionEvent e) {
534       Pooka.getUIFactory().showEditorWindow(Pooka.getProperty("title.preferences", "Edit Preferences"), "Pooka.allPreferences");
535     }
536   }
537
538   class HelpAboutAction extends AbstractAction {
539
540     HelpAboutAction() {
541       super("help-about");
542     }
543
544     public void actionPerformed(ActionEvent e) {
545       String JavaDoc fileName="About.html";
546       String JavaDoc dir="/net/suberic/pooka/doc";
547       contentPanel.showHelpScreen(Pooka.getProperty("MenuBar.Help.About.Label", "About Pooka"), this.getClass().getResource(dir + "/" + java.util.Locale.getDefault().getLanguage() + "/" + fileName));
548
549     }
550   }
551
552   class HelpLicenseAction extends AbstractAction {
553
554     HelpLicenseAction() {
555       super("help-license");
556     }
557
558     public void actionPerformed(ActionEvent e) {
559       String JavaDoc fileName="COPYING";
560       String JavaDoc dir="/net/suberic/pooka";
561       contentPanel.showHelpScreen(Pooka.getProperty("MenuBar.Help.License.Label", "License"), this.getClass().getResource(dir + "/" + fileName));
562     }
563   }
564
565   class HelpAction extends AbstractAction {
566
567     HelpAction() {
568       super("help");
569     }
570
571     public void actionPerformed(ActionEvent e) {
572       new CSH.DisplayHelpFromSource(Pooka.getHelpBroker()).actionPerformed(e);
573     }
574   }
575
576   class HelpKeyBindingsAction extends AbstractAction {
577
578     HelpKeyBindingsAction() {
579       super("help-keybindings");
580     }
581
582     public void actionPerformed(ActionEvent e) {
583       String JavaDoc fileName="KeyBindings.html";
584       String JavaDoc dir="/net/suberic/pooka/doc";
585       contentPanel.showHelpScreen(Pooka.getProperty("MenuBar.Help.KeyBindings.Label", "Pooka KeyBindings"), this.getClass().getResource(dir + "/" + java.util.Locale.getDefault().getLanguage() + "/" + fileName));
586     }
587   }
588
589   class SelectMessagePanelAction extends AbstractAction {
590
591     SelectMessagePanelAction() {
592       super("select-message-panel");
593     }
594
595     public void actionPerformed(ActionEvent e) {
596       contentPanel.getUIComponent().requestFocusInWindow();
597     }
598   }
599
600   class SelectFolderPanelAction extends AbstractAction {
601
602     SelectFolderPanelAction() {
603       super("select-folder-panel");
604     }
605
606     public void actionPerformed(ActionEvent e) {
607       folderPanel.requestFocusInWindow();
608     }
609   }
610
611   public class NewMessageAction extends AbstractAction {
612     NewMessageAction() {
613       super("message-new");
614     }
615
616     public void actionPerformed(ActionEvent e) {
617       try {
618         MessageUI nmu = Pooka.getUIFactory().createMessageUI(new NewMessageProxy(new net.suberic.pooka.NewMessageInfo(new javax.mail.internet.MimeMessage JavaDoc(getSession()))));
619         nmu.openMessageUI();
620       } catch (MessagingException JavaDoc me) {
621         Pooka.getUIFactory().showError(Pooka.getProperty("error.NewMessage.errorLoadingMessage", "Error creating new message: ") + "\n" + me.getMessage(), Pooka.getProperty("error.NewMessage.errorLoadingMessage.title", "Error creating new message."), me);
622       }
623
624     }
625
626   }
627
628   public class ExportConfigAction extends AbstractAction {
629     ExportConfigAction() {
630       super("cfg-export");
631     }
632
633     public void actionPerformed(ActionEvent e) {
634       JFileChooser jfc;
635       String JavaDoc currentDirectoryPath = Pooka.getProperty("Pooka.tmp.currentDirectory", "");
636       if (currentDirectoryPath == "")
637         jfc = new JFileChooser();
638       else
639         jfc = new JFileChooser(currentDirectoryPath);
640
641       jfc.setDialogTitle("Choose Export File");
642       jfc.setFileSelectionMode(JFileChooser.FILES_ONLY);
643       jfc.setMultiSelectionEnabled(false);
644       int a = jfc.showDialog(MainPanel.this, "Save");
645
646       Pooka.getResources().setProperty("Pooka.tmp.currentDirectory", jfc.getCurrentDirectory().getPath(), true);
647
648       if (a == JFileChooser.APPROVE_OPTION) {
649         File f = jfc.getSelectedFile();
650         try {
651           net.suberic.pooka.resource.DisklessResourceManager.exportResources(f, false);
652           Pooka.getUIFactory().showMessage("Resources exported successfully", "Export complete");
653         } catch (Exception JavaDoc exc) {
654           Pooka.getUIFactory().showError("Error exporting resources", exc);
655         }
656
657       }
658     }
659
660   }
661
662
663   /**
664    * Keeps the menus and configured Actions current by following the
665    * keyboard focus.
666    */

667   public class PookaFocusManager implements PropertyChangeListener {
668
669     int lastStatus = CONTENT_LAST;
670
671     /**
672      * Creates a new PookaFocusManager.
673      */

674     public PookaFocusManager() {
675       KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
676       kfm.addPropertyChangeListener("permanentFocusOwner", this);
677     }
678
679     /**
680      * Called when the focus changes.
681      */

682     public void propertyChange(java.beans.PropertyChangeEvent JavaDoc pce) {
683       // make sure that we're not doing anything stupid like saying that
684
// either the JFrame or nothing has the keyboard focus.
685
Object JavaDoc newValue = pce.getNewValue();
686       Object JavaDoc oldValue = pce.getOldValue();
687       // if seems like it, pass it on to a default.
688
if ((newValue == null && oldValue == null) || newValue instanceof JFrame) {
689         passFocus();
690       } else {
691         // see if the new value is actually part of this frame.
692
if (newValue != null && newValue instanceof Component) {
693           Window parentWindow = SwingUtilities.getWindowAncestor(MainPanel.this);
694           Window componentParentWindow = SwingUtilities.getWindowAncestor((Component) newValue);
695           if (parentWindow == componentParentWindow || componentParentWindow == null) {
696             refreshActiveMenus();
697             refreshCurrentUser();
698           } else {
699
700             java.util.logging.Logger.getLogger("Pooka.debug.gui.focus").fine("component " + newValue + " got focus, but it's not part of the main window. Ignoring.");
701
702
703             java.util.logging.Logger.getLogger("Pooka.debug.gui.focus").fine("main window = " + parentWindow + "; component's parent = " + componentParentWindow);
704           }
705         }
706       }
707     }
708
709     /**
710      * Passes the focus to the correct subcomponent.
711      */

712     public void passFocus() {
713       java.util.logging.Logger.getLogger("Pooka.debug.gui.focus").fine("passing focus to subcomponent.");
714       if (lastStatus == CONTENT_LAST && contentPanel != null) {
715         if (contentPanel instanceof JComponent)
716           ((JComponent)contentPanel).requestFocusInWindow();
717         else
718           contentPanel.getUIComponent().requestFocusInWindow();
719       } else if (lastStatus == FOLDER_LAST && folderPanel != null) {
720         folderPanel.requestFocusInWindow();
721       }
722     }
723
724     /**
725      * Returns the last panel that had focus.
726      */

727     public int getLastStatus() {
728       return lastStatus;
729     }
730
731     /**
732      * Sets the last panel that had focus.
733      */

734     public void setLastStatus(int newStatus) {
735       lastStatus = newStatus;
736     }
737   }
738 }
739
Popular Tags