protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
XInterface oObj = null;
Object anotherCtrl = null ;
XWindowPeer the_win = null;
XToolkit the_kit = null;
XDevice aDevice = null;
XGraphics aGraphic = null;
//Insert a ControlShape and get the ControlModel
XControlShape aShape = FormTools.createControlShape(
xTextDoc,3000,4500,15000,10000,"ListBox");
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());
//now get the OListBoxControl
try {
oObj = the_access.getControl(the_Model);
anotherCtrl = the_access.getControl(the_Model2);
the_win = the_access.getControl(the_Model).getPeer();
the_kit = the_win.getToolkit();
aDevice = the_kit.createScreenCompatibleDevice(200,200);
aGraphic = aDevice.createGraphics();
} catch (Exception e) {
log.println("Couldn't get OListBoxControl");
e.printStackTrace(log);
throw new StatusException("Couldn't get OListBoxControl", e );
}