Package util

Examples of util.AccessibilityTools


        } catch (Exception e) {
            e.printStackTrace();
        }

        // get the accessible content
        AccessibilityTools at = new AccessibilityTools();

        XWindow xWindow = at.getCurrentWindow(mXMSF, aModel);
        XAccessible xRoot = at.getAccessibleObject(xWindow);
        XAccessible parent = null;

        try {
            parent = at.getAccessibleObjectForRole
                (xRoot, AccessibleRole.HEADER, "").getAccessibleChild(0);
            oObj = parent.getAccessibleContext().getAccessibleChild(0);
        } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
            failed(iabe.getMessage());
            return;
        }

        log.println("ImplementationName " + utils.getImplName(oObj));

        XAccessibleComponent accPC = (XAccessibleComponent)
                UnoRuntime.queryInterface(XAccessibleComponent.class, parent);

        log.println("Parent-BoundsX= "+accPC.getBounds().X);
        log.println("Parent-BoundsY= "+accPC.getBounds().Y);
        log.println("Parent-BoundsWidth= "+accPC.getBounds().Width);
        log.println("Parent-BoundsHeight= "+accPC.getBounds().Height);

        XAccessibleComponent accPPC = (XAccessibleComponent)
                        UnoRuntime.queryInterface(XAccessibleComponent.class,
                        parent.getAccessibleContext().getAccessibleParent());

        log.println("P-Parent-BoundsX= "+accPPC.getBounds().X);
        log.println("P-Parent-BoundsY= "+accPPC.getBounds().Y);
        log.println("P-Parent-BoundsWidth= "+accPPC.getBounds().Width);
        log.println("P-Parent-BoundsHeight= "+accPPC.getBounds().Height);

        try {
            Thread.sleep(500);
        } catch (InterruptedException ex) {}

        log.println("Press any key when the second line is on top");
        try{
            byte[]b = new byte[16];
            System.in.read(b);
        } catch (Exception e) {
            e.printStackTrace();
        }

        try {
            log.println("ChildCount: "+
                    parent.getAccessibleContext().getAccessibleChildCount());
            log.println("Getting child 0 again");
            oObj = parent.getAccessibleContext().getAccessibleChild(0);
        } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
            failed(iabe.getMessage());
            return;
        }

        XAccessibleText accT = (XAccessibleText)
                UnoRuntime.queryInterface(XAccessibleText.class, oObj);
        log.println("Getting the text: "+accT.getText());

        XAccessibleComponent accC = (XAccessibleComponent)
                UnoRuntime.queryInterface(XAccessibleComponent.class, oObj);
        log.println("BoundsX= "+accC.getBounds().X);
        log.println("BoundsY= "+accC.getBounds().Y);
        log.println("BoundsWidth= "+accC.getBounds().Width);
        log.println("BoundsHeight= "+accC.getBounds().Height);

        accPC = (XAccessibleComponent)
                UnoRuntime.queryInterface(XAccessibleComponent.class, parent);

        log.println("Parent-BoundsX= "+accPC.getBounds().X);
        log.println("Parent-BoundsY= "+accPC.getBounds().Y);
        log.println("Parent-BoundsWidth= "+accPC.getBounds().Width);
        log.println("Parent-BoundsHeight= "+accPC.getBounds().Height);

        accPPC = (XAccessibleComponent)
        UnoRuntime.queryInterface(XAccessibleComponent.class,
                        parent.getAccessibleContext().getAccessibleParent());

        log.println("P-Parent-BoundsX= "+accPPC.getBounds().X);
        log.println("P-Parent-BoundsY= "+accPPC.getBounds().Y);
        log.println("P-Parent-BoundsWidth= "+accPPC.getBounds().Width);
        log.println("P-Parent-BoundsHeight= "+accPPC.getBounds().Height);



        log.println("Press any key when the footer is visible.");
        try{
            byte[]b = new byte[16];
            System.in.read(b);
        } catch (Exception e) {
            e.printStackTrace();
        }

        try {
            parent = at.getAccessibleObjectForRole
                (xRoot, AccessibleRole.FOOTER, "").getAccessibleChild(0);
        } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
            failed(iabe.getMessage());
            return;
        }

        accPC = (XAccessibleComponent)
                UnoRuntime.queryInterface(XAccessibleComponent.class, parent);

        try {
            log.println("ChildCount: "+
                    parent.getAccessibleContext().getAccessibleChildCount());
            log.println("Getting child 0 again");
            oObj = parent.getAccessibleContext().getAccessibleChild(0);
        } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
            failed(iabe.getMessage());
            return;
        }

        accT = (XAccessibleText)
                UnoRuntime.queryInterface(XAccessibleText.class, oObj);
        log.println("Getting the text: "+accT.getText());

        accC = (XAccessibleComponent)
                UnoRuntime.queryInterface(XAccessibleComponent.class, oObj);
        log.println("BoundsX= "+accC.getBounds().X);
        log.println("BoundsY= "+accC.getBounds().Y);
        log.println("BoundsWidth= "+accC.getBounds().Width);
        log.println("BoundsHeight= "+accC.getBounds().Height);

        accPC = (XAccessibleComponent)
                UnoRuntime.queryInterface(XAccessibleComponent.class, parent);

        log.println("Parent-BoundsX= "+accPC.getBounds().X);
        log.println("Parent-BoundsY= "+accPC.getBounds().Y);
        log.println("Parent-BoundsWidth= "+accPC.getBounds().Width);
        log.println("Parent-BoundsHeight= "+accPC.getBounds().Height);

        accPPC = (XAccessibleComponent)
        UnoRuntime.queryInterface(XAccessibleComponent.class,
                        parent.getAccessibleContext().getAccessibleParent());

        log.println("P-Parent-BoundsX= "+accPPC.getBounds().X);
        log.println("P-Parent-BoundsY= "+accPPC.getBounds().Y);
        log.println("P-Parent-BoundsWidth= "+accPPC.getBounds().Width);
        log.println("P-Parent-BoundsHeight= "+accPPC.getBounds().Height);


        log.println("Press any key when the page content is on top");
        try{
            byte[]b = new byte[16];
            System.in.read(b);
        } catch (Exception e) {
            e.printStackTrace();
        }

        try {
            parent = at.getAccessibleObjectForRole
                (xRoot, AccessibleRole.DOCUMENT, "").getAccessibleChild(0);
        } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
            failed(iabe.getMessage());
            return;
        }
