home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Freeware 25 / FreelogHS25.iso / Dessin / ArtOfIllusion2.2.1 / ArtOfIllusion.jar / bsh / commands / classBrowser.bsh < prev    next >
Text File  |  2005-05-23  |  1KB  |  49 lines

  1. /**
  2.     Open the class browser.
  3. */
  4. import bsh.util.ClassBrowser;
  5.  
  6. classBrowser() 
  7. {
  8.     this.inDesktop = ( bsh.system.desktop != void );
  9.  
  10.     this.browser = new ClassBrowser( this.interpreter.getClassManager() );
  11.     browser.init();
  12.  
  13.     if ( inDesktop ) {
  14.         this.frame = 
  15.             bsh.system.desktop.makeInternalFrame("BeanShell Class Browser");
  16.         frame.frameIcon = bsh.system.icons.eye;
  17.         bsh.system.desktop.classbrowser = browser;
  18.     } else {
  19.         this.frame = new javax.swing.JFrame("BeanShell Class Browser");
  20.         frame.iconImage=bsh.system.icons.eye.image;
  21.     }
  22.         
  23.     // Ignore unhandled method invocations from listeners.
  24.     invoke( name, args ) {
  25.         if ( !name.startsWith("internalFrame") )
  26.             throw new Error("method: "+name);
  27.     }
  28.     internalFrameClosing( e ) {
  29.         // really need foo=void;...  
  30.         bsh.system.desktop.classbrowser = null;
  31.     }
  32.  
  33.     if ( inDesktop )
  34.         frame.addInternalFrameListener(this);
  35.  
  36.     browser.setFrame( frame );
  37.     frame.getContentPane().add("Center", browser);
  38.     frame.pack();
  39.  
  40.     if ( inDesktop )
  41.         bsh.system.desktop.addInternalFrame(frame);
  42.  
  43.     frame.show();
  44.     frame.selected=true;
  45.  
  46.     return browser;
  47. }
  48.  
  49.