Package com.sun.star.accessibility

Examples of com.sun.star.accessibility.XAccessibleContext


     *
     *  @return true if the state of the button could be changed in the desired manner
     */
     private boolean clickToggleButton(String buttonName, boolean toBePressed)
     {
        XAccessibleContext oButton =mAT.getAccessibleObjectForRole
                                (mXRoot, AccessibleRole.TOGGLE_BUTTON, buttonName);

        if (oButton != null){
            boolean isChecked = oButton.getAccessibleStateSet().contains(com.sun.star.accessibility.AccessibleStateType.CHECKED);
            if((isChecked && !toBePressed) || (!isChecked && toBePressed)){
                XAccessibleAction oAction = (XAccessibleAction)
                            UnoRuntime.queryInterface(XAccessibleAction.class, oButton);
                try{
                    // "click" the button                   
View Full Code Here


      */
     public void selectListboxItem(String ListBoxName, int nChildIndex)
            throws java.lang.Exception
     {
        try {
            XAccessibleContext xListBox = null;
           
            xListBox =mAT.getAccessibleObjectForRole(mXRoot,
                                         AccessibleRole.COMBO_BOX, ListBoxName);
            if (xListBox == null){
                xListBox =mAT.getAccessibleObjectForRole(mXRoot,
                                             AccessibleRole.PANEL, ListBoxName);
            }
            XAccessible xListBoxAccess = (XAccessible)
                         UnoRuntime.queryInterface(XAccessible.class, xListBox);
           
            // if a List is not pulled to be open all entries are not visiblle, therefore the
            // boolean argument
            XAccessibleContext xList =mAT.getAccessibleObjectForRole(
                                          xListBoxAccess, AccessibleRole.LIST, true);
            XAccessibleSelection xListSelect = (XAccessibleSelection)
                   UnoRuntime.queryInterface(XAccessibleSelection.class, xList);
           
            xListSelect.selectAccessibleChild(nChildIndex);
View Full Code Here

     public Object[] getListBoxObjects(String ListBoxName)
            throws java.lang.Exception
     {
        Vector Items = new Vector();
         try {
            XAccessibleContext xListBox = null;
            XAccessibleContext xList = null;
           
            xListBox =mAT.getAccessibleObjectForRole(mXRoot,
                                         AccessibleRole.COMBO_BOX, ListBoxName);
            if (xListBox == null){
                xListBox =mAT.getAccessibleObjectForRole(mXRoot,
                                             AccessibleRole.PANEL, ListBoxName);
            }

            if (xListBox == null){
                // get the list of TreeListBox
                xList =mAT.getAccessibleObjectForRole(mXRoot,
                                              AccessibleRole.TREE, ListBoxName);
               
            // all other list boxes have a children of kind of LIST
            } else {
               
                XAccessible xListBoxAccess = (XAccessible)
                             UnoRuntime.queryInterface(XAccessible.class, xListBox);
                // if a List is not pulled to be open all entries are not visiblle, therefore the
                // boolean argument
                xList =mAT.getAccessibleObjectForRole(
                                              xListBoxAccess, AccessibleRole.LIST, true);
            }
           
            for (int i=0;i<xList.getAccessibleChildCount();i++) {
                try {
                    XAccessible xChild = xList.getAccessibleChild(i);
                    XAccessibleContext xChildCont =
                                                  xChild.getAccessibleContext();
                    XInterface xChildInterface = (XInterface)
                        UnoRuntime.queryInterface(XInterface.class, xChildCont);
                    Items.add(xChildInterface);
                   
View Full Code Here

     public String[] getListBoxItems(String ListBoxName)
            throws java.lang.Exception
     {
        Vector Items = new Vector();
         try {
            XAccessibleContext xListBox = null;
            XAccessibleContext xList = null;
           
            xListBox =mAT.getAccessibleObjectForRole(mXRoot,
                                         AccessibleRole.COMBO_BOX, ListBoxName);
            if (xListBox == null){
                xListBox =mAT.getAccessibleObjectForRole(mXRoot,
                                             AccessibleRole.PANEL, ListBoxName);
            }

            if (xListBox == null){
                // get the list of TreeListBox
                xList =mAT.getAccessibleObjectForRole(mXRoot,
                                              AccessibleRole.TREE, ListBoxName);
               
            // all other list boxes have a children of kind of LIST
            } else {
               
                XAccessible xListBoxAccess = (XAccessible)
                             UnoRuntime.queryInterface(XAccessible.class, xListBox);
                // if a List is not pulled to be open all entries are not visiblle, therefore the
                // boolean argument
                xList =mAT.getAccessibleObjectForRole(
                                              xListBoxAccess, AccessibleRole.LIST, true);
            }
           
            for (int i=0;i<xList.getAccessibleChildCount();i++) {
                try {
                    XAccessible xChild = xList.getAccessibleChild(i);
                    XAccessibleContext xChildCont =
                                                  xChild.getAccessibleContext();
                    XInterface xChildInterface = (XInterface)
                        UnoRuntime.queryInterface(XInterface.class, xChildCont);
                    Items.add(getString(xChildInterface));
                   
View Full Code Here

     public String getTextBoxText(String TextFieldName)
        throws java.lang.Exception
     {
        String TextFieldText = null;
        try{
            XAccessibleContext xTextField =mAT.getAccessibleObjectForRole(mXRoot,
                                     AccessibleRole.SCROLL_PANE, TextFieldName);
            XAccessible xTextFieldAccess = (XAccessible)
                       UnoRuntime.queryInterface(XAccessible.class, xTextField);
            XAccessibleContext xFrame =mAT.getAccessibleObjectForRole(
                                   xTextFieldAccess, AccessibleRole.TEXT_FRAME);
            for (int i=0;i<xFrame.getAccessibleChildCount();i++) {
                try {
                    XAccessible xChild = xFrame.getAccessibleChild(i);
                    XAccessibleContext xChildCont =
                                                  xChild.getAccessibleContext();
                    XInterface xChildInterface = (XInterface)
                        UnoRuntime.queryInterface(XInterface.class, xChildCont);
                    TextFieldText += (getString(xChildInterface));
                   
View Full Code Here

     public String getMsgBoxText()
        throws java.lang.Exception
     {
        String cMessage = null;
        try{
            XAccessibleContext xMessage =mAT.getAccessibleObjectForRole(mXRoot,
                                     AccessibleRole.LABEL);
           
            XInterface xMessageInterface = (XInterface)
                UnoRuntime.queryInterface(XInterface.class, xMessage);
            cMessage += (getString(xMessageInterface));
View Full Code Here

        return (XWindow) UnoRuntime.queryInterface(XWindow.class, retWindow);
    }
   
    public void clickMiddleOfAccessibleObject(short role, String name){
       
        XAccessibleContext xAcc =mAT.getAccessibleObjectForRole(mXRoot, role, name);
        XAccessibleComponent aComp = (XAccessibleComponent) UnoRuntime.queryInterface(
                                             XAccessibleComponent.class, xAcc);
       
        System.out.println(xAcc.getAccessibleRole() + "," +
                    xAcc.getAccessibleName() + "(" +
                    xAcc.getAccessibleDescription() + "):" +
                    utils.getImplName(xAcc));
                                            
        if (aComp != null) {
            Point location = aComp.getLocationOnScreen();
            String bounds = "(" + aComp.getBounds().X + "," +
View Full Code Here

           
        }
    }
   
    public void doubleClickMiddleOfAccessibleObject(short role, String name) {
        XAccessibleContext xAcc =mAT.getAccessibleObjectForRole(mXRoot, role, name);
        XAccessibleComponent aComp = (XAccessibleComponent) UnoRuntime.queryInterface(
                                             XAccessibleComponent.class, xAcc);
       
        System.out.println(xAcc.getAccessibleRole() + "," +
                    xAcc.getAccessibleName() + "(" +
                    xAcc.getAccessibleDescription() + "):" +
                    utils.getImplName(xAcc));
                                            
        if (aComp != null) {
            Point location = aComp.getLocationOnScreen();
            String bounds = "(" + aComp.getBounds().X + "," +
View Full Code Here

        AccessibilityTools at = new AccessibilityTools();

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

        XAccessibleContext cont = at.getAccessibleObjectForRole(
                xRoot, AccessibleRole.SHAPE, "", "AccLegend");


        oObj = cont;

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

        TestEnvironment tEnv = new TestEnvironment(oObj);

        final XAccessibleComponent acc = (XAccessibleComponent)
                UnoRuntime.queryInterface(
View Full Code Here

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

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

        XAccessibleContext cont = at.getAccessibleObjectForRole(
                xRoot, AccessibleRole.SHAPE, "", "AccWall");

        oObj = cont;

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

        TestEnvironment tEnv = new TestEnvironment(oObj);

        final XAccessibleComponent acc = (XAccessibleComponent)
                UnoRuntime.queryInterface(
View Full Code Here

TOP

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

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.