List Info

Thread: Java: Getting Access to a menu in menubar




Java: Getting Access to a menu in menubar
user name
2006-02-20 13:45:22
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-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )