I'm currently programming an extension for AOO 4.1.2 on Windows 7 in Java.
As I found that many of you post answers in StarBasic (or Basic) to Java related questions I would like to state that I HAVE TO program in Java and that an only-macro-based-solution is not allowed (in my company).
So please only answer if you can avoid Basic-Code I would greatly appreciate it!
Now my problem:
I created an OptionPage for my extension which functions fine (FINALLY). There are 3 TextFields and a Button in the OptionDialog. When the Button is pressed, the values from the TextFields should be given to another method in Java.
I already tried this approach in the Action Listener Implementation for the Button (in the method "actionPerformed"):
Code: Select all
Object textObject = _xControlCont.getControl("TextField1");
XTextField text = (XTextField) UnoRuntime.queryInterface(XTextField.class, textObject);
I'll also add that I tried this conversion for a label with the interface "XFixedText" and it functions totally fine and behaves normally.
Do I have to use another interface? Have I forgotten something? Is the object not the right conversion-parameter?
I'm also fairly new to Java and the UNO-API confuses the living hell out of me...
If you have any idea on how to handle the object I'd really appreciate any input...thanks in advance
EDIT: I also want to add that I based my Java code loosely on this tutorial: https://wiki.openoffice.org/wiki/Docume ... at_Runtime