Re: [api-dev] Question about XEventListener activation

2008-04-20 Thread Ariel Constenla-Haile

Hi Giuseppe,

Giuseppe Castagno wrote:

Hi all,

I implemented a Java component, embedded in an extension, which exports a
single "com.sun.star.frame.ProtocolHandler" service.

Through the protocol URL, its com.sun.star.frame.XDispatch:dispatch()
method is bound to a submenu item.

I have an XEventListener which should be fired on "OnLoad" event.

But the com.sun.star.lang.XInitialization:initialize() method of the
component, in which the XEventListener is activated, is called when the
menu is displayed the first time.

That means that the event is intercepted only from that moment onward,
that is, after the menu is displayed the first time.

I need to have the XEventListener ready to fire up whenever OOo loads a
document, even if the doc is passed to OOo directly on start line (e.g.
with the command: soffice mydoc.odt).

Is there a way to implement this in a ProtocolHandler or do I need to
implement another service in the component besides ProtocolHandler?

Would a job be suitable, for example?


yes, you have to implement two components in your JAR: the 
ProtocolHandler and a Job.


If you want your Job to do its job every time a docs is openend, 
Configure your Job so that it gets instantiated OnLoad and OnNew.
There is also the undocumented "OnLoadFinished", see this mail and 
browse the thread for more info:


http://extensions.openoffice.org/servlets/ReadMsg?list=dev&msgNo=1030

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]



[api-dev] XEnhancedMouseClickHandler and Keymodifiers

2008-04-20 Thread Dietmar Hiller
Hallo,

my application implements a XEnhancedMouseClickHandler. I react on the
mouse released event that gives me also
com.sun.star.awt.EnhancedMouseEvent e.
I thought, I could read the e.Modifiers, to see, if a shift/alt/ctrl key
was pressed while the mouse button was released. But the value is always
0.
Is there a way to get those modifiers?
-- 
Dietmar
---
Fatti non fummo per viver come bruti, ma per seguir virtute e conoscenza
(Dante)


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



[api-dev] Question about XEventListener activation

2008-04-20 Thread Giuseppe Castagno

Hi all,

I implemented a Java component, embedded in an extension, which exports a
single "com.sun.star.frame.ProtocolHandler" service.

Through the protocol URL, its com.sun.star.frame.XDispatch:dispatch()
method is bound to a submenu item.

I have an XEventListener which should be fired on "OnLoad" event.

But the com.sun.star.lang.XInitialization:initialize() method of the
component, in which the XEventListener is activated, is called when the
menu is displayed the first time.

That means that the event is intercepted only from that moment onward,
that is, after the menu is displayed the first time.

I need to have the XEventListener ready to fire up whenever OOo loads a
document, even if the doc is passed to OOo directly on start line (e.g.
with the command: soffice mydoc.odt).

Is there a way to implement this in a ProtocolHandler or do I need to
implement another service in the component besides ProtocolHandler?

Would a job be suitable, for example?

Thanks.

--
Kind Regards,
Giuseppe Castagno
Acca Esse http://www.acca-esse.eu
[EMAIL PROTECTED]
[EMAIL PROTECTED]






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