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

/jEdit/tags/jedit-4-0-pre3/bsh/commands/reloadClasses.bsh

#
Unknown | 42 lines | 35 code | 7 blank | 0 comment | 0 complexity | cb1ce4926bf27565ec8b5a8e96cd2245 MD5 | raw file
 1
 2bsh.help.reloadClasses= 
 3	"usage: reloadClasses( String class | String package | String [] classes )";
 4
 5import bsh.BshClassManager;
 6import bsh.ClassPathException;
 7
 8/**
 9	Reload specified set of classes
10*/
11reloadClasses( item ) 
12{
13	bcm = BshClassManager.getClassManager();
14
15	try {
16		if ( item instanceof String [] )
17			bcm.reloadClasses( item );
18		else {
19			name = item;
20
21			if ( name.endsWith(".*" ) ) {
22				if ( name.equals(".*" ) )
23					pack = "<unpackaged>";
24				else
25					pack = name.substring( 0, name.length()-2 );
26				
27				bcm.reloadPackage( pack );
28			} else
29				bcm.reloadClasses( new String[] { name } );
30		}
31	} catch ( ClassPathException e ) {
32		error( e.getMessage() );
33	}
34}
35
36/**
37	Reload all classes
38*/
39reloadClasses() 
40{
41	BshClassManager.getClassManager().reloadAllClasses();
42}