Subversion Repositories pub

Compare Revisions

Ignore whitespace Rev 51 → Rev 52

/pluggablejs/branches/1.0build27/samples/ui.js
0,0 → 1,8
 
var file = ui.promptForFile("Choose an appropriate executable");
 
err.println("Chosen file: "+file);
 
if (!file.canExecute()) {
err.println("Not a valid executable");
}
/pluggablejs/branches/1.0build27/samples/sandbox.js
0,0 → 1,30
 
var api = {
createPE: function() {
var pe = net.outlyer.plugins.PluginEnvironment.create();
pe.exportGlobalObject("input", input);
pe.exportGlobalObject("out", out);
pe.exportGlobalObject("err", err);
return pe;
},
 
createSandbox: function(uri) {
return api.createPE().createSandbox(uri);
},
};
 
var sb = api.createSandbox(new java.io.File("sandboxed-sandbox.js").toURI());
 
sb.execute();
 
/*
do {
var line = ui.prompt("%> ");
if (null == line || line.isEmpty()) {
break;
}
}
while (true);
*/
 
// vim:set ts=4 et ai: //
/pluggablejs/branches/1.0build27/samples/prefs.js
0,0 → 1,17
 
var prefs = java.utils.prefs;
 
var p = java.util.prefs.Preferences.userRoot();
 
var shell = new net.outlyer.plugins.Shell();
 
var k = java.util.prefs.Preferences.userNodeForPackage(shell.getClass());
 
err.println("user root: " + p);
err.println("pkg root: " + k);
 
k.put("SampleKey", "sampleValue");
k.sync();
err.println("Read: " + k.get("SampleKey", "none set"));
k.remove("SampleKey");
k.sync();
/pluggablejs/branches/1.0build27/samples/sandboxed-sandbox.js
0,0 → 1,3
 
err.println("I'm a sandbox inside a sandbox");