PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-2-pre4/bsh/commands/classBrowser.bsh

#
Unknown | 48 lines | 38 code | 10 blank | 0 comment | 0 complexity | 23670d4c5f0bfbca9dd26ea0b2112031 MD5 | raw file
 1/**
 2	Open the class browser.
 3*/
 4import bsh.util.ClassBrowser;
 5
 6classBrowser() 
 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