View Full Code Here


        } catch (Exception e) {
            e.printStackTrace();
        }

        // get the accessible content
        AccessibilityTools at = new AccessibilityTools();

        XWindow xWindow = at.getCurrentWindow(mXMSF, aModel);
        XAccessible xRoot = at.getAccessibleObject(xWindow);
        XAccessible parent = null;

        try {
            parent = at.getAccessibleObjectForRole
                (xRoot, AccessibleRole.HEADER, "").getAccessibleChild(0);
            oObj = parent.getAccessibleContext().getAccessibleChild(0);
        } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
            failed(iabe.getMessage());
            return;
        }

        log.println("ImplementationName " + utils.getImplName(oObj));

        XAccessibleComponent accPC = (XAccessibleComponent)
                UnoRuntime.queryInterface(XAccessibleComponent.class, parent);

        log.println("Parent-BoundsX= "+accPC.getBounds().X);
        log.println("Parent-BoundsY= "+accPC.getBounds().Y);
        log.println("Parent-BoundsWidth= "+accPC.getBounds().Width);
        log.println("Parent-BoundsHeight= "+accPC.getBounds().Height);

        XAccessibleComponent accPPC = (XAccessibleComponent)
                        UnoRuntime.queryInterface(XAccessibleComponent.class,
                        parent.getAccessibleContext().getAccessibleParent());

        log.println("P-Parent-BoundsX= "+accPPC.getBounds().X);
        log.println("P-Parent-BoundsY= "+accPPC.getBounds().Y);
        log.println("P-Parent-BoundsWidth= "+accPPC.getBounds().Width);
        log.println("P-Parent-BoundsHeight= "+accPPC.getBounds().Height);

        try {
            Thread.sleep(500);
        } catch (InterruptedException ex) {}

        log.println("Press any key when the header is not visible.");
        try{
            byte[]b = new byte[16];
            System.in.read(b);
        } catch (Exception e) {
            e.printStackTrace();
        }

        int childCount = 0;
        childCount =
                parent.getAccessibleContext().getAccessibleChildCount();
        log.println("ChildCount: "+childCount);

        if (childCount != 0)
            failed("Could access header although it was not visible on page.");


        try {
            parent = at.getAccessibleObjectForRole
                (xRoot, AccessibleRole.FOOTER, "").getAccessibleChild(0);
        } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
            failed(iabe.getMessage());
            return;
        }
View Full Code Here

            Thread.currentThread().sleep(500) ;
        } catch (InterruptedException e) {
            System.out.println("While waiting :" + e) ;
        }

        AccessibilityTools at = new AccessibilityTools();

        XWindow xWindow = at.getCurrentWindow(mXMSF, xModel);
        XAccessible xRoot = at.getAccessibleObject(xWindow);

//        log.println("ImplementationName " + utils.getImplName(oObj));

        log.println("Press any key when the header cell is on top.");
        try{
            byte[]b = new byte[16];
            System.in.read(b);
        } catch (Exception e) {
            e.printStackTrace();
        }


        XAccessible parent = null;

        try {
            System.out.println("Count: " +at.getAccessibleObjectForRole
                (xRoot, AccessibleRole.TABLE, "").getAccessibleChildCount());
//            parent = at.getAccessibleObjectForRole
//                (xRoot, AccessibleRole.TABLE, "").getAccessibleChild(0);
//            oObj = parent.getAccessibleContext().getAccessibleChild(1);
            System.out.println("Getting child 2");
            oObj = at.getAccessibleObjectForRole
                (xRoot, AccessibleRole.TABLE, "").getAccessibleChild(2);
        } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
            failed(iabe.getMessage());
            return;
        }
