diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-01-05 12:45:58 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-01-05 12:45:58 +0000 |
commit | c9d37b0f0b8e813f9fa649b8fb225c91002e7603 (patch) | |
tree | 975261c44877644f6cecc5972e006c6a909789f2 /scripting | |
parent | 3076ea9dc6677dcf0f65c53c8f205d870dc27d53 (diff) |
INTEGRATION: CWS scriptingf2 (1.2.2); FILE MERGED
2003/12/15 16:04:39 npower 1.2.2.1: #i22568#, #i22564#
Updated edit classes to save ( direct support in ScriptEditorForBeanShell ) to document using embed Storage API. ScriptEditorForJavaScript modified to pass URL to rhino debugger.
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java index 7105ea86f3ee..406ff1829a56 100644 --- a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java +++ b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java @@ -2,9 +2,9 @@ * * $RCSfile: ScriptEditorForJavaScript.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: toconnor $ $Date: 2003-10-29 15:01:18 $ + * last change: $Author: rt $ $Date: 2004-01-05 13:45:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,15 +71,34 @@ import org.mozilla.javascript.tools.debugger.Main; import org.mozilla.javascript.tools.debugger.ScopeProvider; import drafts.com.sun.star.script.provider.XScriptContext; +import com.sun.star.script.framework.browse.ScriptMetaData; +import com.sun.star.script.framework.provider.PathUtils; +import com.sun.star.script.framework.log.LogUtils; +import java.io.IOException; +import java.net.URL; public class ScriptEditorForJavaScript { - public void edit(final XScriptContext xsctxt, String filename) { + public void edit(final XScriptContext xsctxt, ScriptMetaData entry ) { Main sdb = initUI(xsctxt); // This is the method we've added to open a file when starting // the Rhino debugger - sdb.openFile(filename); + try { + String sUrl = entry.getParcelLocation(); + if ( !sUrl.endsWith( "/" ) ) + { + sUrl += "/"; + } + sUrl += entry.getLanguageName(); + URL scriptURL = PathUtils.createScriptURL( sUrl ); + sdb.openFile(scriptURL); + } + catch ( IOException e ) + { + LogUtils.DEBUG("Caught exception: " + e ); + LogUtils.DEBUG( LogUtils.getTrace( e ) ); + } } public void go(final XScriptContext xsctxt, InputStream in) { |