|
List Info
Thread: Changing the menu bar only for a document
|
|
| Changing the menu bar only for a
document |

|
2007-10-06 15:17:10 |
Hi devs,
I have been experimenting with creating customized menu
items using the OOo
API. I've followed the good tutorials provided by Andrew
(using Basic) and
Kay (using Java) and the tests worked...
But I see the changes in the menu bar are not limited just
for the current
document but for all the documents open by the same OOo
instance.
So, my question is: Is there some way to modify the menu bar
only for a
single document?
Thanks in advance,
|
|
| Re: Changing the menu bar only for a
document |

|
2007-10-06 16:50:30 |
On 10/6/07, Jordi Sanchez wrote:
> Hi devs,
> So, my question is: Is there some way to modify the
menu bar only for a
> single document?
>
Hi,
this should be possible if you create your document using a
template.
In the template you can disable the menus using
tools->customize ,
save in "template file name". any documents
created using that
template will have your modified menu bar now.
ashok
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|
|
| Re: Changing the menu bar only for a
document |

|
2007-10-07 05:53:46 |
Thanks for your quick reply.
Meanwhile I was investigating a little bit and I realised
that the ODF
documents are able to store a set of custom settings per
document. If I
unzip, (for instance), a writer document we can see the
following structure:
(I customized the menubar with a new entry for the document
using
tools->customize)
Archive: /home/jordi/test.odt
extracting: mimetype
creating: Configurations2/statusbar/
inflating: Configurations2/accelerator/current.xml
creating: Configurations2/floater/
creating: Configurations2/popupmenu/
creating: Configurations2/progressbar/
inflating: Configurations2/menubar/menubar.xml
creating: Configurations2/toolbar/
creating: Configurations2/images/Bitmaps/
inflating: content.xml
inflating: styles.xml
inflating: meta.xml
inflating: Thumbnails/thumbnail.png
inflating: settings.xml
inflating: META-INF/manifest.xml
So, my next question is: How can I access (for
creating/updating) the
document-specific settings
(Configurations2/menubar/menubar.xml) using the
OOo API??
Regards,
2007/10/6, ashok _ <listmanster gmail.com>:
>
> On 10/6/07, Jordi Sanchez wrote:
> > Hi devs,
> > So, my question is: Is there some way to modify
the menu bar only for a
> > single document?
> >
>
>
> Hi,
>
> this should be possible if you create your document
using a template.
> In the template you can disable the menus using
tools->customize ,
> save in "template file name". any documents
created using that
> template will have your modified menu bar now.
>
> ashok
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
> For additional commands, e-mail: dev-help api.openoffice.org
>
>
|
|
| Re: Changing the menu bar only for a
document |

|
2007-10-08 03:25:18 |
Hi Jordi,
> So, my next question is: How can I access (for
creating/updating) the
> document-specific settings
(Configurations2/menubar/menubar.xml) using the
> OOo API??
I created a code snippet to change the menubar transient
(see
http://cod
esnippets.services.openoffice.org/Office/Office.RemoveIterat
iveAndTransientMenubarItems.snip)
You can also store the menu changes persistent. But I don't
know whether
there is a way to store the things in the document. It
shouldn't be a
big change.
Greetings, Tobias
>
> Regards,
>
>
> 2007/10/6, ashok _ <listmanster gmail.com>:
>> On 10/6/07, Jordi Sanchez wrote:
>>> Hi devs,
>>> So, my question is: Is there some way to modify
the menu bar only for a
>>> single document?
>>>
>>
>> Hi,
>>
>> this should be possible if you create your document
using a template.
>> In the template you can disable the menus using
tools->customize ,
>> save in "template file name". any
documents created using that
>> template will have your modified menu bar now.
>>
>> ashok
>>
>>
------------------------------------------------------------
---------
>> To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
>> For additional commands, e-mail: dev-help api.openoffice.org
>>
>>
>
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|
|
| Re: Changing the menu bar only for a
document |

