Hello Joel,

Joel Cordeiro escribió:
Hi,

i'm having some problems implementing a addon for the open office. I wish to add some menu entries to the context menu. At this time i'm just trying to run the example gived on the developers guide. I put the code in a jar, with an ant build gived too in the same guide, and added to the extension manager, but nothing happens. Could anyone tell me the main steps to do something like that?

your first error is that this example is a *client* application, not an
extension.

The Ant i'm using is the one at the page 37 of the Developers Guide.
The example code for add menu entries to the context menu, i'm using is the one at the page 320 of the developers guide.
I put in attach the jar i got.

Besides, the example in the Developer's Guide is too naive: if you try
the example, you can test by choosing the "Page Preview" on the "File"
menu, then close this preview and come back to the normal view: your
interceptor has then disappeared. The reason is that the Controller was
disposed, so you need to register your interceptor again.
Other problem you'll find is that when the user chooses the menu "Window" - "New window" (in this new view your interceptor won't work automatically)

So for an extension wanting to add entries on every - let's - say OOo
Writer document context menu, the starting point will be a Uno component
implementing a css.task.Job
(OnLoadFinished/OnLoad + OnNew)

* register the interceptor at the XController
* add an XFrameActionListener at the XFrame
* add an XEventListener at the model's XEventBroadcaster and listen to
the event OnViewCreated

Some more comments on
http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=21148
[I've learn more since then, but may give you a hint about the work it
may take to make a context menu interceptor work in a real use case]

Could anyone help me?

no "helpful" help can be given if you don't know some basics first (one
of them is the basic difference between a client application, a uno
component, an extension)

If the lines above about the css.task.Job,
css.frame.XFrame/XFrameActionListener , etc was a foreign language for
you, then I'd suggest you
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OpenOffice.org_Developers_Guide

at least one should know
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/FirstSteps/First_Steps http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Writing_UNO_Components

http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Extensions/Extensions

http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Office_Development


Regards
Ariel.


--
Ariel Constenla-Haile
La Plata, Argentina

[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