Package com.sun.star.accessibility

Examples of com.sun.star.accessibility.XAccessible


        AccessibilityTools at = new AccessibilityTools();

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

        //com.sun.star.accessibility.AccessibleRole
        at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);

        oObj = AccessibilityTools.SearchedContext;
View Full Code Here


        shortWait();

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

        at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));

        at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
View Full Code Here

        } catch (InterruptedException ex) {}

        AccessibilityTools at = new AccessibilityTools();

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

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

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

        AccessibilityTools at = new AccessibilityTools();

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

        at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);

        oObj = AccessibilityTools.SearchedContext;
View Full Code Here

        // 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;
        }
        System.out.println("PARENT: " + parent.getAccessibleContext().getAccessibleName());
        accPC = (XAccessibleComponent)
                UnoRuntime.queryInterface(XAccessibleComponent.class, parent);

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

        for (int i=0; i<cCount; i++) {
            try {
                XAccessible xA = parent.getAccessibleContext().getAccessibleChild(i);
                System.out.println("NAME object " + i + ": " + xA.getAccessibleContext().getAccessibleName());
            } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
                failed(iabe.getMessage());
                return;
            }
        }
View Full Code Here

        // 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;
        }

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

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

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

        if (childCount != 0)
            failed("Could access footer although it was not visible on page.");
View Full Code Here

        }

        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
View Full Code Here

        // 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());
View Full Code Here

            res &= true;
        }

        try {
            log.print("getAccessibleCellAt(" + rowCount + ",0):");
            XAccessible xCellAc = oObj.getAccessibleCellAt(rowCount, 0);
            log.println(xCellAc);
            log.println("Exception was expected");
            res &= false;
        } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
            log.println("expected exception");
View Full Code Here

    /**
     * Just calls the method.
     */
    public void _getAccessibleCaption() {
        XAccessible caption = oObj.getAccessibleCaption();
        log.println("getAccessibleCaption(): " + caption);
        tRes.tested("getAccessibleCaption()", true);
    }
View Full Code Here

TOP

Related Classes of com.sun.star.accessibility.XAccessible

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.