Re: Are there changes to the resourceURL 's ?
Fernand Vanrie <[email protected]> Wed, 22 Dec 2010 10:25:14 +0100
| Newsgroups | gmane.comp.openoffice.devel.api |
|---|---|
| Message-ID | <[email protected]> |
Ariel ,
Thanks for this extended explaination, now i now where to look and go.
But no the namings are correct, and the relevant to the xml files in the
places you told.
the code start with making a emnumration for the resourceURL's par module:
For Each x in oFrame.LayoutManager.getElements()>> gives me all the correct ResourceURL's
then is choose manualy the right one, in my case "private:resource/toolbar/standardbar"
then i follow the code and
oToolbarSettings = oCfgManager.getSettings("private:resource/toolbar/standardbar", true)
gives me the error that there is no such element in the container ??
so what is the resourceURL for oCfgManager.getSettings( "private:resource/toolbar/standardbar" , true)
the DEVguide says:
a resource URL which identifies the user interface element. A resourcce URL must
meet the following syntax: "private:resource/$type/$name. It is only allowed to
use ascii characters for type and name.
here $type = "toolbar" and $name = "standardbar"
smiles like a bug (i run OOO330m17 on Windows)
Fernand
> Hello Fernand,
>
> On Tuesday 21 December 2010, 16:42, Fernand Vanrie wrote:
>> Ariel ,
>>
>> Stupit me :-)
>>
>> not a typo, just the wrong copy of one of my tests
>> The problem is still there
>>
>> oFrame = oDoc.getCurrentController().getFrame()
>> oCfgManager = oDoc.getUIConfigurationManager()
>> oToolInfo = oCfgManager.getUIElementsInfo( iToolType )
>> sToolbar = "private:resource/toolbar/standardbar"
>> For Each x in oFrame.LayoutManager.getElements()
>> if x.ResourceURL = sToolBar Then
>>
>> rem the Resource is here
>>
>> oImageMgr = oCfgManager.getImageManager()
>> oToolbarSettings = oCfgManager.getSettings(sToolbar, true)
>>
>> but no settings for "private:resource/toolbar/standardbar"
>> i get a error error: com.sun.star.container.NosuchElement exception
>> when not starting with "private:resource/toolbar/" then is get a
>> iIlegalArgumentexception so it must start with private:resource/toolbar/
>> but why is "standardbar" not present ??
> you can not take for granted that the standard toolbar is named standardbar in
> every module.
> For example, in OOo Base it's named toolbar
>
>
>> where can i find the right resourceURL's ?
> you have to look at the basis layer of your office installation:
> <ROOT>/openoffice.org/basis3.4/share/config/soffice.cfg/modules/
> there you have a folder for each module.
> Inside every folder, you have another folder for each UIElelemt type (well,
> only menubar, statusbar and toolbar at the moment).
>
> For example,
> <ROOT>/openoffice.org/basis3.4/share/config/soffice.cfg/modules/dbapp/toolbar/toolbar.xml
> has for resource URL "private:resource/toolbar/toolbar"
> The resource URL is formed following the pattern
> private:resource/TYPE/file_name_no_xml_extension
>
> Another example:
> <ROOT>/openoffice.org/basis3.4/share/config/soffice.cfg/modules/dbapp/toolbar/reportobjectbar.xml
> is "private:resource/toolbar/reportobjectbar"
>
>
> Regards