View Full Code Here

        } catch (Exception e) {
            e.printStackTrace();
        }

        // get the accessible content
        AccessibilityTools at = new AccessibilityTools();

        XWindow xWindow = at.getCurrentWindow(mXMSF, aModel);
        XAccessible xRoot = at.getAccessibleObject(xWindow);
        XAccessible parent = null;

        try {
            XAccessibleContext con = at.getAccessibleObjectForRole
                                (xRoot, AccessibleRole.SHAPE, "");
            log.println("Name of AccessibleContext: " + con.getAccessibleName());
            oObj = con;
        } catch (Exception e) {
            failed(e.getMessage());
View Full Code Here

            (!mousePressed) && (!mouseReleased));
    }

    protected boolean clickOnSheet() {
        log.println("try to open contex menu...");
        AccessibilityTools at = new AccessibilityTools();
       
        XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)tParam.getMSF(), docModel);
       
        XAccessible xRoot = at.getAccessibleObject(xWindow);
       
        XInterface oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL);
       
        XAccessibleComponent window = (XAccessibleComponent) UnoRuntime.queryInterface(
                XAccessibleComponent.class, oObj);
       
        Point point = window.getLocationOnScreen();
View Full Code Here

        XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
                XExtendedToolkit.class, toolkit);
       
        XAccessible xRoot = null;
       
        AccessibilityTools at = new AccessibilityTools();
       
        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");
        }
       
        XAccessibleContext oPopMenu = at.getAccessibleObjectForRole(xRoot, AccessibleRole.POPUP_MENU,true);
       
        log.println("ImplementationName: " + util.utils.getImplName(oPopMenu));
       
        XAccessible xHelp = null;
        try{
View Full Code Here

    }
   
    private void openContextMenu(XModel xModel){
       
        log.println("try to open contex menu...");
        AccessibilityTools at = new AccessibilityTools();
       
        xWindow = at.getCurrentWindow(xMSF, xModel);
       
        XAccessible xRoot = at.getAccessibleObject(xWindow);
       
        XInterface oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL);
       
        XAccessibleComponent window = (XAccessibleComponent) UnoRuntime.queryInterface(
                XAccessibleComponent.class, oObj);
       
        point = window.getLocationOnScreen();
View Full Code Here

            throw new StatusException(Status.failed("Couldn't change mode"));
        }

        shortWait();

        AccessibilityTools at = new AccessibilityTools();

        XWindow xWindow = at.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), xModel);
        XAccessible xRoot = at.getAccessibleObject(xWindow);

        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE, "A");

        if (oObj == null) {
            log.println("Version with a fixed #103863#");
            oObj = at.getAccessibleObjectForRole(xRoot,
                                                 AccessibleRole.TABLE_CELL,
                                                 true);
        }

        log.println("ImplementationName " + utils.getImplName(oObj));
View Full Code Here

            throw new StatusException(Status.failed("Couldn't change mode"));
        }

        shortWait();

        AccessibilityTools at = new AccessibilityTools();

        XWindow xWindow = at.getCurrentContainerWindow((XMultiServiceFactory)Param.getMSF(), xModel);
        XAccessible xRoot = at.getAccessibleObject(xWindow);
       
        at.printAccessibleTree(log,xRoot, Param.getBool(PropertyName.DEBUG_IS_ACTIVE));
       
        at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE);

        oObj = AccessibilityTools.SearchedContext;

        log.println("ImplementationName " + utils.getImplName(oObj));

        TestEnvironment tEnv = new TestEnvironment( oObj );

        XAccessibleContext zoomIn =
            at.getAccessibleObjectForRole(xRoot,AccessibleRole.PUSH_BUTTON, "Zoom In");
       
        log.println("Getting "+ zoomIn.getAccessibleName());
       
        final XAccessibleAction pressZoom = (XAccessibleAction)
                    UnoRuntime.queryInterface(XAccessibleAction.class, zoomIn);
View Full Code Here

            shortWait();
            xWindow = (XWindow)UnoRuntime.queryInterface(
                                    XWindow.class,tk.getActiveTopWindow());

            shortWait();
            AccessibilityTools at = new AccessibilityTools();
            XAccessible xRoot = at.getAccessibleObject(xWindow);
            XAccessibleContext parentContext = null;

            log.println("Get the accessible status bar.");
            parentContext = at.getAccessibleObjectForRole(
                                        xRoot, AccessibleRole.STATUS_BAR, "");
            shortWait();
            if ( parentContext == null ) {
                log.println("Could not get the test object: set the correct focus in the next 30 seconds.");
                shortWait(30000);
                parentContext = at.getAccessibleObjectForRole(
                                        xRoot, AccessibleRole.STATUS_BAR, "");

                if ( parentContext == null )
                    failed("Could not create a test object.");
            }
View Full Code Here

TOP

Related Classes of util.AccessibilityTools

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.