summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/mod/_toolkit
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/tests/java/mod/_toolkit')
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java246
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java261
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java246
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownComboBox.java139
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java154
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java235
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java209
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleList.java237
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java250
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java241
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java196
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java156
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java203
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java170
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java230
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java310
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleScrollBar.java186
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBar.java182
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBarItem.java197
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java282
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java292
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java188
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleToolBoxItem.java207
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleWindow.java207
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/MutableTreeDataModel.java105
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java191
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/TabController.java143
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/TabControllerModel.java105
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/Toolkit.java142
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java156
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlButtonModel.java87
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java164
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBoxModel.java87
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java160
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlComboBoxModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java252
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlContainerModel.java66
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java162
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyFieldModel.java85
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java166
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlDateFieldModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlDialog.java254
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java189
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java161
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlEditModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java162
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFileControlModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFixedLineModel.java97
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java152
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFixedTextModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java167
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedFieldModel.java85
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java151
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBoxModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java160
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlImageControlModel.java62
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java161
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlListBoxModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java171
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlNumericFieldModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java162
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlPatternFieldModel.java62
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlProgressBarModel.java94
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java152
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButtonModel.java62
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlScrollBarModel.java97
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java162
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlTimeFieldModel.java62
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoScrollBarControl.java179
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControl.java149
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControlModel.java69
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java303
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoTreeModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/package.html6
74 files changed, 11582 insertions, 0 deletions
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java
new file mode 100644
index 000000000000..1e9c0cbb69b0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java
@@ -0,0 +1,246 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleText;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleValue
+ * @see ifc.accessibility._XAccessibleAction
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleText
+ */
+public class AccessibleButton extends lib.TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+
+ /**
+ * Opens 'Printer Settings' dialog using document dispatch provider
+ * running in a separate thread. Finds active top window (the dialog
+ * window) and finds accessible button 'OK' walking through the
+ * accessible component tree.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XMultiServiceFactory msf = (XMultiServiceFactory) Param.getMSF();
+
+ try {
+ oObj = (XInterface) msf.createInstance("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ DiagThread psDiag = new DiagThread(xTextDoc, msf);
+ psDiag.start();
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ Object atw = tk.getActiveTopWindow();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ atw);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON,
+ "Cancel");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ System.out.println("Grabbing focus ... ");
+ acomp.grabFocus();
+ }
+ });
+
+ XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface(
+ XAccessibleText.class, oObj);
+
+ tEnv.addObjRelation("XAccessibleText.Text", text.getText());
+
+ tEnv.addObjRelation("EditOnly",
+ "This method isn't supported in this component");
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ return tEnv;
+ }
+
+ /**
+ * Closes the dialog using accessible button 'OK' found in
+ * <code>createTestEnvironment()</code>.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Couldn't close dialog");
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Dialog already disposed");
+ }
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Opens new writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+
+ /**
+ * Thread for opening modal dialog 'Print Settings'.
+ */
+ public class DiagThread extends Thread {
+ public XTextDocument xTextDoc = null;
+ public XMultiServiceFactory msf = null;
+
+ public DiagThread(XTextDocument xTextDoc, XMultiServiceFactory msf) {
+ this.xTextDoc = xTextDoc;
+ this.msf = msf;
+ }
+
+ public void run() {
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController xController = aModel.getCurrentController();
+
+ //Opening PrinterSetupDialog
+ try {
+ String aSlotID = ".uno:Zoom";
+ XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class,
+ msf.createInstance(
+ "com.sun.star.util.URLTransformer"));
+
+ // Because it's an in/out parameter
+ // we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = aSlotID;
+ xParser.parseStrict(aParseURL);
+
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+
+ if (xDispatcher != null) {
+ xDispatcher.dispatch(aURL, null);
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't open dialog");
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java
new file mode 100644
index 000000000000..2ae69a72c246
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java
@@ -0,0 +1,261 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleText;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by accessible compoent of
+ * check box in 'InsertTable' dialog. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleValue
+ * @see ifc.accessibility._XAccessibleAction
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleText
+ */
+public class AccessibleCheckBox extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+ private static DiagThread psDiag = null;
+
+ /**
+ * Opens 'Insert Table' dialog using document dispatch provider
+ * running in a separate thread. Finds active top window (the dialog
+ * window) and finds first accessible check box walking through the
+ * accessible component tree.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XMultiServiceFactory msf = (XMultiServiceFactory) Param.getMSF();
+ log.println("Creating text document");
+
+ if (xTextDoc == null) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(msf);
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ XInterface oObj = null;
+
+ log.println("getting toolkit");
+
+ try {
+ oObj = (XInterface) msf.createInstance("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ log.println("Opening Dialog in second thread");
+
+ psDiag = new DiagThread(xTextDoc, msf);
+ psDiag.start();
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ log.println("Getting the active TopWindow");
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON,
+ "Cancel");
+
+ action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.CHECK_BOX);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ System.out.println("Grabbing focus ... ");
+ acomp.grabFocus();
+ }
+ });
+
+ XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface(
+ XAccessibleText.class, oObj);
+
+ tEnv.addObjRelation("XAccessibleText.Text", text.getText());
+
+ tEnv.addObjRelation("EditOnly",
+ "This method isn't supported in this component");
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ return tEnv;
+ }
+
+ /**
+ * Closes the dialog using accessible button 'Cancel' found in
+ * <code>createTestEnvironment()</code>.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ try {
+ log.println("closing dialog");
+ action.doAccessibleAction(0);
+ log.println("interrupting corresponding Thread");
+ psDiag.interrupt();
+ log.println("closing the document");
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ log.println("reinitialize the variable");
+ xTextDoc = null;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Couldn't close dialog");
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Dialog already disposed");
+ }
+ }
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ }
+
+ /**
+ * Thread for opening modal dialog 'Insert Table'.
+ */
+ public class DiagThread extends Thread {
+ public XTextDocument xTextDoc = null;
+ public XMultiServiceFactory msf = null;
+
+ public DiagThread(XTextDocument xTextDoc, XMultiServiceFactory msf) {
+ this.xTextDoc = xTextDoc;
+ this.msf = msf;
+ }
+
+ public void run() {
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController xController = aModel.getCurrentController();
+
+ //Opening PrinterSetupDialog
+ try {
+ String aSlotID = ".uno:InsertTable";
+ XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class,
+ msf.createInstance(
+ "com.sun.star.util.URLTransformer"));
+
+ // Because it's an in/out parameter we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = aSlotID;
+ xParser.parseStrict(aParseURL);
+
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+
+ if (xDispatcher != null) {
+ xDispatcher.dispatch(aURL, null);
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't open dialog");
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java
new file mode 100644
index 000000000000..97879627d25d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java
@@ -0,0 +1,246 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleSelection;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by accessible component
+ * of the 'Font' combo box in Format->Character... dislog box. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleComboBox extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+
+ /**
+ * Opens CharacterStyle dialog and
+ * finds AccessibleComboBox walking through the
+ * accessible component tree.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ DiagThread psDiag = new DiagThread(xTextDoc,
+ (XMultiServiceFactory) Param.getMSF());
+ psDiag.start();
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ Object atw = tk.getActiveTopWindow();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ atw);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON,
+ "Cancel");
+ action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PAGE_TAB_LIST);
+
+ XAccessibleSelection xAccSel = (XAccessibleSelection) UnoRuntime.queryInterface(
+ XAccessibleSelection.class,
+ oObj);
+
+ try {
+ xAccSel.selectAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ }
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL, "",
+ "AccessibleComboBox");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+ final XAccessibleComponent acomp1 = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ action);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acomp1.grabFocus();
+ acomp.grabFocus();
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Closes the dialog using accessible button 'Cancel' found in
+ * <code>createTestEnvironment()</code>.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println(" closing dialog ");
+
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Couldn't close dialog");
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Dialog already disposed");
+ }
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Creates writer doc
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+
+ /**
+ * Thread for opening modal dialog 'Character style'.
+ */
+ public class DiagThread extends Thread {
+ public XTextDocument xTextDoc = null;
+ public XMultiServiceFactory msf = null;
+
+ public DiagThread(XTextDocument xTextDoc, XMultiServiceFactory msf) {
+ this.xTextDoc = xTextDoc;
+ this.msf = msf;
+ }
+
+ public void run() {
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController xController = aModel.getCurrentController();
+
+ //Opening PrinterSetupDialog
+ try {
+ String aSlotID = ".uno:FontDialog";
+ XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class,
+ msf.createInstance(
+ "com.sun.star.util.URLTransformer"));
+
+ // Because it's an in/out parameter we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = aSlotID;
+ xParser.parseStrict(aParseURL);
+
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+
+ if (xDispatcher != null) {
+ xDispatcher.dispatch(aURL, null);
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't open dialog");
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownComboBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownComboBox.java
new file mode 100644
index 000000000000..fee8473550e9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownComboBox.java
@@ -0,0 +1,139 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.awt.XWindow;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by accessible component
+ * of the URL locator combo box located in the left upper corner
+ * of a document. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleAction
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleDropDownComboBox extends TestCase {
+ private static XTextDocument xTextDoc = null;
+
+ /**
+ * Finds AccessibleDropDownComboBox walking through the
+ * accessible component tree of a writer document.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentContainerWindow(
+ (XMultiServiceFactory) Param.getMSF(),
+ xTextDoc);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.COMBO_BOX,
+ "", "AccessibleDropDownComboBox");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleAction editAction = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class,
+ oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ editAction.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Creates writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Disposes writer document.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java
new file mode 100644
index 000000000000..a42922a2f8f1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.awt.XWindow;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by style list box
+ * on toolbar of a document. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleAction
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleDropDownListBox extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+
+ /**
+ * Finds AccessibleDropDownListBox walking through the
+ * accessible component tree of a writer document.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(
+ (XMultiServiceFactory) Param.getMSF(),
+ xTextDoc);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.COMBO_BOX,
+ "", "AccessibleDropDownListBox");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleAction acomp = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ acomp.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ throw new StatusException("Can't perform action 0", e);
+ }
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Creates writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+ DesktopTools.dockStylist((XMultiServiceFactory) Param.getMSF());
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Disposes writer document.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java
new file mode 100644
index 000000000000..e26481176e1e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java
@@ -0,0 +1,235 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleEditableText;
+import com.sun.star.accessibility.XAccessibleText;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by edit field
+ * of 'Insert Hyperlink' dialog. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEditableText</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEditableText
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleEditableText
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleText
+ */
+public class AccessibleEdit extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+
+ /**
+ * Opens 'Insert Hyperlink' dialog using document dispatch provider.
+ * Finds active top window (the dialog
+ * window) and finds first accessible edit field and
+ * button 'Close' (for closing this dialog when disposing)
+ * walking through the accessible component tree.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XURLTransformer urlTransf = null;
+
+ try {
+ XInterface transf = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.util.URLTransformer");
+ urlTransf = (XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class, transf);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create URLTransformer", e);
+ }
+
+ XDispatch getting = null;
+ log.println("opening HyperlinkDialog");
+
+ URL[] url = new URL[1];
+ url[0] = new URL();
+ url[0].Complete = ".uno:HyperlinkDialog";
+ urlTransf.parseStrict(url);
+ getting = aProv.queryDispatch(url[0], "", 0);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(url[0], noArgs);
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON,
+ "Close");
+ action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TEXT);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleEditableText edText = (XAccessibleEditableText) UnoRuntime.queryInterface(
+ XAccessibleEditableText.class,
+ oObj);
+ edText.setText("AccessibleEdit");
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ // buttonAccComp.grabFocus();
+ // acomp.grabFocus();
+ edText.setText("firing event ...");
+ edText.setText("firing event ... 2");
+ edText.setText("AccessibleEdit");
+ }
+ });
+
+ XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface(
+ XAccessibleText.class, oObj);
+
+ tEnv.addObjRelation("XAccessibleText.Text", text.getText());
+
+ tEnv.addObjRelation("XAccessibleEditableText.hasAttr", Boolean.FALSE);
+
+ return tEnv;
+ }
+
+ /**
+ * Closes dialog using action of button 'Close'
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println(" Closing dialog ... ");
+
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Couldn't close dialog");
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Dialog already disposed");
+ }
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Creates writer document
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java
new file mode 100644
index 000000000000..3bc7e81885c3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java
@@ -0,0 +1,209 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleText;
+import com.sun.star.awt.PosSize;
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlContainer;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XFixedText;
+import com.sun.star.awt.XWindow;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by accesible component
+ * of the fixed text label in 'Hyperlink' Dialog. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleText
+ */
+public class AccessibleFixedText extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+ private static XWindow xWinDlg = null;
+
+ /**
+ * Creates a new dialog adds fixed text control to it and
+ * displays it. Then the text's accessible component is
+ * obtained.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory) Param.getMSF();
+ XControlModel dlgModel = null;
+
+ XControl txtControl = null;
+ XControlModel txtModel = null;
+
+ try {
+ dlgModel = (XControlModel) UnoRuntime.queryInterface(
+ XControlModel.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlDialogModel"));
+
+ XControl dlgControl = (XControl) UnoRuntime.queryInterface(
+ XControl.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlDialog"));
+
+ dlgControl.setModel(dlgModel);
+
+ txtModel = (XControlModel) UnoRuntime.queryInterface(
+ XControlModel.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlFixedTextModel"));
+
+ txtControl = (XControl) UnoRuntime.queryInterface(XControl.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlFixedText"));
+
+ txtControl.setModel(txtModel);
+
+ XFixedText xFT = (XFixedText) UnoRuntime.queryInterface(
+ XFixedText.class, txtControl);
+ xFT.setText("FxedText");
+
+ XControlContainer ctrlCont = (XControlContainer) UnoRuntime.queryInterface(
+ XControlContainer.class,
+ dlgControl);
+
+ ctrlCont.addControl("Text", txtControl);
+
+ xWinDlg = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ dlgControl);
+
+ xWinDlg.setVisible(true);
+
+ xWinDlg.setPosSize(0, 0, 200, 100, PosSize.SIZE);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Error creating dialog :");
+ e.printStackTrace(log);
+ }
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XAccessible xRoot = at.getAccessibleObject(xWinDlg);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.LABEL);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XWindow xWin = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ txtControl);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ xWin.setEnable(false);
+ xWin.setEnable(true);
+ }
+ });
+
+ XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface(
+ XAccessibleText.class, oObj);
+
+ tEnv.addObjRelation("XAccessibleText.Text", text.getText());
+
+ tEnv.addObjRelation("EditOnly",
+ "This method isn't supported in this component");
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ return tEnv;
+ }
+
+ /**
+ * Closes dialog using action of button 'Close'
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println(" Closing dialog ... ");
+ xWinDlg.dispose();
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java
new file mode 100644
index 000000000000..6fe2129995cc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java
@@ -0,0 +1,237 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleSelection;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+public class AccessibleList extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+ private static XMultiServiceFactory msf = null;
+
+ /**
+ * Opens 'Insert Hyperlink' dialog using document dispatch provider.
+ * Finds active top window (the dialog
+ * window) and finds button 'Close' (for closing this dialog when
+ * disposing) walking through the accessible component tree.
+ * Then the TREE component is found and the 'New Document' tab is
+ * selected to make list box visible. After that list box is obtained.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) msf.createInstance("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ shortWait();
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XURLTransformer urlTransf = null;
+
+ try {
+ XInterface transf = (XInterface) msf.createInstance(
+ "com.sun.star.util.URLTransformer");
+ urlTransf = (XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class, transf);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create URLTransformer", e);
+ }
+
+ XDispatch getting = null;
+ log.println("opening HyperlinkDialog");
+
+ URL[] url = new URL[1];
+ url[0] = new URL();
+ url[0].Complete = ".uno:HyperlinkDialog";
+ urlTransf.parseStrict(url);
+ getting = aProv.queryDispatch(url[0], "", 0);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(url[0], noArgs);
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ // obtaining 'Close' button
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON,
+ "Close");
+ action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ // Selecting 'New Document' tab
+ try {
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TREE);
+
+ XAccessibleSelection xAccSel = (XAccessibleSelection) UnoRuntime.queryInterface(
+ XAccessibleSelection.class,
+ oObj);
+ xAccSel.selectAccessibleChild(3);
+ shortWait();
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ throw new StatusException("Can't switch to required tab", e);
+ }
+
+ log.println("# Getting the ListBox");
+
+ XAccessibleContext parent = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PANEL,
+ "",
+ "com.sun.star.comp.toolkit.AccessibleListBox");
+
+ log.println("# Getting the first child");
+
+ try {
+ oObj = parent.getAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("XAccessibleSelection.multiSelection",
+ new Boolean(false));
+
+ final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+ final XAccessibleComponent acomp1 = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ action);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ System.out.println("Grabbing focus ... ");
+ acomp1.grabFocus();
+ acomp.grabFocus();
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Closes dialog using action of button 'Close'
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println(" Closing dialog ... ");
+
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Couldn't close dialog");
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Dialog already disposed");
+ }
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Creates writer document
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ msf = (XMultiServiceFactory) Param.getMSF();
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory(msf);
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java
new file mode 100644
index 000000000000..7b65e74152b1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java
@@ -0,0 +1,250 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleSelection;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented accessible component
+ * of 'File type' list box situated in 'Insert Hyperlink'
+ * dialog on tab 'New Document'. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleSelection</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleListBox extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+
+ /**
+ * Opens 'Insert Hyperlink' dialog using document dispatch provider.
+ * Finds active top window (the dialog
+ * window) and finds button 'Close' (for closing this dialog when
+ * disposing) walking through the accessible component tree.
+ * Then the TREE component is found and the 'New Document' tab is
+ * selected to make list box visible. After that list box is obtained.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ shortWait();
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XURLTransformer urlTransf = null;
+
+ try {
+ XInterface transf = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.util.URLTransformer");
+ urlTransf = (XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class, transf);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create URLTransformer", e);
+ }
+
+ XDispatch getting = null;
+ log.println("opening HyperlinkDialog");
+
+ URL[] url = new URL[1];
+ url[0] = new URL();
+ url[0].Complete = ".uno:HyperlinkDialog";
+ urlTransf.parseStrict(url);
+ getting = aProv.queryDispatch(url[0], "", 0);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(url[0], noArgs);
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+
+ // obtaining 'Close' button
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON,
+ "Close");
+ action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ // Selecting 'New Document' tab
+ try {
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TREE);
+
+ XAccessibleSelection xAccSel = (XAccessibleSelection) UnoRuntime.queryInterface(
+ XAccessibleSelection.class,
+ oObj);
+ xAccSel.selectAccessibleChild(3);
+ shortWait();
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ throw new StatusException("Can't switch to required tab", e);
+ }
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL, "",
+ "com.sun.star.comp.toolkit.AccessibleListBox");
+
+ Object list = at.getAccessibleObjectForRole(at.SearchedAccessible,
+ AccessibleRole.LIST);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ list);
+ final XAccessibleComponent acomp1 = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ action);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ System.out.println("Grabbing focus ... ");
+ acomp1.grabFocus();
+ acomp.grabFocus();
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Closes dialog using action of button 'Close'
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println(" Closing dialog ... ");
+
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Couldn't close dialog");
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Dialog already disposed");
+ }
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Creates writer document
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java
new file mode 100644
index 000000000000..ecbf43679ef8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java
@@ -0,0 +1,241 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleSelection;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented accessible component
+ * of 'File type' list box item situated in 'Insert Hyperlink'
+ * dialog on tab 'New Document'. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleText
+ */
+public class AccessibleListItem extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+
+ /**
+ * Opens 'Insert Hyperlink' dialog using document dispatch provider.
+ * Finds active top window (the dialog
+ * window) and finds button 'Close' (for closing this dialog when
+ * disposing) walking through the accessible component tree.
+ * Then the TREE component is found and the 'New Document' tab is
+ * selected to make list box visible. After that listbox item is obtained.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XMultiServiceFactory msf = (XMultiServiceFactory) Param.getMSF();
+
+ try {
+ oObj = (XInterface) msf.createInstance("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ shortWait();
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XURLTransformer urlTransf = null;
+
+ try {
+ XInterface transf = (XInterface) msf.createInstance(
+ "com.sun.star.util.URLTransformer");
+ urlTransf = (XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class, transf);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create URLTransformer", e);
+ }
+
+ XDispatch getting = null;
+ log.println("opening HyperlinkDialog");
+
+ URL[] url = new URL[1];
+ url[0] = new URL();
+ url[0].Complete = ".uno:HyperlinkDialog";
+ urlTransf.parseStrict(url);
+ getting = aProv.queryDispatch(url[0], "", 0);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(url[0], noArgs);
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ // obtaining 'Close' button
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON,
+ "Close");
+ action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ // Selecting 'New Document' tab
+ try {
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TREE);
+
+ XAccessibleSelection xAccSel = (XAccessibleSelection) UnoRuntime.queryInterface(
+ XAccessibleSelection.class,
+ oObj);
+ xAccSel.selectAccessibleChild(3);
+ shortWait();
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ throw new StatusException("Can't switch to required tab", e);
+ }
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.LIST_ITEM,"Spr");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EditOnly",
+ "This method isn't supported in this component");
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acomp.grabFocus();
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Closes dialog using action of button 'Close'
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println(" Closing dialog ... ");
+
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Couldn't close dialog");
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Dialog already disposed");
+ }
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Creates writer document
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java
new file mode 100644
index 000000000000..4eaec80dcd81
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java
@@ -0,0 +1,196 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleText;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented accessible component of
+ * main menu of a document. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleSelection</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleText</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleAction
+ * @see ifc.accessibility._XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleValue
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleText
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleMenu extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+
+ /**
+ * Finds accessible component with role <code>MENU</code>
+ * walking through the accessible component tree of a document.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XMultiServiceFactory msf = (XMultiServiceFactory) Param.getMSF();
+
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(msf);
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+
+ shortWait();
+
+ XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc).
+ getCurrentController().getFrame().getContainerWindow();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ XAccessibleContext menubar = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.MENU_BAR);
+ XInterface oObj = null;
+ Object menu2 = null;
+
+ try {
+ oObj = menubar.getAccessibleChild(2);
+ menu2 = menubar.getAccessibleChild(1);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleAction act1 = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+ final XAccessibleAction act2 = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, menu2);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ act2.doAccessibleAction(0);
+
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ }
+
+ act1.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+ }
+ });
+
+ XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface(
+ XAccessibleText.class, oObj);
+
+ tEnv.addObjRelation("XAccessibleText.Text", text.getText());
+
+ tEnv.addObjRelation("EditOnly", "Can't change or select Text in Menu");
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ tEnv.addObjRelation("XAccessibleSelection.OneAlwaysSelected",
+ new Boolean(false));
+
+ tEnv.addObjRelation("XAccessibleSelection.multiSelection",
+ new Boolean(false));
+
+ return tEnv;
+ }
+
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ try {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("Object already disposed");
+ }
+ }
+
+ /**
+ * Creates a new writer document
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java
new file mode 100644
index 000000000000..2441bdaa7075
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented accessible component of
+ * menu bar of a document. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleSelection</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleMenuBar extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+
+ /**
+ * Finds accessible component with role <code>MENUBAR</code>
+ * walking through the accessible component tree of a document.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc).
+ getCurrentController().getFrame().getContainerWindow();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ XInterface oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.MENU_BAR);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ System.out.println("Grabbing focus ... ");
+ acomp.grabFocus();
+ }
+ });
+
+ tEnv.addObjRelation("XAccessibleSelection.OneAlwaysSelected",
+ new Boolean(false));
+
+ tEnv.addObjRelation("XAccessibleSelection.multiSelection",
+ new Boolean(false));
+
+ return tEnv;
+ }
+
+ /**
+ * Creates writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Disposes document.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java
new file mode 100644
index 000000000000..a41abe45e520
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java
@@ -0,0 +1,203 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleText;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by accessible component
+ * of a menu item in main menu of a document. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleValue
+ * @see ifc.accessibility._XAccessibleAction
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleText
+ */
+public class AccessibleMenuItem extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+ private static XMultiServiceFactory msf = null;
+
+ /**
+ * Finds first accessible component with role <code>MENUITEM</code>
+ * walking through the accessible component tree of a document.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) msf.createInstance("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ Object atw = tk.getActiveTopWindow();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ atw);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ XAccessibleContext MenuBar = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.MENU_BAR);
+
+ try {
+ //activate Edit-Menu
+ XAccessible Menu = MenuBar.getAccessibleChild(1);
+ XAccessibleAction act = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, Menu);
+ act.doAccessibleAction(0);
+ shortWait();
+
+
+ //get a menue-item
+ oObj = Menu.getAccessibleContext().getAccessibleChild(11);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+
+
+ //oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.MENUITEM);
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleAction action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+ }
+ });
+
+ XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface(
+ XAccessibleText.class, oObj);
+
+ tEnv.addObjRelation("XAccessibleText.Text", text.getText());
+
+ tEnv.addObjRelation("EditOnly",
+ "Can't change or select Text in MenuBarItem");
+
+ tEnv.addObjRelation("Destroy", new Boolean(true));
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ return tEnv;
+ }
+
+ /**
+ * Creates writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ msf = (XMultiServiceFactory) Param.getMSF();
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory(msf);
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Disposes document.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java
new file mode 100644
index 000000000000..f05bcb025803
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java
@@ -0,0 +1,170 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by accessible component
+ * of a menu separator in main menu of a document. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleMenuSeparator extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+ private static XMultiServiceFactory msf = null;
+
+ /**
+ * Finds first accessible component with role <code>SEPARATOR</code>
+ * and implementation name <code>AccessibleMenuSeparator</code>
+ * walking through the accessible component tree of a document.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc).
+ getCurrentController().getFrame().getContainerWindow();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ XAccessibleContext MenuBar = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.MENU_BAR);
+ XAccessibleAction act = null;
+ XInterface oObj = null;
+
+ try {
+ //activate Edit-Menu
+ XAccessible Menu = MenuBar.getAccessibleChild(1);
+ act = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, Menu);
+ act.doAccessibleAction(0);
+
+ shortWait();
+
+
+ //get a menue-separator
+ oObj = Menu.getAccessibleContext().getAccessibleChild(3);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ }
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleAction aAct = act;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ aAct.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Creates writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ msf = (XMultiServiceFactory) Param.getMSF();
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory(msf);
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Disposes document.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java b/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java
new file mode 100644
index 000000000000..f4b292c84b23
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java
@@ -0,0 +1,230 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleSelection;
+import com.sun.star.awt.Point;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+public class AccessiblePopupMenu extends TestCase {
+ private static XDesktop the_Desk;
+ private static XTextDocument xTextDoc;
+ private static Point point;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+
+ log.println("release the popup menu");
+ try {
+ Robot rob = new Robot();
+ int x = point.X;
+ int y = point.Y;
+ rob.mouseMove(x, y);
+ rob.mousePress(InputEvent.BUTTON1_MASK);
+ rob.mouseRelease(InputEvent.BUTTON1_MASK);
+ } catch (java.awt.AWTException e) {
+ log.println("couldn't press mouse button");
+ }
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ closeDoc();
+ }
+ }
+
+ /**
+ * Creates a text document.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.PUSHBUTTON</code> and with the name
+ * <code>"Bold"</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}</li>
+ * <li> <code>'XAccessibleText.Text'</code> for
+ * {@link ifc.accessibility._XAccessibleText}: the name of button</li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleText
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleText
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ closeDoc();
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ XInterface toolkit = null;
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ toolkit = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ shortWait(tParam);
+
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(
+ (XMultiServiceFactory) tParam.getMSF(),
+ aModel);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL);
+
+ XAccessibleComponent window = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class, oObj);
+
+ point = window.getLocationOnScreen();
+ Rectangle rect = window.getBounds();
+
+ try {
+ Robot rob = new Robot();
+ int x = point.X + (rect.Width / 2);
+ int y = point.Y + (rect.Height / 2);
+ rob.mouseMove(x, y);
+ rob.mousePress(InputEvent.BUTTON3_MASK);
+ rob.mouseRelease(InputEvent.BUTTON3_MASK);
+ } catch (java.awt.AWTException e) {
+ log.println("couldn't press mouse button");
+ }
+
+ shortWait(tParam);
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, toolkit);
+
+ try {
+ xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getTopWindow(0));
+
+ xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Couldn't get Window");
+ }
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.POPUP_MENU);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("XAccessibleSelection.multiSelection",
+ new Boolean(false));
+
+ final XAccessibleSelection sel = (XAccessibleSelection) UnoRuntime.queryInterface(
+ XAccessibleSelection.class,
+ oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ sel.selectAccessibleChild(2);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ System.out.println("Couldn't fire event");
+ }
+ }
+ });
+
+ return tEnv;
+ }
+
+ protected void closeDoc() {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ private void shortWait(TestParameters tParam) {
+ util.utils.shortWait(tParam.getInt(util.PropertyName.SHORT_WAIT));
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java
new file mode 100644
index 000000000000..53f60643f955
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java
@@ -0,0 +1,310 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleSelection;
+import com.sun.star.accessibility.XAccessibleValue;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility.XAccessibleValue
+ * @see ifc.accessibility.XAccessibleText
+ */
+public class AccessibleRadioButton extends TestCase {
+ private static XDesktop the_Desk;
+ private static XTextDocument xTextDoc;
+ private static XAccessibleAction accCloseButton;
+
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Closes a Hyperlink dialog, disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ try {
+ if (accCloseButton != null) {
+ log.println("closing HyperlinkDialog");
+ accCloseButton.doAccessibleAction(0);
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Already disposed");
+ }
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ closeDoc();
+ }
+ }
+
+ /**
+ * Creates a text document, opens a hypelink dialog, selects a first item
+ * in IconChoiceCtrl.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.RADIOBUTTON</code> with the name <code>
+ * "Internet"</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * grabs focus </li>
+ * <li> <code>'XAccessibleText.Text'</code> for
+ * {@link ifc.accessibility._XAccessibleText}:
+ * the text of the component </li>
+ * <li> <code>'XAccessibleValue.anotherFromGroup'</code> for
+ * {@link ifc.accessibility._XAccessibleValue}:
+ * <code>'FTP'</code> button </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleText
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleText
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ util.utils.shortWait(2000);
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XURLTransformer urlTransf = null;
+
+ try {
+ XInterface transf = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.util.URLTransformer");
+ urlTransf = (XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class, transf);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create URLTransformer", e);
+ }
+
+ XDispatch getting = null;
+ log.println("opening HyperlinkDialog");
+
+ URL[] url = new URL[1];
+ url[0] = new URL();
+ url[0].Complete = ".uno:HyperlinkDialog";
+ urlTransf.parseStrict(url);
+ getting = aProv.queryDispatch(url[0], "", 0);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(url[0], noArgs);
+
+ util.utils.shortWait(2000);
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ util.utils.shortWait(2000);
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ XAccessibleContext iconChoiceCtrl = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.TREE,
+ "IconChoiceControl");
+
+ XAccessibleSelection sel = (XAccessibleSelection) UnoRuntime.queryInterface(
+ XAccessibleSelection.class,
+ iconChoiceCtrl);
+
+ try {
+ sel.selectAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ }
+
+ at.printAccessibleTree(log,xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.RADIO_BUTTON,
+ "Web");
+
+ XAccessibleContext anotherButton = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.RADIO_BUTTON,
+ "FTP");
+
+ XAccessibleContext closeButton = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PUSH_BUTTON,
+ "Close");
+
+
+ accCloseButton = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, closeButton);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EditOnly",
+ "This method isn't supported in this component");
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acomp.grabFocus();
+ }
+ });
+
+ tEnv.addObjRelation("XAccessibleText.Text", "Web");
+
+ tEnv.addObjRelation("EditOnly",
+ "Can't change or select Text in AccessibleRadioButton");
+
+ XAccessibleValue anotherButtonValue = (XAccessibleValue) UnoRuntime.queryInterface(
+ XAccessibleValue.class,
+ anotherButton);
+
+ tEnv.addObjRelation("XAccessibleValue.anotherFromGroup",
+ anotherButtonValue);
+
+ return tEnv;
+ }
+
+ protected void closeDoc() {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleScrollBar.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleScrollBar.java
new file mode 100644
index 000000000000..a52a9fef5483
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleScrollBar.java
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility.XAccessibleValue
+ * @see ifc.accessibility.XAccessibleAction
+ */
+public class AccessibleScrollBar extends TestCase {
+ private static XDesktop the_Desk;
+ private static XComponent xDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+
+ if (xDoc != null) {
+ closeDoc();
+ }
+ }
+
+ /**
+ * Creates a text document.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.SCROLLBAR</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * grabs focus </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xDoc != null) {
+ closeDoc();
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a text document");
+ xDoc = SOF.createDrawDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, xDoc);
+
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(
+ (XMultiServiceFactory) tParam.getMSF(),
+ aModel);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.SCROLL_BAR);
+
+ final XAccessibleAction act = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ act.doAccessibleAction(1);
+ } catch (Exception e) {
+ }
+ }
+ });
+
+ return tEnv;
+ }
+
+ protected void closeDoc() {
+ util.DesktopTools.closeDoc(xDoc);
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBar.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBar.java
new file mode 100644
index 000000000000..32dd630370a3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBar.java
@@ -0,0 +1,182 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.PosSize;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility.XAccessibleValue
+ * @see ifc.accessibility.XAccessibleAction
+ */
+public class AccessibleStatusBar extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+ }
+
+ /**
+ * Creates a text document.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.SCROLLBAR</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * grabs focus </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ ;
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ XInterface toolkit = null;
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ toolkit = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ final XWindow xWindow =
+ UnoRuntime.queryInterface(XModel.class, xTextDoc).
+ getCurrentController().getFrame().getContainerWindow();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.STATUS_BAR);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, toolkit);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ Rectangle newPosSize = xWindow.getPosSize();
+ newPosSize.Width = newPosSize.Width - 20;
+ newPosSize.Height = newPosSize.Height - 20;
+ newPosSize.X = newPosSize.X + 20;
+ newPosSize.Y = newPosSize.Y + 20;
+ xWindow.setPosSize(
+ newPosSize.X, newPosSize.Y, newPosSize.Width,
+ newPosSize.Height, PosSize.POSSIZE);
+ }
+ });
+
+ return tEnv;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBarItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBarItem.java
new file mode 100644
index 000000000000..446d0deb4f42
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBarItem.java
@@ -0,0 +1,197 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility.XAccessibleValue
+ * @see ifc.accessibility.XAccessibleAction
+ */
+public class AccessibleStatusBarItem extends TestCase {
+ private static XDesktop the_Desk;
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+ }
+
+ /**
+ * Creates a text document.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.SCROLLBAR</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * grabs focus </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ ;
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XInterface oObj = null;
+ XInterface secondItem = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentContainerWindow(
+ (XMultiServiceFactory) tParam.getMSF(),
+ aModel);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ XAccessibleContext statusbar = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.STATUS_BAR);
+
+ try {
+ oObj = statusbar.getAccessibleChild(6);
+ secondItem = statusbar.getAccessibleChild(1);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EditOnly",
+ "Can't change or select Text in StatusBarItem");
+ tEnv.addObjRelation("XAccessibleText", secondItem);
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ final XTextDocument doc = xTextDoc;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ doc.getText().setString("AccessibleStatusBarItem");
+ }
+ });
+
+ return tEnv;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java
new file mode 100644
index 000000000000..488c8a39c7d1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java
@@ -0,0 +1,282 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleSelection;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleSelection
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility.XAccessibleSelection
+ */
+public class AccessibleTabControl extends TestCase {
+ private static XDesktop the_Desk;
+ private static XTextDocument xTextDoc;
+ private static XAccessibleAction accCloseButton = null;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Closes an InsertFields dialog, disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ try {
+ if (accCloseButton != null) {
+ log.println("closing InsertFields Dialog");
+ accCloseButton.doAccessibleAction(0);
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ }
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+ }
+
+ /**
+ * Creates a text document, opens an InsertField dialog.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.PAGETABLIST</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * selects items </li>
+ * <li> <code>'XAccessibleSelection.multiSelection'</code>
+ * of type <code>Boolean</code> for
+ * {@link ifc.accessibility._XAccessibleSelection}:
+ * indicates that component supports single selection mode.</li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleSelection
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ shortWait();
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XURLTransformer urlTransf = null;
+
+ try {
+ XInterface transf = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.util.URLTransformer");
+ urlTransf = (XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class, transf);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create URLTransformer", e);
+ }
+
+ XDispatch getting = null;
+ log.println("opening InsertField dialog");
+
+ URL[] url = new URL[1];
+ url[0] = new URL();
+ url[0].Complete = ".uno:InsertField";
+ urlTransf.parseStrict(url);
+ getting = aProv.queryDispatch(url[0], "", 0);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(url[0], noArgs);
+
+ shortWait();
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ shortWait();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PAGE_TAB_LIST);
+
+ XAccessibleContext closeButton = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PUSH_BUTTON,
+ "Close");
+
+ accCloseButton = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, closeButton);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleSelection selection = (XAccessibleSelection) (XAccessibleSelection) UnoRuntime.queryInterface(
+ XAccessibleSelection.class,
+ oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ selection.selectAccessibleChild(1);
+ selection.selectAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+ }
+ });
+
+ tEnv.addObjRelation("XAccessibleSelection.OneAlwaysSelected",
+ new Boolean(true));
+
+ tEnv.addObjRelation("XAccessibleSelection.multiSelection",
+ new Boolean(false));
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.currentThread().sleep(500);
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java
new file mode 100644
index 000000000000..318c2a96b8dd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java
@@ -0,0 +1,292 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.Point;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ */
+public class AccessibleTabPage extends TestCase {
+ private static XDesktop the_Desk;
+ private static XTextDocument xTextDoc;
+ private static XAccessibleAction accCloseButton = null;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Closes an InsertFields dialog, disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ try {
+ if (accCloseButton != null) {
+ log.println("closing InsertFields Dialog");
+ accCloseButton.doAccessibleAction(0);
+ shortWait();
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("Couldn't close dialog " + e.getMessage());
+ }
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ closeDoc();
+ }
+ }
+
+ /**
+ * Creates a text document, opens an InsertField dialog.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.PAGETAB</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * grabs focus </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ try {
+ if (accCloseButton != null) {
+ log.println("closing InsertFields Dialog");
+ accCloseButton.doAccessibleAction(0);
+ shortWait();
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("Couldn't close dialog " + e.getMessage());
+ }
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ closeDoc();
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ shortWait();
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XURLTransformer urlTransf = null;
+
+ try {
+ XInterface transf = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.util.URLTransformer");
+ urlTransf = (XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class, transf);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create URLTransformer", e);
+ }
+
+ XDispatch getting = null;
+ log.println("opening InsertField dialog");
+
+ URL[] url = new URL[1];
+ url[0] = new URL();
+ url[0].Complete = ".uno:InsertField";
+ urlTransf.parseStrict(url);
+ getting = aProv.queryDispatch(url[0], "", 0);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(url[0], noArgs);
+
+ shortWait();
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ shortWait();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ XAccessibleContext closeButton = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PUSH_BUTTON,
+ "Close");
+
+ accCloseButton = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, closeButton);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PAGE_TAB);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EditOnly", "toolkit.AccessibleTabPage");
+ tEnv.addObjRelation("LimitedBounds", "toolkit.AccessibleTabPage");
+
+ XAccessibleComponent accComp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+ final Point point = accComp.getLocationOnScreen();
+
+ shortWait();
+
+ XInterface xEventInt = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PAGE_TAB, "Variables");
+ final XAccessibleComponent eventAccComp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ xEventInt);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ eventAccComp.grabFocus();
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.currentThread().sleep(1000);
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+
+ protected void closeDoc() {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java
new file mode 100644
index 000000000000..c02017508695
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java
@@ -0,0 +1,188 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ */
+public class AccessibleToolBox extends TestCase {
+ private static XDesktop the_Desk;
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+ }
+
+ /**
+ * Creates a text document.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.TOOLBAR</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * grabs focus
+ * </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ XMultiServiceFactory msf = (XMultiServiceFactory) tParam.getMSF();
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(msf);
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ XInterface oObj = null;
+
+ XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc).
+ getCurrentController().getFrame().getContainerWindow();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TOOL_BAR);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ XAccessible acc = at.getAccessibleObject(oObj);
+ XAccessible child = null;
+
+ try {
+ child = acc.getAccessibleContext().getAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+
+ util.dbg.printInterfaces(child);
+
+ final XAccessibleAction action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class,
+ child);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ System.out.println("Couldn't fire event");
+ }
+ }
+ });
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBoxItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBoxItem.java
new file mode 100644
index 000000000000..d6ecc3ce7cc8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBoxItem.java
@@ -0,0 +1,207 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleText</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility.XAccessibleAction
+ * @see ifc.accessibility.XAccessibleText
+ * @see ifc.accessibility.XAccessibleValue
+ */
+public class AccessibleToolBoxItem extends TestCase {
+ private static XDesktop the_Desk;
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ closeDoc();
+ }
+ }
+
+ /**
+ * Creates a text document.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.PUSHBUTTON</code> and with the name
+ * <code>"Bold"</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}</li>
+ * <li> <code>'XAccessibleText.Text'</code> for
+ * {@link ifc.accessibility._XAccessibleText}: the name of button</li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleText
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleText
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ closeDoc();
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentContainerWindow(
+ (XMultiServiceFactory) tParam.getMSF(),
+ aModel);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.TOGGLE_BUTTON,
+ "Bold");
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EditOnly",
+ "This method isn't supported in this dialog");
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ final XAccessibleAction oAction = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class,
+ oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ oAction.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+ }
+ });
+
+ tEnv.addObjRelation("XAccessibleText.Text", "Bold");
+
+ return tEnv;
+ }
+
+ protected void closeDoc() {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleWindow.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleWindow.java
new file mode 100644
index 000000000000..95f4f7ccb19d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleWindow.java
@@ -0,0 +1,207 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.PosSize;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleText</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility.XAccessibleAction
+ * @see ifc.accessibility.XAccessibleText
+ * @see ifc.accessibility.XAccessibleValue
+ */
+public class AccessibleWindow extends TestCase {
+ private static XDesktop the_Desk;
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+ }
+
+ /**
+ * Creates a text document.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.PUSHBUTTON</code> and with the name
+ * <code>"Bold"</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}</li>
+ * <li> <code>'XAccessibleText.Text'</code> for
+ * {@link ifc.accessibility._XAccessibleText}: the name of button</li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleText
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleText
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ ;
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ XInterface toolkit = null;
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ toolkit = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(
+ (XMultiServiceFactory) tParam.getMSF(),
+ aModel);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, toolkit);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ XWindow xWin = (XWindow) UnoRuntime.queryInterface(
+ XWindow.class, tk.getActiveTopWindow());
+ Rectangle newPosSize = xWin.getPosSize();
+ newPosSize.Width = newPosSize.Width - 20;
+ newPosSize.Height = newPosSize.Height - 20;
+ newPosSize.X = newPosSize.X + 20;
+ newPosSize.Y = newPosSize.Y + 20;
+ xWin.setPosSize(newPosSize.X, newPosSize.Y, newPosSize.Width,
+ newPosSize.Height, PosSize.POSSIZE);
+ }
+ });
+
+ return tEnv;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/MutableTreeDataModel.java b/qadevOOo/tests/java/mod/_toolkit/MutableTreeDataModel.java
new file mode 100644
index 000000000000..5b4a0ed704e1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/MutableTreeDataModel.java
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.tree.XMutableTreeDataModel;
+import com.sun.star.awt.tree.XMutableTreeNode;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class MutableTreeDataModel extends TestCase {
+ private static XTextDocument xTextDoc;
+ private static XInterface oObj = null;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.tree.MutableTreeDataModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for MutableTreeDataModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "toolkit.MutableTreeDataModel");
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ tEnv.addObjRelation("XTreeDataModelListenerEvent", new XTreeDataModelListenerEvent());
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ public class XTreeDataModelListenerEvent implements ifc.awt.tree._XTreeDataModel.XTreeDataModelListenerEvent{
+
+ public void fireEvent(){
+
+ XMutableTreeDataModel xModel = (XMutableTreeDataModel) UnoRuntime.queryInterface(XMutableTreeDataModel.class, oObj);
+ XMutableTreeNode node = xModel.createNode("EventNode", true);
+ try {
+ xModel.setRoot(node);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("ERROR: could not preform event: " + ex.toString());
+ ex.printStackTrace();
+ }
+
+ }
+ }
+} // finish class UnoControlListBoxModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java b/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java
new file mode 100644
index 000000000000..39c258c9ffd6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java
@@ -0,0 +1,191 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.tree.XMutableTreeDataModel;
+import com.sun.star.awt.tree.XMutableTreeNode;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.ucb.CommandAbortedException;
+import com.sun.star.ucb.XSimpleFileAccess;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import ifc.awt.tree._XMutableTreeNode.XMutableTreeNodeCreator;
+
+import java.io.PrintWriter;
+import lib.Status;
+import lib.StatusException;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.PropertyName;
+import util.utils;
+
+
+public class MutableTreeNode extends TestCase {
+ private static XTextDocument xTextDoc;
+ private static XInterface oObj = null;
+ private static XMutableTreeDataModel mXTreeDataModel;
+ private static XMultiServiceFactory mxMSF;
+ private static PrintWriter log;
+ private static boolean debug = false;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ this.log = log;
+ debug = tParam.getBool(PropertyName.DEBUG_IS_ACTIVE);
+ mxMSF = (XMultiServiceFactory) tParam.getMSF();
+// log.println("creating a textdocument");
+// xTextDoc = WriterTools.createTextDoc(mxMSF);
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XMutableTreeNode xNode;
+
+ try {
+ mXTreeDataModel = (XMutableTreeDataModel) UnoRuntime.queryInterface(XMutableTreeDataModel.class,
+ mxMSF.createInstance("com.sun.star.awt.tree.MutableTreeDataModel"));
+ } catch (com.sun.star.uno.Exception ex) {
+ throw new StatusException(Status.failed("ERROR: could not create instance of" +
+ " 'com.sun.star.awt.tree.MutableTreeDataModel'"));
+ }
+
+ xNode = mXTreeDataModel.createNode("UnoTreeControl", false);
+
+ String sDisplayValue = "UnoTreeControl";
+ String sExpandedGraphicURL = "private:graphicrepository/sd/res/triangle_down.png";
+ String sCollapsedGraphicURL = "private:graphicrepository/sd/res/triangle_right.png";
+ String sNodeGraphicURL = "private:graphicrepository/sw/imglst/nc20010.png";
+
+ xNode.setDisplayValue( sDisplayValue);
+ xNode.setDataValue(sDisplayValue);
+ xNode.setExpandedGraphicURL(sExpandedGraphicURL);
+ xNode.setCollapsedGraphicURL(sCollapsedGraphicURL);
+ xNode.setNodeGraphicURL(sNodeGraphicURL);
+ xNode.setHasChildrenOnDemand(true);
+
+ fillNode(xNode);
+
+ TestEnvironment tEnv = new TestEnvironment(xNode);
+
+ tEnv.addObjRelation("OBJNAME", "toolkit.MutableTreeDataModel");
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ tEnv.addObjRelation("XTreeNode_DisplayValue", sDisplayValue);
+ tEnv.addObjRelation("XTreeNode_ExpandedGraphicURL", sExpandedGraphicURL);
+ tEnv.addObjRelation("XTreeNode_CollapsedGraphicURL", sCollapsedGraphicURL);
+ tEnv.addObjRelation("XTreeNode_NodeGraphicURL", sNodeGraphicURL);
+
+ tEnv.addObjRelation("XMutableTreeNode_NodeToAppend",
+ mXTreeDataModel.createNode("XMutableTreeNode_NodeToAppend", true));
+
+ tEnv.addObjRelation("XMutableTreeNodeCreator", new XMutableTreeNodeCreator(){
+ public XMutableTreeNode createNode(String name){
+ return mXTreeDataModel.createNode(name, true);
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ private void fillNode( XMutableTreeNode xNode ){
+
+ if( xNode.getChildCount() == 0 )
+ {
+ String sParentPath = (String) xNode.getDataValue();
+
+ String officeUserPath = utils.getOfficeUserPath(mxMSF);
+ Object fileacc = null;
+ try {
+ fileacc = mxMSF.createInstance("com.sun.star.comp.ucb.SimpleFileAccess");
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace();
+ }
+ XSimpleFileAccess sA = (XSimpleFileAccess)
+ UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc);
+
+
+ dirlist(officeUserPath, xNode);
+ }
+ }
+
+ private void dirlist(String dir, XMutableTreeNode xNode){
+
+ Object fileacc = null;
+ try {
+ fileacc = mxMSF.createInstance("com.sun.star.comp.ucb.SimpleFileAccess");
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace();
+ }
+ XSimpleFileAccess sfa = (XSimpleFileAccess)
+ UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc);
+ XMutableTreeNode xChildNode = null;
+ try {
+ xChildNode = mXTreeDataModel.createNode(dir.substring(dir.lastIndexOf("/")+1, dir.length()), sfa.isFolder(dir));
+ xChildNode.setDataValue(dir);
+ boolean test = sfa.isFolder(dir);
+ if (sfa.isFolder(dir)){
+ xChildNode.setExpandedGraphicURL( "private:graphicrepository/sd/res/triangle_down.png");
+ xChildNode.setCollapsedGraphicURL("private:graphicrepository/sd/res/triangle_right.png");
+ String[] children = sfa.getFolderContents(dir, true);
+ if (children != null){
+ for (int i=0; i<children.length; i++) {
+ // Get filename of file or directory
+ String filename = children[i];
+ dirlist( filename , xChildNode);
+ }
+ }
+ }
+ else{
+ xChildNode.setNodeGraphicURL( "private:graphicrepository/sw/imglst/nc20010.png");
+ }
+ } catch (CommandAbortedException ex) {
+ ex.printStackTrace();
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace();
+ }
+
+ try {
+ xNode.appendChild( xChildNode );
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ ex.printStackTrace();
+ }
+ }
+} // finish class UnoControlListBoxModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/TabController.java b/qadevOOo/tests/java/mod/_toolkit/TabController.java
new file mode 100644
index 000000000000..c7bd67265305
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/TabController.java
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlContainer;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XTabControllerModel;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.form.XForm;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.WriterTools;
+import util.utils;
+
+
+public class TabController extends TestCase {
+ private static XTextDocument xTextDoc = null;
+
+ protected void initialize(TestParameters param, PrintWriter log) {
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) param.getMSF());
+ } catch (Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ public TestEnvironment createTestEnvironment(TestParameters param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XControl xCtrl1 = null;
+ XTabControllerModel tabCtrlModel = null;
+ XControlContainer aCtrlContainer = null;
+
+
+ // create object relations
+ FormTools.insertForm(xTextDoc,
+ FormTools.getForms(WriterTools.getDrawPage(
+ xTextDoc)), "MyForm");
+
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "CommandButton",
+ "UnoControlButton");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel model = aShape.getControl();
+ XControlAccess access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ try {
+ xCtrl1 = access.getControl(model);
+ } catch (Exception e) {
+ }
+
+ XForm form = null;
+
+ try {
+ form = (XForm) AnyConverter.toObject(new Type(XForm.class),
+ (FormTools.getForms(
+ WriterTools.getDrawPage(
+ xTextDoc)))
+ .getByName("MyForm"));
+ } catch (Exception e) {
+ log.println("Couldn't get Form");
+ e.printStackTrace(log);
+ }
+
+ tabCtrlModel = (XTabControllerModel) UnoRuntime.queryInterface(
+ XTabControllerModel.class, form);
+
+ aCtrlContainer = (XControlContainer) UnoRuntime.queryInterface(
+ XControlContainer.class, xCtrl1.getContext());
+
+ // create object
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) param.getMSF()).createInstance(
+ "com.sun.star.awt.TabController");
+ } catch (Exception e) {
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ String objName = "TabController";
+ tEnv.addObjRelation("OBJNAME", "toolkit." + objName);
+ tEnv.addObjRelation("MODEL", tabCtrlModel);
+ tEnv.addObjRelation("CONTAINER", aCtrlContainer);
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/TabControllerModel.java b/qadevOOo/tests/java/mod/_toolkit/TabControllerModel.java
new file mode 100644
index 000000000000..3ba6305c2be9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/TabControllerModel.java
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.WriterTools;
+import util.utils;
+
+
+public class TabControllerModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters param, PrintWriter log) {
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) param.getMSF());
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ public TestEnvironment createTestEnvironment(TestParameters param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ log.println("inserting some ControlShapes");
+
+ XControlShape shape1 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 1000,
+ "CommandButton");
+ XControlShape shape2 = FormTools.createControlShape(xTextDoc, 5000,
+ 3500, 7500, 5000,
+ "TextField");
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) param.getMSF()).createInstance(
+ "com.sun.star.awt.TabControllerModel");
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create " +
+ "TabControllerModel", e);
+ }
+
+ log.println("creating a new environment for TabControllerModel");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME",
+ "stardiv.vcl.controlmodel.TabController");
+ tEnv.addObjRelation("Model1", shape1.getControl());
+ tEnv.addObjRelation("Model2", shape2.getControl());
+
+
+ //Object Relation for XPersistObject
+ tEnv.addObjRelation("noPS", new Boolean(true));
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class TabControllerModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/Toolkit.java b/qadevOOo/tests/java/mod/_toolkit/Toolkit.java
new file mode 100644
index 000000000000..edca76e5e682
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/Toolkit.java
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+/**
+* Test for <code>com.sun.star.awt.Toolkit</code> service.
+*/
+public class Toolkit extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates <code>com.sun.star.awt.Toolkit</code> service.
+ */
+ public TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log)
+ throws StatusException {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XWindow win = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 10000,
+ "CommandButton");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+ XController cntrlr = (XController) UnoRuntime.queryInterface(
+ XController.class,
+ xTextDoc.getCurrentController());
+
+ //now get the toolkit
+ try {
+ win = cntrlr.getFrame().getContainerWindow();
+
+
+ //win = (XWindow) UnoRuntime.queryInterface(XWindow.class, ctrl) ;
+ the_win = the_access.getControl(the_Model).getPeer();
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ log.println(" creating a new environment for toolkit object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ tEnv.addObjRelation("WINPEER", the_win);
+
+ tEnv.addObjRelation("XModel", xModel);
+
+
+ // adding relation for XDataTransferProviderAccess
+ tEnv.addObjRelation("XDataTransferProviderAccess.XWindow", win);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class Toolkit
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java
new file mode 100644
index 000000000000..fac722977e95
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XFrame;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlButton extends TestCase {
+ private static XTextDocument xTextDoc;
+ private static XTextDocument xTD2;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ xTD2 = WriterTools.createTextDoc(
+ (XMultiServiceFactory) Param.getMSF());
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ util.DesktopTools.closeDoc(xTD2);
+ }
+
+ public TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XWindow anotherWindow = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "CommandButton",
+ "UnoControlButton");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the ButtonControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ 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 ButtonControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ButtonControl", e);
+ }
+
+ log.println("creating a new environment for UnoControlButton object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ try {
+ XController aController = xTD2.getCurrentController();
+ XFrame aFrame = aController.getFrame();
+ anotherWindow = aFrame.getComponentWindow();
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create XWindow", e);
+ }
+
+
+ // Object Relation for XWindow
+ tEnv.addObjRelation("XWindow.AnotherWindow", anotherWindow);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlButton
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlButtonModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlButtonModel.java
new file mode 100644
index 000000000000..a46b8abee959
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlButtonModel.java
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlButtonModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlButtonModel");
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create object", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlButtonModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.Button");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlButtonModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java
new file mode 100644
index 000000000000..a2b8c167e2c4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java
@@ -0,0 +1,164 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XCheckBox;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XFrame;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlCheckBox extends TestCase {
+ private static XTextDocument xTextDoc;
+ private static XTextDocument xTD2;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ xTD2 = WriterTools.createTextDoc(
+ (XMultiServiceFactory) Param.getMSF());
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ util.DesktopTools.closeDoc(xTD2);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XWindow anotherWindow = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "CheckBox",
+ "UnoControlCheckBox");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the CheckBoxControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ 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 CheckBoxControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get CheckBoxControl", e);
+ }
+
+ log.println("creating a new environment for UnoControlCheckBox object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ // adding object relation for XItemListener
+ ifc.awt._XItemListener.TestItemListener listener =
+ new ifc.awt._XItemListener.TestItemListener();
+ XCheckBox check = (XCheckBox) UnoRuntime.queryInterface(
+ XCheckBox.class, oObj);
+ check.addItemListener(listener);
+ tEnv.addObjRelation("TestItemListener", listener);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ try {
+ XController aController = xTD2.getCurrentController();
+ XFrame aFrame = aController.getFrame();
+ anotherWindow = aFrame.getComponentWindow();
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create XWindow", e);
+ }
+
+
+ // Object Relation for XWindow
+ tEnv.addObjRelation("XWindow.AnotherWindow", anotherWindow);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlCheckBox
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBoxModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBoxModel.java
new file mode 100644
index 000000000000..76773c6d74ac
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBoxModel.java
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlCheckBoxModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlCheckBoxModel");
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create object", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlCheckBoxModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.CheckBox");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlCheckBoxModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java
new file mode 100644
index 000000000000..6bc357321d53
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+public class UnoControlComboBox extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "ComboBox",
+ "UnoControlComboBox");
+
+ 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());
+
+ //get the ComboBoxControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = 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 ComboBoxControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ComboBoxControl", e);
+ }
+
+ log.println("creating a new environment for UnoControlComboBox object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlComboBox
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBoxModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBoxModel.java
new file mode 100644
index 000000000000..4ee5eef572ab
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBoxModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlComboBoxModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlComboBoxModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlComboBoxModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.ComboBox");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlComboBoxModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java
new file mode 100644
index 000000000000..3b2b83380c04
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java
@@ -0,0 +1,252 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.PosSize;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlContainer;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XFrame;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlContainer extends TestCase {
+ private static XTextDocument xTextDoc;
+ private static XTextDocument xTD2;
+ private static XControl xCtrl;
+ private static XControl xCtrl1;
+ private static XControl xCtrl2;
+
+ protected void initialize(TestParameters param, PrintWriter log) {
+ try {
+ log.println("creating a textdocument");
+ xTD2 = WriterTools.createTextDoc(
+ (XMultiServiceFactory) param.getMSF());
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) param.getMSF());
+ } catch (Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ util.DesktopTools.closeDoc(xTD2);
+ }
+
+ public TestEnvironment createTestEnvironment(TestParameters param,
+ PrintWriter log) {
+ // create Object Relations -------------------------------------------
+ XInterface oObj = null;
+ XControlShape shape = null;
+ XControlModel model = null;
+ XControlAccess access = null;
+ XWindow anotherWindow = null;
+
+ // for XControl
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+
+ XControlContainer ctrlCont = null;
+
+ XGraphics aGraphic = null;
+
+
+ // create 3 XControls
+ // create first XControl
+ shape = FormTools.createControlShape(xTextDoc, 3000, 4500, 15000,
+ 10000, "TextField");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) shape);
+ model = shape.getControl();
+ access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class, xTextDoc.getCurrentController());
+
+ try {
+ xCtrl = access.getControl(model);
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create XControl", e);
+ }
+
+
+ // create second XControl
+ shape = FormTools.createControlShape(xTextDoc, 3000, 4500, 15000,
+ 10000, "TextField");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) shape);
+ model = shape.getControl();
+ access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class, xTextDoc.getCurrentController());
+
+ try {
+ xCtrl1 = access.getControl(model);
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create XControl", e);
+ }
+
+
+ // create third XControl
+ shape = FormTools.createControlShape(xTextDoc, 3000, 4500, 15000,
+ 10000, "CommandButton");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) shape);
+ model = shape.getControl();
+ access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class, xTextDoc.getCurrentController());
+
+ try {
+ xCtrl2 = access.getControl(model);
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create XControl", e);
+ }
+
+ // create XToolkit, XWindowPeer, XDevice
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "CommandButton",
+ "UnoControlButton");
+
+ WriterTools.getDrawPage(xTD2).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTD2.getCurrentController());
+
+ //get the ButtonControl for the needed Object relations
+ try {
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+
+ XDevice aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get ButtonControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ButtonControl", e);
+ }
+
+ try {
+ XController aController = xTD2.getCurrentController();
+ XFrame aFrame = aController.getFrame();
+ anotherWindow = aFrame.getComponentWindow();
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create XWindow", e);
+ }
+
+ // finished create Object Relations -----------------------------------
+ // create the UnoControlContainer
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlContainer");
+
+ XControl xCtrl = (XControl) UnoRuntime.queryInterface(
+ XControl.class, oObj);
+ xCtrl.setModel(the_Model);
+
+ ctrlCont = (XControlContainer) UnoRuntime.queryInterface(
+ XControlContainer.class, oObj);
+ ctrlCont.addControl("jupp", access.getControl(aShape.getControl()));
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create UnoControlContainer", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlContainer object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, oObj);
+ Rectangle ps = xWindow.getPosSize();
+ xWindow.setPosSize(ps.X+10, ps.Y+10, ps.Width+10, ps.Height+10, PosSize.POSSIZE);
+
+ String objName = "UnoControlContainer";
+ tEnv.addObjRelation("OBJNAME", "toolkit." + objName);
+
+
+ // Object relation for XContainer
+ tEnv.addObjRelation("XContainer.Container", ctrlCont);
+ tEnv.addObjRelation("INSTANCE", xCtrl);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ // Object Relation for XControlContainer
+ tEnv.addObjRelation("CONTROL1", xCtrl1);
+ tEnv.addObjRelation("CONTROL2", xCtrl2);
+
+
+ // Object Relation for XControl
+ tEnv.addObjRelation("CONTEXT", xTD2);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+
+ // Object Relation for XWindow
+ tEnv.addObjRelation("XWindow.AnotherWindow", anotherWindow);
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlContainerModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlContainerModel.java
new file mode 100644
index 000000000000..cf7104282237
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlContainerModel.java
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+public class UnoControlContainerModel extends TestCase {
+ public TestEnvironment createTestEnvironment(TestParameters param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlContainerModel");
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create " +
+ "UnoControlContainerModel", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlContainer object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ tEnv.addObjRelation("OBJNAME",
+ "stardiv.vcl.controlmodel.ControlContainer");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java
new file mode 100644
index 000000000000..455c4765bef0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlCurrencyField extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "CurrencyField",
+ "UnoControlCurrencyField");
+
+ 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());
+
+ //get the CurrencyFieldControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = 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 CurrencyFieldControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get CurrencyFieldControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlCurrencyField object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlCurrencyField
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyFieldModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyFieldModel.java
new file mode 100644
index 000000000000..e2c696b53ac2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyFieldModel.java
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlCurrencyFieldModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlCurrencyFieldModel");
+ } catch (Exception e) {
+ }
+
+ log.println("creating a new environment for " +
+ "UnoControlCurrencyFieldModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME",
+ "stardiv.vcl.controlmodel.CurrencyField");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlCurrencyFieldModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java
new file mode 100644
index 000000000000..073f262a0c12
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XFrame;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlDateField extends TestCase {
+ private static XTextDocument xTextDoc;
+ private static XTextDocument xTD2;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ xTD2 = WriterTools.createTextDoc(
+ (XMultiServiceFactory) Param.getMSF());
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ util.DesktopTools.closeDoc(xTD2);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XWindow anotherWindow = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "DateField",
+ "UnoControlDateField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the DateFieldControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ 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 DateFieldControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get DateFieldControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlDateField object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ try {
+ XController aController = xTD2.getCurrentController();
+ XFrame aFrame = aController.getFrame();
+ anotherWindow = aFrame.getComponentWindow();
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create XWindow", e);
+ }
+
+
+ // Object Relation for XWindow
+ tEnv.addObjRelation("XWindow.AnotherWindow", anotherWindow);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlDateField
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlDateFieldModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlDateFieldModel.java
new file mode 100644
index 000000000000..0144d0759b0d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDateFieldModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlDateFieldModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlDateFieldModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlDateFieldModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.DateField");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlDateFieldModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlDialog.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialog.java
new file mode 100644
index 000000000000..d621681a75a4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialog.java
@@ -0,0 +1,254 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.PosSize;
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlContainer;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTabController;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.awt.UnoControlDialog</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::awt::XWindow</code></li>
+* <li> <code>com::sun::star::awt::XDialog</code></li>
+* <li> <code>com::sun::star::awt::XControl</code></li>
+* <li> <code>com::sun::star::awt::XTopWindow</code></li>
+* <li> <code>com::sun::star::awt::XControlContainer</code></li>
+* <li> <code>com::sun::star::awt::XView</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.awt.XWindow
+* @see com.sun.star.awt.XDialog
+* @see com.sun.star.awt.XControl
+* @see com.sun.star.awt.XTopWindow
+* @see com.sun.star.awt.XControlContainer
+* @see com.sun.star.awt.XView
+* @see ifc.lang._XComponent
+* @see ifc.awt._XWindow
+* @see ifc.awt._XDialog
+* @see ifc.awt._XControl
+* @see ifc.awt._XTopWindow
+* @see ifc.awt._XControlContainer
+* @see ifc.awt._XView
+*/
+public class UnoControlDialog extends TestCase {
+ private static XWindow xWinDlg = null;
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates a Dialog Control and Model instance defines Model
+ * for Control, adds to Dialog a button, sets its size and
+ * sets the dialog visible. <p>
+ */
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory) Param.getMSF();
+ XControlModel dlgModel = null;
+
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+
+ XControl butControl = null;
+ XControl butControl1 = null;
+ XControl butControl2 = null;
+ XTabController tabControl1 = null;
+ XTabController tabControl2 = null;
+
+ XControlContainer ctrlCont = null;
+
+ if (xWinDlg != null) {
+ xWinDlg.dispose();
+ }
+
+ try {
+ dlgModel = (XControlModel) UnoRuntime.queryInterface(
+ XControlModel.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlDialogModel"));
+
+ XControl dlgControl = (XControl) UnoRuntime.queryInterface(
+ XControl.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlDialog"));
+
+ dlgControl.setModel(dlgModel);
+
+ XControlModel butModel = (XControlModel) UnoRuntime.queryInterface(
+ XControlModel.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlButtonModel"));
+
+ butControl = (XControl) UnoRuntime.queryInterface(XControl.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlButton"));
+
+ butControl.setModel(butModel);
+
+
+ // creating additional controls for XUnoControlContainer
+ tabControl1 = (XTabController) UnoRuntime.queryInterface(
+ XTabController.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.TabController"));
+
+ tabControl2 = (XTabController) UnoRuntime.queryInterface(
+ XTabController.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.TabController"));
+
+
+ // creating additional controls for XControlContainer
+ butModel = (XControlModel) UnoRuntime.queryInterface(
+ XControlModel.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlButtonModel"));
+
+ butControl1 = (XControl) UnoRuntime.queryInterface(XControl.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlButton"));
+
+ butControl1.setModel(butModel);
+
+ butModel = (XControlModel) UnoRuntime.queryInterface(
+ XControlModel.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlButtonModel"));
+
+ butControl2 = (XControl) UnoRuntime.queryInterface(XControl.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlButton"));
+
+ butControl2.setModel(butModel);
+
+ ctrlCont = (XControlContainer) UnoRuntime.queryInterface(
+ XControlContainer.class, dlgControl);
+
+ xWinDlg = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ dlgControl);
+
+ xWinDlg.setVisible(true);
+
+ xWinDlg.setPosSize(10, 10, 220, 110, PosSize.SIZE);
+
+ the_win = dlgControl.getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(220, 220);
+ aGraphic = aDevice.createGraphics();
+
+ oObj = dlgControl;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Error creating dialog :");
+ e.printStackTrace(log);
+ }
+
+ log.println("creating a new environment for object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", dlgModel);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", dlgModel);
+
+ tEnv.addObjRelation("INSTANCE", butControl);
+ tEnv.addObjRelation("XContainer.Container", ctrlCont);
+
+
+ // adding relations for XUnoControlContainer
+ tEnv.addObjRelation("TABCONTROL1", tabControl1);
+ tEnv.addObjRelation("TABCONTROL2", tabControl2);
+
+
+ // adding relations for XControlContainer
+ tEnv.addObjRelation("CONTROL1", butControl1);
+ tEnv.addObjRelation("CONTROL2", butControl2);
+
+ XWindow forObjRel = xTextDoc.getCurrentController().getFrame()
+ .getComponentWindow();
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println("Disposing dialog ...");
+ xWinDlg.dispose();
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java
new file mode 100644
index 000000000000..558ea9f07d95
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java
@@ -0,0 +1,189 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.awt.UnoControlDialogModel</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::awt::UnoControlDialogModel</code></li>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.awt.UnoControlDialogModel
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.beans.XMultiPropertySet
+* @see ifc.awt._UnoControlDialogModel
+* @see ifc.io._XPersistObject
+* @see ifc.lang._XComponent
+* @see ifc.beans._XPropertySet
+* @see ifc.beans._XMultiPropertySet
+*/
+public class UnoControlDialogModel extends TestCase {
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.awt.UnoControlDialogModel</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'OBJNAME'</code> for
+ * {@link ifc.io._XPersistObject} </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XInterface dialogModel = null;
+ String _buttonName = "MyButton";
+ String _labelName = "MyLabel";
+ String _labelPrefix = "MyLabelPrefix";
+ XMultiServiceFactory xMultiServiceFactory = null;
+
+ try {
+ dialogModel = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlDialogModel");
+
+ // create the dialog model and set the properties
+ XPropertySet xPSetDialog = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, dialogModel);
+ xPSetDialog.setPropertyValue("PositionX", new Integer(100));
+ xPSetDialog.setPropertyValue("PositionY", new Integer(100));
+ xPSetDialog.setPropertyValue("Width", new Integer(150));
+ xPSetDialog.setPropertyValue("Height", new Integer(100));
+ xPSetDialog.setPropertyValue("Title",
+ new String("Runtime Dialog Demo"));
+
+
+ // get the service manager from the dialog model
+ xMultiServiceFactory = (XMultiServiceFactory) UnoRuntime.queryInterface(
+ XMultiServiceFactory.class,
+ dialogModel);
+
+ // create the button model and set the properties
+ Object buttonModel = xMultiServiceFactory.createInstance(
+ "com.sun.star.awt.UnoControlButtonModel");
+ XPropertySet xPSetButton = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, buttonModel);
+ xPSetButton.setPropertyValue("PositionX", new Integer(50));
+ xPSetButton.setPropertyValue("PositionY", new Integer(30));
+ xPSetButton.setPropertyValue("Width", new Integer(50));
+ xPSetButton.setPropertyValue("Height", new Integer(14));
+ xPSetButton.setPropertyValue("Name", _buttonName);
+ xPSetButton.setPropertyValue("TabIndex", new Short((short) 0));
+ xPSetButton.setPropertyValue("Label", new String("Click Me"));
+
+ // create the label model and set the properties
+ Object labelModel = xMultiServiceFactory.createInstance(
+ "com.sun.star.awt.UnoControlFixedTextModel");
+ XPropertySet xPSetLabel = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, labelModel);
+ xPSetLabel.setPropertyValue("PositionX", new Integer(40));
+ xPSetLabel.setPropertyValue("PositionY", new Integer(60));
+ xPSetLabel.setPropertyValue("Width", new Integer(100));
+ xPSetLabel.setPropertyValue("Height", new Integer(14));
+ xPSetLabel.setPropertyValue("Name", _labelName);
+ xPSetLabel.setPropertyValue("TabIndex", new Short((short) 1));
+ xPSetLabel.setPropertyValue("Label", _labelPrefix);
+
+ // insert the control models into the dialog model
+ XNameContainer xNameCont = (XNameContainer) UnoRuntime.queryInterface(
+ XNameContainer.class,
+ dialogModel);
+ xNameCont.insertByName(_buttonName, buttonModel);
+ xNameCont.insertByName(_labelName, labelModel);
+
+ // create the dialog control and set the model
+ XControl dialog = (XControl) UnoRuntime.queryInterface(
+ XControl.class,
+ ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlDialog"));
+ XControl xControl = (XControl) UnoRuntime.queryInterface(
+ XControl.class, dialog);
+ XControlModel xControlModel = (XControlModel) UnoRuntime.queryInterface(
+ XControlModel.class,
+ dialogModel);
+ xControl.setModel(xControlModel);
+ } catch (Exception e) {
+ throw new StatusException("Could no create test object", e);
+ }
+
+ oObj = dialogModel;
+
+ log.println("creating a new environment for object");
+
+ XMultiServiceFactory oMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
+ XMultiServiceFactory.class, oObj);
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ try {
+ // XNameReplace
+ tEnv.addObjRelation("INSTANCE1",
+ xMultiServiceFactory.createInstance(
+ "com.sun.star.awt.UnoControlFixedTextModel"));
+
+
+ //XContainer
+ tEnv.addObjRelation("INSTANCE",
+ xMultiServiceFactory.createInstance(
+ "com.sun.star.awt.UnoControlFixedTextModel"));
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Could not add object relations 'INSTANCEn'");
+ e.printStackTrace(log);
+ }
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.Dialog");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java
new file mode 100644
index 000000000000..e6460fc72d55
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java
@@ -0,0 +1,161 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlEdit extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "TextField",
+ "UnoControlEdit");
+
+ 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());
+
+ //get the EditControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = 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 EditControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get EditControl", e);
+ }
+
+ log.println("creating a new environment for UnoControlEdit object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlEdit
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlEditModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlEditModel.java
new file mode 100644
index 000000000000..4df1e7ee86cc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlEditModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlEditModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlEditModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlEditModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.Edit");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlEditModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java
new file mode 100644
index 000000000000..ecf4c7170243
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlFileControl extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "FileControl",
+ "UnoControlFileControl");
+
+ 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());
+
+ //get the FileControlControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = 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 FileControlControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get FileControlControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlFileControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlFileControl
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControlModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControlModel.java
new file mode 100644
index 000000000000..31153036da95
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControlModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlFileControlModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlFileControlModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlFileControlModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.FileControl");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlFileControlModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedLineModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedLineModel.java
new file mode 100644
index 000000000000..986f3acd9a2c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedLineModel.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.awt.UnoControlFixedLineModel</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::awt::UnoControlFixedLineModel</code></li>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.awt.UnoControlFixedLineModel
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.beans.XMultiPropertySet
+* @see ifc.awt._UnoControlFixedLineModel
+* @see ifc.io._XPersistObject
+* @see ifc.lang._XComponent
+* @see ifc.beans._XPropertySet
+* @see ifc.beans._XMultiPropertySet
+*/
+public class UnoControlFixedLineModel extends TestCase {
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.awt.UnoControlFixedLineModel</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'OBJNAME'</code> for
+ * {@link ifc.io._XPersistObject} </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log)
+ throws StatusException {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlFixedLineModel");
+ } catch (Exception e) {
+ }
+
+ log.println("creating a new environment for object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.FixedLine");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java
new file mode 100644
index 000000000000..7ee0369ad4ea
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlFixedText extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "FixedText",
+ "UnoControlFixedText");
+
+ 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());
+
+ //get the FixedTextControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = 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 FixedTextControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get FixedTextControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlFixedText object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlFixedText
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedTextModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedTextModel.java
new file mode 100644
index 000000000000..6bbf6f0cadb1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedTextModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlFixedTextModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlFixedTextModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlFixedTextModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.FixedText");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlFixedTextModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java
new file mode 100644
index 000000000000..62b6169895bc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java
@@ -0,0 +1,167 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlFormattedField extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "DatabaseFormattedField",
+ "UnoControlFormattedField");
+
+ 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();
+
+ XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, the_Model);
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the EditControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = 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();
+
+ xPS.setPropertyValue("Spin", new Boolean(true));
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get EditControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get EditControl", e);
+ }
+
+ log.println("creating a new environment for UnoControlEdit object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedFieldModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedFieldModel.java
new file mode 100644
index 000000000000..549ddd82ef7d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedFieldModel.java
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlFormattedFieldModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlFormattedFieldModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlFormattedFieldModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME",
+ "stardiv.vcl.controlmodel.FormattedField");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlFormattedFieldModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java
new file mode 100644
index 000000000000..ef1377289fea
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java
@@ -0,0 +1,151 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlGroupBox extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "GroupBox",
+ "UnoControlGroupBox");
+
+ 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());
+
+ //get the GroupBoxControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = 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 GroupBoxControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get GroupBoxControl", e);
+ }
+
+ log.println("creating a new environment for UnoControlGroupBox object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlGroupBox
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBoxModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBoxModel.java
new file mode 100644
index 000000000000..a960cd91c607
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBoxModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlGroupBoxModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlGroupBoxModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlGroupBoxModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.GroupBox");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlGroupBoxModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java
new file mode 100644
index 000000000000..e8611f9aee4c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlImageControl extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "DatabaseImageControl",
+ "UnoControlImageControl");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, the_Model);
+
+ 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());
+
+ //get the ImageControlControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = 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();
+
+ String imgUrl = util.utils.getFullTestURL("poliball.gif");
+
+ xPS.setPropertyValue("ImageURL", imgUrl);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get ImageControlControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ImageControlControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlImageControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlImageControl
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControlModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControlModel.java
new file mode 100644
index 000000000000..ab69c310038c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControlModel.java
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+public class UnoControlImageControlModel extends TestCase {
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlImageControlModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlImageControlModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.ImageControl");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlImageControlModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java
new file mode 100644
index 000000000000..85e9abd9058c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java
@@ -0,0 +1,161 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XListBox;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlListBox extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "ListBox",
+ "UnoControlListBox");
+
+ 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());
+
+ //get the ListBoxControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = 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 ListBoxControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ListBoxControl", e);
+ }
+
+ log.println("creating a new environment for UnoControlListBox object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ // adding object relation for XItemListener
+ ifc.awt._XItemListener.TestItemListener listener =
+ new ifc.awt._XItemListener.TestItemListener();
+ XListBox list = (XListBox) UnoRuntime.queryInterface(XListBox.class,
+ oObj);
+ list.addItemListener(listener);
+ tEnv.addObjRelation("TestItemListener", listener);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlListBox
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlListBoxModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlListBoxModel.java
new file mode 100644
index 000000000000..d567bb50bb8a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlListBoxModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlListBoxModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlListBoxModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlListBoxModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.ListBox");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlListBoxModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java
new file mode 100644
index 000000000000..f9ac8e3b2d61
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+public class UnoControlNumericField extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "NumericField",
+ "UnoControlNumericField");
+
+ 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());
+
+ //get the NumericFieldControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = 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 NumericFieldControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get NumericFieldControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlNumericField object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ tEnv.addObjRelation("XTextComponent.onlyNumbers", "");
+
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlNumericField
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericFieldModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericFieldModel.java
new file mode 100644
index 000000000000..003f36fd0791
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericFieldModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlNumericFieldModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlNumericFieldModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlNumericFieldModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.NumericField");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlNumericFieldModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java
new file mode 100644
index 000000000000..e3c514312b50
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlPatternField extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "PatternField",
+ "UnoControlPatternField");
+
+ 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());
+
+ //get the PatternFieldControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = 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 PatternFieldControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get PatternFieldControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlPatternField object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlPatternField
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternFieldModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternFieldModel.java
new file mode 100644
index 000000000000..2b77d40d0b15
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternFieldModel.java
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+public class UnoControlPatternFieldModel extends TestCase {
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlPatternFieldModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlPatternFieldModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.PatternField");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlPatternFieldModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlProgressBarModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlProgressBarModel.java
new file mode 100644
index 000000000000..39e9dca50035
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlProgressBarModel.java
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.awt.UnoControlProgressBarModel</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::awt::UnoControlProgressBarModel</code></li>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.awt.UnoControlProgressBarModel
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.beans.XMultiPropertySet
+* @see ifc.awt._UnoControlProgressBarModel
+* @see ifc.io._XPersistObject
+* @see ifc.lang._XComponent
+* @see ifc.beans._XPropertySet
+* @see ifc.beans._XMultiPropertySet
+*/
+public class UnoControlProgressBarModel extends TestCase {
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.awt.UnoControlProgressBarModel</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'OBJNAME'</code> for
+ * {@link ifc.io._XPersistObject} </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log)
+ throws StatusException {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlProgressBarModel");
+ } catch (Exception e) {
+ }
+
+ log.println("creating a new environment for object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.ProgressBar");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java
new file mode 100644
index 000000000000..3b8eb313a3fa
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlRadioButton extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "RadioButton",
+ "UnoControlRadioButton");
+
+ 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());
+
+ //get the RadioButtonControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = 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 RadioButtonControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get RadioButtonControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlRadioButton object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlRadioButton
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButtonModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButtonModel.java
new file mode 100644
index 000000000000..4805f9f4c61a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButtonModel.java
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+public class UnoControlRadioButtonModel extends TestCase {
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlRadioButtonModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlRadioButtonModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.RadioButton");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlRadioButtonModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlScrollBarModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlScrollBarModel.java
new file mode 100644
index 000000000000..bf9a1b6492b8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlScrollBarModel.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.awt.UnoControlScrollBarModel</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::awt::UnoControlScrollBarModel</code></li>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.awt.UnoControlScrollBarModel
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.beans.XMultiPropertySet
+* @see ifc.awt._UnoControlScrollBarModel
+* @see ifc.io._XPersistObject
+* @see ifc.lang._XComponent
+* @see ifc.beans._XPropertySet
+* @see ifc.beans._XMultiPropertySet
+*/
+public class UnoControlScrollBarModel extends TestCase {
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.awt.UnoControlScrollBarModel</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'OBJNAME'</code> for
+ * {@link ifc.io._XPersistObject} </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log)
+ throws StatusException {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlScrollBarModel");
+ } catch (Exception e) {
+ }
+
+ log.println("creating a new environment for object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.ScrollBar");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java
new file mode 100644
index 000000000000..04161dca61c2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlTimeField extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "TimeField",
+ "UnoControlTimeField");
+
+ 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());
+
+ //get the TimeFieldControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = 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 TimeFieldControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get TimeFieldControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlTimeField object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlTimeField
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeFieldModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeFieldModel.java
new file mode 100644
index 000000000000..91472cd01e4b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeFieldModel.java
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+public class UnoControlTimeFieldModel extends TestCase {
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlTimeFieldModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlTimeFieldModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.TimeField");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlTimeFieldModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoScrollBarControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoScrollBarControl.java
new file mode 100644
index 000000000000..e12d323a5a8f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoScrollBarControl.java
@@ -0,0 +1,179 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+import java.awt.Dimension;
+import java.awt.Toolkit;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoScrollBarControl extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+
+ log.println("maximize the window size");
+ XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xTextDoc);
+ XFrame xFrame = xModel.getCurrentController().getFrame();
+ XWindow xWin = xFrame.getContainerWindow();
+
+ Toolkit tk = Toolkit.getDefaultToolkit();
+ Dimension dim = tk.getScreenSize();
+
+ Rectangle newPosSize = xWin.getPosSize();
+ newPosSize.Width = new Double(dim.getWidth()).intValue();
+ newPosSize.Height = new Double(dim.getHeight()).intValue();
+ newPosSize.X = 0;
+ newPosSize.Y = 0;
+
+ xWin.setPosSize(newPosSize.X, newPosSize.Y, newPosSize.Width,
+ newPosSize.Height, com.sun.star.awt.PosSize.POSSIZE);
+
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "ScrollBar",
+ "UnoControlScrollBar");
+
+ 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());
+
+ //get the ScrollBarControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = 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 ScrollBarControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ScrollBarControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlScrollBar object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //adding Object-Relation for XScrollBar
+ tEnv.addObjRelation("Document", xTextDoc);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControl.java
new file mode 100644
index 000000000000..332cf133568f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControl.java
@@ -0,0 +1,149 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoSpinButtonControl extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) Param.getMSF());
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "SpinButton",
+ "UnoControlSpinButton");
+
+ 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());
+
+ //get the SpinButtonControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = 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 SpinButtonControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get SpinButtonControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlSpinButton object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //adding Object-Relation for XScrollBar
+ tEnv.addObjRelation("Document", xTextDoc);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+
+ tEnv.addObjRelation("Document", xTextDoc);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControlModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControlModel.java
new file mode 100644
index 000000000000..fff32d4aeb3d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControlModel.java
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+public class UnoSpinButtonControlModel extends TestCase {
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.awt.UnoControlSpinButtonModel</code>.
+ */
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log)
+ throws StatusException {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlSpinButtonModel");
+ } catch (Exception e) {
+ }
+
+ log.println("creating a new environment for object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME",
+ "com.sun.star.awt.UnoControlSpinButtonModel");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java
new file mode 100644
index 000000000000..5be41be69f27
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java
@@ -0,0 +1,303 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlContainer;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDialog;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.tree.XMutableTreeDataModel;
+import com.sun.star.awt.tree.XMutableTreeNode;
+import com.sun.star.awt.tree.XTreeControl;
+import com.sun.star.awt.tree.XTreeNode;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.ucb.CommandAbortedException;
+import com.sun.star.ucb.XSimpleFileAccess;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.PropertyName;
+import util.SOfficeFactory;
+import util.UITools;
+import util.utils;
+
+
+public class UnoTreeControl extends TestCase {
+ private static XTextDocument xTextDoc;
+ private static XMutableTreeDataModel mXTreeDataModel;
+ private static XMultiServiceFactory mxMSF;
+ private static PrintWriter log;
+ private static boolean debug = false;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ this.log = log;
+ debug = Param.getBool(PropertyName.DEBUG_IS_ACTIVE);
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+// log.println(" disposing xTextDoc ");
+//
+// util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ String sTreeControlName = "UnoTreeControl-Test";
+ mxMSF = (XMultiServiceFactory) Param.getMSF();
+ XInterface oObj = null;
+ XMutableTreeNode xNode = null;
+
+ try {
+
+ mXTreeDataModel = (XMutableTreeDataModel )
+ UnoRuntime.queryInterface(XMutableTreeDataModel.class,
+ mxMSF.createInstance("com.sun.star.awt.tree.MutableTreeDataModel"));
+
+ xNode = mXTreeDataModel.createNode("UnoTreeControl", false);
+
+ xNode.setDataValue( "UnoTreeControl");
+ xNode.setExpandedGraphicURL( "private:graphicrepository/sd/res/triangle_down.png");
+ xNode.setCollapsedGraphicURL( "private:graphicrepository/sd/res/triangle_right.png");
+
+ fillNode(xNode);
+
+ mXTreeDataModel.setRoot(xNode);
+
+ XControlModel xDialogModel = (XControlModel)
+ UnoRuntime.queryInterface(XControlModel.class,
+ mxMSF.createInstance("com.sun.star.awt.UnoControlDialogModel"));
+
+ XPropertySet xDialogPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xDialogModel);
+ xDialogPropertySet.setPropertyValue( "PositionX", new Integer(50) );
+ xDialogPropertySet.setPropertyValue( "PositionY", new Integer(50) );
+ xDialogPropertySet.setPropertyValue( "Width", new Integer(256) );
+ xDialogPropertySet.setPropertyValue( "Height", new Integer(256) );
+ xDialogPropertySet.setPropertyValue( "Title", "Tree Control Test");
+
+ XMultiServiceFactory xDialogMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xDialogModel);
+
+ XControlModel xTreeControlModel = (XControlModel)
+ UnoRuntime.queryInterface(XControlModel.class,
+ xDialogMSF.createInstance("com.sun.star.awt.tree.TreeControlModel"));
+
+ XPropertySet XTreeControlModelSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTreeControlModel);
+
+ XTreeControlModelSet.setPropertyValue( "SelectionType",com.sun.star.view.SelectionType.NONE);
+ XTreeControlModelSet.setPropertyValue( "PositionX", new Integer(3 ));
+ XTreeControlModelSet.setPropertyValue( "PositionY", new Integer(3 ));
+ XTreeControlModelSet.setPropertyValue( "Width", new Integer(253));
+ XTreeControlModelSet.setPropertyValue( "Height", new Integer(253) );
+ XTreeControlModelSet.setPropertyValue( "DataModel", mXTreeDataModel );
+ XTreeControlModelSet.setPropertyValue( "ShowsRootHandles",new Boolean (false));
+ XTreeControlModelSet.setPropertyValue( "ShowsHandles", new Boolean (false));
+ XTreeControlModelSet.setPropertyValue( "RootDisplayed", new Boolean (true));
+ XTreeControlModelSet.setPropertyValue( "Editable", new Boolean (true ));
+
+ XNameContainer xDialogModelContainer = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class, xDialogModel);
+
+ xDialogModelContainer.insertByName( sTreeControlName, xTreeControlModel);
+
+ XControl xDialogControl = (XControl)
+ UnoRuntime.queryInterface(XControl.class,
+ mxMSF.createInstance("com.sun.star.awt.UnoControlDialog"));
+
+ xDialogControl.setModel( xDialogModel );
+
+ XToolkit xToolkit = (XToolkit) UnoRuntime.queryInterface(XToolkit.class,
+ mxMSF.createInstance("com.sun.star.awt.Toolkit" ));
+
+ xDialogControl.createPeer( xToolkit, null );
+
+ // get the peers of the sub controls from the dialog peer container
+ XControlContainer xDialogContainer = (XControlContainer)
+ UnoRuntime.queryInterface(XControlContainer.class ,xDialogControl);
+
+ XTreeControl xTreeControl = (XTreeControl)
+ UnoRuntime.queryInterface(XTreeControl.class, xDialogContainer.getControl( sTreeControlName ));
+
+ xTreeControl.expandNode(xNode);
+ oObj = xTreeControl;
+
+ XDialog xDialog = (XDialog) UnoRuntime.queryInterface(XDialog.class, xDialogControl);
+
+ execurteDialog aDialog = new execurteDialog(xDialog);
+
+ aDialog.start();
+
+// xDialog.execute();
+
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace();
+ }
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("XTreeControl_Node", xNode);
+
+ //com.sun.star.view.XSelectionSupplier
+ try {
+
+ System.out.println("count of children: " + xNode.getChildCount());
+ tEnv.addObjRelation("Selections", new Object[]{xNode.getChildAt(0), xNode});
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ log.println("ERROR: could not add object relation 'Selections' because 'xNode.getChildAt(1) failed: " +
+ ex.toString());
+ }
+
+ tEnv.addObjRelation("Comparer",
+ new Comparator() {
+ public int compare(Object o1, Object o2) {
+ XMutableTreeNode xNode1 = (XMutableTreeNode) UnoRuntime.queryInterface(
+ XMutableTreeNode.class, o1);
+ XTreeNode xNode2a = null;
+ try {
+ xNode2a = (XTreeNode) AnyConverter.toObject(new Type(XTreeNode.class), o2);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ ex.printStackTrace();
+ }
+
+ XMutableTreeNode xNode2 = (XMutableTreeNode) UnoRuntime.queryInterface(
+ XMutableTreeNode.class, xNode2a);
+
+ if (((String) xNode1.getDataValue()).equals((String)xNode2.getDataValue())) {
+ return 0;
+ }
+
+ return -1;
+ }
+ });
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ private void fillNode( XMutableTreeNode xNode ){
+
+ if( xNode.getChildCount() == 0 )
+ {
+ String sParentPath = (String) xNode.getDataValue();
+
+ String officeUserPath = utils.getOfficeUserPath(mxMSF);
+ Object fileacc = null;
+ try {
+ fileacc = mxMSF.createInstance("com.sun.star.comp.ucb.SimpleFileAccess");
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace();
+ }
+ XSimpleFileAccess sA = (XSimpleFileAccess)
+ UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc);
+
+
+ dirlist(officeUserPath, xNode);
+ }
+ }
+
+ private void dirlist(String dir, XMutableTreeNode xNode){
+
+ Object fileacc = null;
+ try {
+ fileacc = mxMSF.createInstance("com.sun.star.comp.ucb.SimpleFileAccess");
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace();
+ }
+ XSimpleFileAccess sfa = (XSimpleFileAccess)
+ UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc);
+ XMutableTreeNode xChildNode = null;
+ try {
+ xChildNode = mXTreeDataModel.createNode(dir.substring(dir.lastIndexOf("/")+1, dir.length()), sfa.isFolder(dir));
+ xChildNode.setDataValue(dir);
+ boolean test = sfa.isFolder(dir);
+ if (sfa.isFolder(dir)){
+ xChildNode.setExpandedGraphicURL( "private:graphicrepository/sd/res/triangle_down.png");
+ xChildNode.setCollapsedGraphicURL("private:graphicrepository/sd/res/triangle_right.png");
+ String[] children = sfa.getFolderContents(dir, true);
+ if (children != null){
+ for (int i=0; i<children.length; i++) {
+ // Get filename of file or directory
+ String filename = children[i];
+ dirlist( filename , xChildNode);
+ }
+ }
+ }
+ else{
+ xChildNode.setNodeGraphicURL( "private:graphicrepository/sw/imglst/nc20010.png");
+ }
+ } catch (CommandAbortedException ex) {
+ ex.printStackTrace();
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace();
+ }
+
+ try {
+ xNode.appendChild( xChildNode );
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ private class execurteDialog extends Thread{
+ private XDialog mXDialog;
+
+ public execurteDialog(XDialog xDialog){
+ mXDialog = xDialog;
+ }
+
+ public void run() {
+ mXDialog.endExecute();
+ }
+ }
+
+
+} // finish class UnoControlRadioButton
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoTreeModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoTreeModel.java
new file mode 100644
index 000000000000..f8da7cd2082d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoTreeModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoTreeModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.tree.TreeControlModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for TreeControlModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "com.sun.star.awt.tree.TreeControlModel");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlListBoxModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/package.html b/qadevOOo/tests/java/mod/_toolkit/package.html
new file mode 100644
index 000000000000..371cdbc777fc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'toolkit'.</P>
+</BODY>
+</HTML> \ No newline at end of file