XToolkit the_kit = null;
XDevice aDevice = null;
XGraphics aGraphic = null;
//Insert a ControlShape and get the ControlModel
XControlShape aShape = FormTools.createControlShape(xTextDoc, 5000,
7000, 2000, 2000,
"GroupBox");
WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
XControlModel the_Model = aShape.getControl();
XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
4500, 5000, 10000,
"TextField");
WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
XControlModel the_Model2 = aShape2.getControl();
//Try to query XControlAccess
XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
XControlAccess.class,
xTextDoc.getCurrentController());