1 7 8 package org.gjt.jclasslib.browser; 9 10 import org.gjt.jclasslib.mdi.BasicDesktopManager; 11 12 import javax.swing.event.InternalFrameEvent ; 13 14 20 public class BrowserDesktopManager extends BasicDesktopManager { 21 22 26 public BrowserDesktopManager(BrowserMDIFrame parentFrame) { 27 super(parentFrame); 28 } 29 30 public void internalFrameActivated(InternalFrameEvent event) { 31 BrowserInternalFrame internalFrame = (BrowserInternalFrame)event.getInternalFrame(); 32 actionStatus(internalFrame); 33 internalFrame.getBrowserComponent().checkSelection(); 34 } 35 36 public void internalFrameDeactivated(InternalFrameEvent 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 |