Hi Frank,

Frank Schönheit - Sun Microsystems Germany escribió:
not going into detail right now, but

It looks like there should be a way in the Scripting Framework to get
the controller or the frame of the DSBrowser, for example, without using
XScriptContext.getDesktop().getCurrent...

try the XScriptContext.getInvocationContext(), which was newly
introduced during this implementation, exactly for the reasons you
mentioned.

Yes I've seen this XScriptContext.getInvocationContext() in Netbeans IDE
code completion, and investigated what I could do with it, but found
that it is not too much, well at least what I wanted is a reference to the component (XModel if it has one, or XFrame/XController/XComponent is does not) where the script/macro was invoked. So getInvocationContext() looks promising by its name, but all I could get was storage references, not the context where it was invoked (context==component).

That's the road I followed:

* getter methods in XScriptContext
XComponentContext XScriptContext.getComponentContext()
XDesktop XScriptContext.getDesktop()
XModel XScriptContext.getDocument() [null if the module has no XModel, like the DSBrowser]
XScriptInvocationContext XScriptContext.getInvocationContext()

* this last one has only a method:
XEmbeddedScripts XScriptInvocationContext.getScriptContainer()

* and XEmbeddedScripts:
boolean XEmbeddedScripts.getAllowMacroExecution();
XStorageBasedLibraryContainer XEmbeddedScripts.getBasicLibraries();
XStorageBasedLibraryContainer XEmbeddedScripts.getDialogLibraries();


Can we get an XFrame or XController from XStorageBasedLibraryContainer?
Well, here I got quite lost in the inheritance hierarchy, but I think we
can't. :-(


Regards,
Ariel.




--
Ariel Constenla-Haile
La Plata, Argentina

[EMAIL PROTECTED]
[EMAIL PROTECTED]

http://www.ArielConstenlaHaile.com.ar/ooo/



"Aus der Kriegsschule des Lebens
                - Was mich nicht umbringt,
        macht mich härter."
                Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to