https://bz.apache.org/ooo/show_bug.cgi?id=75132
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] Severity|Trivial |Major Latest|--- |4.2.0-dev Confirmation in| | --- Comment #6 from [email protected] --- Confirming. Script embedding and inline editing is sorely needed, even in latest trunk. The ScriptProviderForPython is in main/scripting/source/pyprov/pythonscript.py, and has this: ENABLE_EDIT_DIALOG=False # offers a minimal editor for editing. but changing it to True doesn't help. The inability to create/edit/embed new scripts comes from the fact that properties like "creatable" aren't handled in ScriptBrowseNode.getPropertyValue(), but adding them isn't enough, clicking "Edit" doesn't show anything. Why? ScriptBrowseNode.invoke() is called with "Editable", and then fails in lines 518-520 of main/scripting/source/pyprov/pythonscript.py: 511 def invoke( self, name, params, outparamindex, outparams ): 512 if name == "Editable": 513 servicename = "com.sun.star.awt.DialogProvider" 514 ctx = self.provCtx.scriptContext.getComponentContext() 515 dlgprov = ctx.ServiceManager.createInstanceWithContext( 516 servicename, ctx ) 517 518 self.editor = dlgprov.createDialog( 519 "vnd.sun.star.script:" + 520 "ScriptBindingLibrary.MacroEditor?location=application") because I don't think that way of creating dialogs works any more. How do other languages create edit dialogs? Javascript in main/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java uses the Rhino engine's own org.mozilla.javascript.tools.debugger.Main class, which draws the edit/debug window, and does little more than load text into it. Beanshell in main/scripting/java/com/sun/star/script/framework/provider/beanshell/... uses its own custom window drawn by Java's AWT/Swing framework. It is minimally functional, Run/Clear/Save/Close, and has no interactive debugging. Java in main/scripting/java/com/sun/star/script/framework/provider/java/... doesn't support editing. StarBasic? Not there. But its custom dialog is very richly featured, with elaborate debugging. So it looks like Python needs to provide its own custom editor dialog window as well. Interestingly there is a MacroEditor.hdl in main/scripting/workben/bindings/MacroEditor.xdl, but it's neither built nor delivered. Possibly some half-baked experiment? Python does have a small IDE that comes with it called IDLE, which we might be able to use to get many features working, similar to the Javascript module using Rhino's editor/debugger window. And Python is now one of the most widely used languages, and popular for scientific computing, it's not a "Trivial" importance bug any more. -- You are receiving this mail because: You are on the CC list for the issue. You are the assignee for the issue.
