PageRenderTime 39ms CodeModel.GetById 36ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-5-pre1/org/gjt/sp/jedit/bsh/commands/importCommands.bsh

#
Unknown | 39 lines | 31 code | 8 blank | 0 comment | 0 complexity | f23de37110f427c79cb0ad0984cb40d8 MD5 | raw file
 1/**
 2	Import scripted or compiled BeanShell commands in the following package
 3	in the classpath.  You may use either "/" path or "." package notation.
 4	e.g. 
 5	<pre>
 6		// equivalent
 7		importCommands("/bsh/commands")
 8		importCommands("bsh.commands")
 9	<pre>
10
11	When searching for a command each path will be checked for first, a file
12	named 'command'.bsh and second a class file named 'command'.class.
13	<p/>
14
15	You may add to the BeanShell classpath using the addClassPath() or
16	setClassPath() commands and then import them as usual.
17	<pre>
18		addClassPath("mycommands.jar");
19		importCommands("/mypackage/commands");
20	</pre>
21	<p/>
22
23	If a relative path style specifier is used then it is made into an absolute
24	path by prepending "/".  Later imports take precedence over earlier ones.
25	<p/>
26
27	Imported commands are scoped just like imported clases.
28	<p/>
29
30	@method void importCommands( resource path | package name )
31*/
32
33bsh.help.importCommands = "usage: importCommands( string )";
34
35importCommands( path ) 
36{
37	this.caller.namespace.importCommands( path );
38}
39