2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 import com
.sun
.star
.drawing
.XControlShape
;
21 import com
.sun
.star
.text
.XTextDocument
;
22 import com
.sun
.star
.uno
.XInterface
;
24 import java
.io
.PrintWriter
;
26 import lib
.StatusException
;
28 import lib
.TestEnvironment
;
29 import lib
.TestParameters
;
31 import util
.FormTools
;
32 import util
.WriterTools
;
36 public class TabControllerModel
extends TestCase
{
37 private static XTextDocument xTextDoc
;
40 protected void initialize(TestParameters param
, PrintWriter log
) {
42 log
.println("creating a textdocument");
43 xTextDoc
= WriterTools
.createTextDoc(
45 } catch (Exception e
) {
46 e
.printStackTrace(log
);
47 throw new StatusException("Couldn't create document", e
);
52 protected void cleanup(TestParameters param
, PrintWriter log
) {
53 log
.println("disposing xTextDoc");
54 util
.DesktopTools
.closeDoc(xTextDoc
);
58 public TestEnvironment
createTestEnvironment(TestParameters param
,
60 XInterface oObj
= null;
62 log
.println("inserting some ControlShapes");
64 XControlShape shape1
= FormTools
.createControlShape(xTextDoc
, 3000,
67 XControlShape shape2
= FormTools
.createControlShape(xTextDoc
, 5000,
72 oObj
= (XInterface
) param
.getMSF().createInstance(
73 "com.sun.star.awt.TabControllerModel");
74 } catch (Exception e
) {
75 e
.printStackTrace(log
);
76 throw new StatusException("Couldn't create " +
77 "TabControllerModel", e
);
80 log
.println("creating a new environment for TabControllerModel");
82 TestEnvironment tEnv
= new TestEnvironment(oObj
);
84 tEnv
.addObjRelation("OBJNAME",
85 "stardiv.vcl.controlmodel.TabController");
86 tEnv
.addObjRelation("Model1", shape1
.getControl());
87 tEnv
.addObjRelation("Model2", shape2
.getControl());
90 //Object Relation for XPersistObject
91 tEnv
.addObjRelation("noPS", Boolean
.TRUE
);
93 System
.out
.println("ImplementationName: " + utils
.getImplName(oObj
));
96 } // finish method getTestEnvironment
97 } // finish class TabControllerModel