Re: Registration of an accelerator at extension installation
Hi Amenel, > Your first recommendation, i.e. XJobExecutor + Accelerators.xcu was ineffective for the command > attached to opening that >main dialog window. I don't know why, since the protocol handler was > instantiated! I ended up removing the XJobExecutor > interface, its method, and the Accelerators.xcu file. Have you tried the "Accelerators.xcu" with a known ".uno" command for testing purpose? Did it work? I have an extension where i use XJobExecutor and Accelerators.xcu without XJob. The extension gets instantiated at the time i use the accelerator key. The "service:xxx" url should do this. Regards Oliver - To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org For additional commands, e-mail: api-h...@openoffice.apache.org
Re: Registration of an accelerator at extension installation
Hi Oliver, Thank you for you help: I have succeeded in my goal, which was to make it possible to open, using an accelerator, the main window of an extension right after installation of the extension. Basically, I had to provoke the instantiation of the extension, using your second recommendation, i.e. XJob + custom service + Jobs.xcu. In the execute function of the XJob interface, I installed the desired accelerator into the global accelerator configuration. Your first recommendation, i.e. XJobExecutor + Accelerators.xcu was ineffective for the command attached to opening that main dialog window. I don't know why, since the protocol handler was instantiated! I ended up removing the XJobExecutor interface, its method, and the Accelerators.xcu file. Lessons learned: the instantiation at startup is necessary, and the programmatic accelerator configuration is also necessary. Thanks. De : Oliver Brinzing À : api@openoffice.apache.org Envoyé le : Mercredi 24 juin 2015 20h29 Objet : Re: Registration of an accelerator at extension installation Hi Amenel, you can use an Accelerators.xcu file in you extension, for example: [...] service:my.extension.Service?myParam1 and register it during extension installation, for example add to the manifest.xml of your extension. your service has to implement the "com.sun.star.task.XJobExecutor" Interface with the trigger(string Event ) method. if you want your extension being instantiated during aoo startup, implement the "com.sun.star.task.XJob Interface" with it's execute(NamedValue[] args) method. add a Jobs.xcu, for example: https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Jobs/Configuration http://openoffice.org/2001/registry"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> my.extension.Service and register in "manifest.xml" Regards Oliver - To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org For additional commands, e-mail: api-h...@openoffice.apache.org
Re: Registration of an accelerator at extension installation
Hi Amenel, you can use an Accelerators.xcu file in you extension, for example: [...] service:my.extension.Service?myParam1 and register it during extension installation, for example add to the manifest.xml of your extension. your service has to implement the "com.sun.star.task.XJobExecutor" Interface with the trigger(string Event ) method. if you want your extension being instantiated during aoo startup, implement the "com.sun.star.task.XJob Interface" with it's execute(NamedValue[] args) method. add a Jobs.xcu, for example: https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Jobs/Configuration xmlns:oor="http://openoffice.org/2001/registry"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> my.extension.Service and register in "manifest.xml" manifest:media-type="application/vnd.sun.star.configuration-data" /> Regards Oliver - To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org For additional commands, e-mail: api-h...@openoffice.apache.org
Registration of an accelerator at extension installation
Hi, Thanks to a recent post to this mailing list, I have been able to bind a shortcut key, a.k.a accelerator, to a command of my extension. However, I am facing the problem that the accelerator becomes active only when the main window of the extension is opened or put differently, when the extension is instantiated. Since the role of the accelerator is to open that very window, something feels missing here. I'm wondering whether there is a post-installation hook for extensions that I could exploit and in which I would register the accelerator to the global configuration? Note that this is different from what Jörg Schmidt wrote on 2015-06-17 because unless the extension has been opened by the user, the accelerator won't be registered: restarting AOO several times is useless in this context if the extension hasn't been launched. Thank you.