Hi,

really thank you for the explanation. But for now, i wouldnt like to care
with the those bugs you explain ( but those tricks are really helpfull in
the future, thanks ). So lets forget those tricks for now, and get some
concentration just to make something working.

I have some questions, hope you will not considered they us much naive:

 - To add a context menu interceptor, since this topic is an Addon section
on the developers guide, i guess it could be done by creating a project open
office addon on netbeans. But when we do it, it obligates us to choose
between a menu ou toolbar addon, and what i would like to do is a context
menu. How is suppose we should do it?

- On the developers guide, they talk about a xml describing the menus for
the menu and the toolbar, but nothing about the context menu. Doesnt we need
that too? (i see somehting in the link of an email you replied)

- i already tried the client application of the book, but it does not work,
because it hasnt a main method. What should the main method do? Instantiate
the class that implements the context menu interceptor? I havent understood
how to make the connection between the extension and the interceptor class.

Hope this are normal questions. I already read the developers guide, at
least the main topics to do that, but dont understand how to put it all
together.

Thank you a lot,

Joel Filipe Antunes Cordeiro
[EMAIL PROTECTED]
[EMAIL PROTECTED]


On Wed, Sep 17, 2008 at 7:25 PM, Ariel Constenla-Haile <
[EMAIL PROTECTED]> wrote:

> Hi Joel,
>
> Joel Cordeiro escribió:
>
>> Thank you for the aknowledge.
>>
>> As i know, i dont need to write a Uno Component, since my extension just
>> adds some entries to the context menu, and make some access to the
>> OpenThesaurus service.
>>
>
> that's why you *need* a Uno component implementing a css.task.Job [sorry
> if I was rather cryptic in my previous mail]
>
> (specification:
> http://api.openoffice.org/docs/common/ref/com/sun/star/task/Job.html
> documentation:
>
> http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Jobs/Implementation
> )
>
> If you don't need an extension, let's say you want it for yourself, in
> your own and only PC, you may achieve this even with OOo Basic adding a
> macro with the menu "Tools" - "Customize" - "Events".
>
> But if you want an extension, you must use a language which is able to
> implement Uno components (C++/Java/Python).
>
> Why?
>
> You know that in order to add menu entries in a context menu, you need
> to register a css.ui.XContextMenuInterceptor at the
> css.frame.Controller's css.ui.XContextMenuInterception.
> Besides, I guess you want to add this menu entries to *every* OOo Writer
> document, and in every "context" where it makes sense to add these
> entries (I mean, you don't want to add some entry bringing some
> thesaurus feature when the user right-clicks a picture, or a form
> control in design view)
>
> So you need first a way to access the Controller of every Writer
> document, every time the user creates a new document, or opens an
> existing one.
>
> How can your extension know when a new document is created, or an
> existing one is loaded?
> By registering a Job that will be executed upon this events:
>
> * OnNew = a new documented is created
> * OnLoad = a documented is loaded
>
> This is clear by the Job definition:
>
> "A job in OpenOffice.org is a UNO component that can be executed by the
> job execution environment upon an event."
>
> this means that every time a doc. is created, or loaded, the application
> framework will invoke your UNO component's execute()
> [
> http://api.openoffice.org/docs/common/ref/com/sun/star/task/XJob.html#execute
> ]
> method.
>
> In the case your Job is registered for the OnLoad / OnNew events, when
> the components's execute() methods is invoked you will get a reference
> to the document's model, and from this you can start working: access the
> Controller from the model with css.frame.XModel.getCurrentController() .
>
> But as the controller can be disposed, or the same model can have
> several controllers for different views, you need to do some extra work,
> as explained on my previous mail; if not, your context menu interceptor
> won't work in every context you'd really want it to; and your user may
> find very annoying that your extensions sometimes works but other times
> not.
>
>
>  So my problem is just deploying it and make it
>> working as an extension for the extension manager of Open Office.
>>
>
>
> you can try the NetBeans IDE plug-in; it's both user-friendly (that is,
> with easy-to-use wizards) and very complete; it can ease your work a
> lot, if you first study how to use it.
> I suggest you to try with the option "Debug Extension in Target
> openOffice.org", and set breakpoint in your code.
>
> You can try first by creating a client application with the SDK context
> menu interceptor example.
>
>
>
> 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