Hi ML,
in Java I try to get access to the file menu during runtime.
Now I am
able to create a new menu, but I don't get access the file
menu to be
able to change it, see comments
-----%<-----
com.sun.star.ui.XUIElement myMenubar =
xLayoutManager.getElement("private:resource/menubar/m
enubar");
XUIElementSettings xoMenuBarSettings = (XUIElementSettings)
UnoRuntime
.queryInterface(XUIElementSettings.class,
myMenubar);
XIndexContainer oMenuBarSettings = (XIndexContainer)
UnoRuntime
.queryInterface(XIndexContainer.class,
xoMenuBarSettings
.getSettings(true));
// Returns an Object - seems to be correct
Object oDateiMenuSettings = oMenuBarSettings.getByIndex(0);
// Returns null! Why?
XIndexContainer xoDateiMenuSettings = (XIndexContainer)
UnoRuntime.queryInterface(XIndexContainer.class,
oMenuBarSettings.getByIndex(0));
-----%<-----
The last cast seems to be the problem. Did I try to cast to
the wrong type?
Can you tell me how to rename a single item of the file
menu?
Greetings, Tobias
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|