// adding relation for XSubmit
XControlModel the_Model = shape2.getControl();
XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
XControlAccess.class,
xTextDoc.getCurrentController());
XControl cntrl = null;
//now get the OEditControl
try {
cntrl = the_access.getControl(the_Model);
log.println(cntrl.getClass().getName());
} catch (com.sun.star.container.NoSuchElementException e) {
log.println("Couldn't get OEditControl");
e.printStackTrace(log);
throw new StatusException("Couldn't get OEditControl", e);
}