|
2007-10-08 04:08:44 |
Jordi Sanchez wrote:
> Thanks for your quick reply.
>
> Meanwhile I was investigating a little bit and I
realised that the ODF
> documents are able to store a set of custom settings
per document. If I
> unzip, (for instance), a writer document we can see the
following structure:
>
> (I customized the menubar with a new entry for the
document using
> tools->customize)
>
> Archive: /home/jordi/test.odt
> extracting: mimetype
> creating: Configurations2/statusbar/
> inflating: Configurations2/accelerator/current.xml
> creating: Configurations2/floater/
> creating: Configurations2/popupmenu/
> creating: Configurations2/progressbar/
> inflating: Configurations2/menubar/menubar.xml
> creating: Configurations2/toolbar/
> creating: Configurations2/images/Bitmaps/
> inflating: content.xml
> inflating: styles.xml
> inflating: meta.xml
> inflating: Thumbnails/thumbnail.png
> inflating: settings.xml
> inflating: META-INF/manifest.xml
>
> So, my next question is: How can I access (for
creating/updating) the
> document-specific settings
(Configurations2/menubar/menubar.xml) using the
> OOo API??
>
Hi Jordi,
you can retrieve the ui configuration manager from the model
of the
document. Just use the interface
com.sun.star.ui.XUIConfigurationManager
available at the model. As Tobias wrote you can find some
code snippets
which explains you how to use the ui configuration manager
to change the
menu bar. Please be aware that the document based ui
configuration
manager normally has no ui elements (getSettings will throw
an
exception). First you have to retrieve the menu bar settings
from the
module ui configuration manager and adapt it. Then you can
set it at the
document ui configuration manager. Don't forget to call
store() to make
your changes persistent.
Regards,
Carsten
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|
|
| Re: Changing the menu bar only for a
document |

|
2007-10-08 04:23:54 |
Ok, I'm going to try it using your directives and the code
snippet provided
by Tobias
Thank you both for your help.
2007/10/8, Carsten Driesner <carsten.driesner sun.com>:
>
> Jordi Sanchez wrote:
> > Thanks for your quick reply.
> >
> > Meanwhile I was investigating a little bit and I
realised that the ODF
> > documents are able to store a set of custom
settings per document. If I
> > unzip, (for instance), a writer document we can
see the following
> structure:
> >
> > (I customized the menubar with a new entry for the
document using
> > tools->customize)
> >
> > Archive: /home/jordi/test.odt
> > extracting: mimetype
> > creating: Configurations2/statusbar/
> > inflating:
Configurations2/accelerator/current.xml
> > creating: Configurations2/floater/
> > creating: Configurations2/popupmenu/
> > creating: Configurations2/progressbar/
> > inflating: Configurations2/menubar/menubar.xml
> > creating: Configurations2/toolbar/
> > creating: Configurations2/images/Bitmaps/
> > inflating: content.xml
> > inflating: styles.xml
> > inflating: meta.xml
> > inflating: Thumbnails/thumbnail.png
> > inflating: settings.xml
> > inflating: META-INF/manifest.xml
> >
> > So, my next question is: How can I access (for
creating/updating) the
> > document-specific settings
(Configurations2/menubar/menubar.xml) using
> the
> > OOo API??
> >
> Hi Jordi,
>
> you can retrieve the ui configuration manager from the
model of the
> document. Just use the interface
com.sun.star.ui.XUIConfigurationManager
> available at the model. As Tobias wrote you can find
some code snippets
> which explains you how to use the ui configuration
manager to change the
> menu bar. Please be aware that the document based ui
configuration
> manager normally has no ui elements (getSettings will
throw an
> exception). First you have to retrieve the menu bar
settings from the
> module ui configuration manager and adapt it. Then you
can set it at the
> document ui configuration manager. Don't forget to call
store() to make
> your changes persistent.
>
> Regards,
> Carsten
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
> For additional commands, e-mail: dev-help api.openoffice.org
>
>
|
|
[1-6]
|
|