/jEdit/tags/jedit-4-2-pre4/bsh/commands/importCommands.bsh
Unknown | 39 lines | 31 code | 8 blank | 0 comment | 0 complexity | f23de37110f427c79cb0ad0984cb40d8 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
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