openoffice-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amenel VOGLOZIN <>
Subject Re: [EXTENSIONS] how is the extension constructor called
Date Tue, 30 Sep 2014 13:39:30 GMT
Hi Carl,
I don't know whether it was intended behavior or not. I have ran into this problem in an extension
that I started writing in May or June and it was an issue in that the constructor was called
about as many times as i opened the menu.

I posted a message similar to yours to this mailing list and Ariel gave me a solution which
was to use a singleton. As a result, I moved the construction code, and handlers, and event
listeners, and most of my code actually, into a helper class which implemented a Singleton
pattern. From then on, things went smoothly, with the notable exception that the application
exit event is posted as many times as there are frames opened. A specific boolean variable
can guard a code section so no problem there either.

You might want to search the archives for Ariel's reply to my message.

Le Dimanche 28 septembre 2014 20h36, Carl Marcum <> a écrit :

Hi All,

I was checking in to a new issue opened on the netbeans plugin. [1]

For every menu item for the AddOn in the current context (ex Writer), 
the constructor is called then the Menu is first clicked.
If there are 2 menu items the constructor is ran twice.
This only happens on the first time per context opened.

Is this expected behavior?



To unsubscribe, e-mail:
For additional commands, e-mail:
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message