KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > gjt > jclasslib > browser > BrowserDesktopManager


1 /*
2     This library is free software; you can redistribute it and/or
3     modify it under the terms of the GNU General Public
4     License as published by the Free Software Foundation; either
5     version 2 of the license, or (at your option) any later version.
6 */

7
8 package org.gjt.jclasslib.browser;
9
10 import org.gjt.jclasslib.mdi.BasicDesktopManager;
11
12 import javax.swing.event.InternalFrameEvent JavaDoc;
13
14 /**
15     The desktop manager for the class file browser application.
16  
17     @author <a HREF="mailto:jclasslib@ej-technologies.com">Ingo Kegel</a>
18     @version $Revision: 1.6 $ $Date: 2003/08/18 08:05:39 $
19 */

20 public class BrowserDesktopManager extends BasicDesktopManager {
21
22     /**
23         Constructor.
24         @param parentFrame the parent frame
25      */

26     public BrowserDesktopManager(BrowserMDIFrame parentFrame) {
27         super(parentFrame);
28     }
29
30     public void internalFrameActivated(InternalFrameEvent JavaDoc event) {
31         BrowserInternalFrame internalFrame = (BrowserInternalFrame)event.getInternalFrame();
32         actionStatus(internalFrame);
33         internalFrame.getBrowserComponent().checkSelection();
34     }
35
36     public void internalFrameDeactivated(InternalFrameEvent JavaDoc event) {
37         actionStatus(null);
38     }
39
40
41     private void actionStatus(BrowserInternalFrame internalFrame) {
42
43         BrowserMDIFrame browserParentFrame = (BrowserMDIFrame)parentFrame;
44
45         if (internalFrame != null) {
46             internalFrame.getBrowserComponent().getHistory().updateActions();
47         } else {
48             browserParentFrame.getActionReload().setEnabled(false);
49             browserParentFrame.getActionBackward().setEnabled(false);
50             browserParentFrame.getActionForward().setEnabled(false);
51         }
52         browserParentFrame.getActionReload().setEnabled(internalFrame != null);
53     }
54 }
55
Popular Tags