Kaydet (Commit) c184b5db authored tarafından Rüdiger Timm's avatar Rüdiger Timm

INTEGRATION: CWS qadev28 (1.12.28); FILE MERGED

2006/11/27 19:30:33 cn 1.12.28.1: #i72041# use UITools to get the current document view
üst 0a3702c9
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: AccessibleToolBox.java,v $ * $RCSfile: AccessibleToolBox.java,v $
* *
* $Revision: 1.12 $ * $Revision: 1.13 $
* *
* last change: $Author: kz $ $Date: 2005-11-02 18:19:16 $ * last change: $Author: rt $ $Date: 2007-02-20 14:22:23 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -55,6 +55,7 @@ import lib.TestParameters; ...@@ -55,6 +55,7 @@ import lib.TestParameters;
import util.AccessibilityTools; import util.AccessibilityTools;
import util.DesktopTools; import util.DesktopTools;
import util.SOfficeFactory; import util.SOfficeFactory;
import util.UITools;
/** /**
...@@ -89,8 +90,8 @@ public class AccessibleToolBox extends TestCase { ...@@ -89,8 +90,8 @@ public class AccessibleToolBox extends TestCase {
*/ */
protected void initialize(TestParameters Param, PrintWriter log) { protected void initialize(TestParameters Param, PrintWriter log) {
the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
DesktopTools.createDesktop( DesktopTools.createDesktop(
(XMultiServiceFactory) Param.getMSF())); (XMultiServiceFactory) Param.getMSF()));
} }
/** /**
...@@ -127,18 +128,17 @@ public class AccessibleToolBox extends TestCase { ...@@ -127,18 +128,17 @@ public class AccessibleToolBox extends TestCase {
* @see com.sun.star.accessibility.XAccessibleEventBroadcaster * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
*/ */
protected TestEnvironment createTestEnvironment(TestParameters tParam, protected TestEnvironment createTestEnvironment(TestParameters tParam,
PrintWriter log) { PrintWriter log) {
log.println("creating a test environment"); log.println("creating a test environment");
if (xTextDoc != null) { if (xTextDoc != null) {
util.DesktopTools.closeDoc(xTextDoc); util.DesktopTools.closeDoc(xTextDoc);
} }
; XMultiServiceFactory msf = (XMultiServiceFactory) tParam.getMSF();
// get a soffice factory object // get a soffice factory object
SOfficeFactory SOF = SOfficeFactory.getFactory( SOfficeFactory SOF = SOfficeFactory.getFactory(msf);
(XMultiServiceFactory) tParam.getMSF());
try { try {
log.println("creating a text document"); log.println("creating a text document");
...@@ -150,20 +150,26 @@ public class AccessibleToolBox extends TestCase { ...@@ -150,20 +150,26 @@ public class AccessibleToolBox extends TestCase {
} }
XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
xTextDoc); xTextDoc);
XInterface oObj = null; XInterface oObj = null;
AccessibilityTools at = new AccessibilityTools(); UITools oUI = new UITools(msf, aModel);
XWindow xWindow = at.getCurrentWindow( XWindow xWindow = null;
(XMultiServiceFactory) tParam.getMSF(), try {
aModel); xWindow = oUI.getActiveTopWindow();
} catch (Exception ex) {
ex.printStackTrace(log);
throw new StatusException("Couldn't get active top window", ex);
}
XAccessible xRoot = at.getAccessibleObject(xWindow); AccessibilityTools at = new AccessibilityTools();
XAccessible xRoot = at.getAccessibleObject(xWindow);
at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TOOL_BAR); oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TOOL_BAR);
log.println("ImplementationName: " + util.utils.getImplName(oObj)); log.println("ImplementationName: " + util.utils.getImplName(oObj));
...@@ -183,11 +189,11 @@ public class AccessibleToolBox extends TestCase { ...@@ -183,11 +189,11 @@ public class AccessibleToolBox extends TestCase {
util.dbg.printInterfaces(child); util.dbg.printInterfaces(child);
final XAccessibleAction action = (XAccessibleAction) UnoRuntime.queryInterface( final XAccessibleAction action = (XAccessibleAction) UnoRuntime.queryInterface(
XAccessibleAction.class, XAccessibleAction.class,
child); child);
tEnv.addObjRelation("EventProducer", tEnv.addObjRelation("EventProducer",
new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
public void fireEvent() { public void fireEvent() {
try { try {
action.doAccessibleAction(0); action.doAccessibleAction(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment