Package com.sun.star.accessibility

Examples of com.sun.star.accessibility.XAccessibleText


        TestEnvironment tEnv = new TestEnvironment(oObj);

        tEnv.addObjRelation("EditOnly",
                            "This method isn't supported in this dialog");

        XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface(
                                       XAccessibleText.class, oObj);

        int lastone = 100;

        for (int i = 0; i < 1000; i++) {
            try {
                text.getCharacterBounds(i);
            } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
                lastone = i - 1;

                break;
            }
View Full Code Here


    }

   
    private static String getString(XInterface xInt)
    {
        XAccessibleText oText = (XAccessibleText)
                         UnoRuntime.queryInterface(XAccessibleText.class, xInt);
        return oText.getText();
    }
View Full Code Here

    public void contents_flows_to() {
        XAccessibleRelationSet set = getAccessibleRelation(para1);

        boolean res = true;
        short firstrelation=-1;
        XAccessibleText atarget=null;
        if (set != null) {
            log.println("Count of relations "+set.getRelationCount());
            assure("didn't gain correct count of relations",
                   set.getRelationCount() == 1);
            try {
                firstrelation = set.getRelation(0).RelationType;
                Object oTmp = set.getRelation(0).TargetSet[0];
                atarget = (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class, oTmp);
            } catch (IndexOutOfBoundsException e) {
                log.println("Exception when getting relations "+e);
                res = false;
            }
        }

        log.println("Expected for paragraph 0 "+types[2]);
        log.println("gained for paragraph 0 "+types[firstrelation]);
        res = types[2].equals(types[firstrelation]);
        assure("didn't gain correct relation type",res);

        log.println("Text of target paragraph "+atarget.getText());
        XAccessibleText paraTxt2 =
          (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class, para2);
        assure("didn't gain correct target paragraph",
               atarget.getText().equals(paraTxt2.getText()) );
    }
View Full Code Here

        log.println("gained for paragraph 1 "+types[relationtypes[0]]);
        res = types[1].equals(types[relationtypes[0]]);
        assure("didn't gain correct relation type",res);

        log.println("Text of target paragraph "+atargets[0].getText());
        XAccessibleText paraTxt1 =
          (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class, para1);
        assure("didn't gain correct target paragraph",
               atargets[0].getText().equals(paraTxt1.getText()) );

        log.println("### Checking "+types[2]+" for paragraph 1");
        log.println("Expected for paragraph 1 "+types[2]);
        log.println("gained for paragraph 1 "+types[relationtypes[1]]);
        res = types[2].equals(types[relationtypes[1]]);
        assure("didn't gain correct relation type",res);

        log.println("Text of target paragraph "+atargets[1].getText());
        XAccessibleText paraTxt3 =
          (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class, para3);
        assure("didn't gain correct target paragraph",
               atargets[1].getText().equals(paraTxt3.getText()) );
    }
View Full Code Here



    private void paintText (Graphics2D g)
    {
        XAccessibleText xText = null;
        // get XAccessibleText
        xText = maNode.getText();

        // Draw every character in the text string.
        if (xText != null)
        {
            String sText = xText.getText();
            try
            {
                for(int i = 0; i < sText.length(); i++)
                {
                    com.sun.star.awt.Rectangle aRect =
                        xText.getCharacterBounds(i);
                   
                    double x = maShape.x + aRect.X;
                    double y = maShape.y + aRect.Y + aRect.Height;
                   
                    g.drawString(sText.substring(i, i+1), (float)x, (float)y);
View Full Code Here

    */
    static public ObjectView Create (
        ObjectViewContainer aContainer,
        XAccessibleContext xContext)
    {
        XAccessibleText xText = (XAccessibleText)UnoRuntime.queryInterface(
                XAccessibleText.class, xContext);
        if (xText != null)
            return new TextView (aContainer);
        else
            return null;
View Full Code Here

class AccessibleTextHandler extends NodeHandler
{
    public NodeHandler createHandler (XAccessibleContext xContext)
    {
        XAccessibleText xText = (XAccessibleText) UnoRuntime.queryInterface (
            XAccessibleText.class, xContext);
        if (xText != null)
            return new AccessibleTextHandler (xText);
        else
            return null;
View Full Code Here

    }

    public AccessibleTreeNode createChild (AccessibleTreeNode aParent, int nIndex)
    {
        AccessibleTreeNode aChild = null;
        XAccessibleText xText = null;
        if (aParent instanceof AccTreeNode)
            xText = ((AccTreeNode)aParent).getText();

        try
        {
            if( xText != null )
            {
                switch( nIndex )
                {
                    case 0:
                        aChild = new StringNode (xText.getText(), aParent);
                        break;
                    case 1:
                        aChild = new StringNode ("# chars: " + xText.getCharacterCount(), aParent);
                        break;
                    case 2:
                        aChild = new StringNode (characters( xText ), aParent);
                        break;
                    case 3:
                        aChild = new StringNode ("selection: "
                            + "[" + xText.getSelectionStart()
                            + "," + xText.getSelectionEnd()
                            + "] \"" + xText.getSelectedText() + "\"",
                            aParent);
                        break;
                    case 4:
                        aChild = new StringNode ("getCaretPosition: " + xText.getCaretPosition(), aParent);
                        break;
                    case 5:
                    {
                        VectorNode aVec = new VectorNode("portions", aParent);
                        aChild = aVec;
View Full Code Here

        TestEnvironment tEnv = new TestEnvironment(oObj);

        tEnv.addObjRelation("EditOnly",
                            "This method isn't supported in this dialog");

        XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface(
                                       XAccessibleText.class, oObj);

        int lastone = 100;

        for (int i = 0; i < 1000; i++) {
            try {
                text.getCharacterBounds(i);
            } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
                lastone = i - 1;

                break;
            }
View Full Code Here

        TestEnvironment tEnv = new TestEnvironment(oObj);

        action = (XAccessibleAction) UnoRuntime.queryInterface(
                         XAccessibleAction.class, ok_button);

        XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface(
                                       XAccessibleText.class, oObj);

        XAccessibleEditableText eText = (XAccessibleEditableText) UnoRuntime.queryInterface(
                                                XAccessibleEditableText.class,
                                                oObj);

        eText.setText("LEFT");

        tEnv.addObjRelation("XAccessibleText.Text", text.getText());
       
        tEnv.addObjRelation("Destroy", "AccessibleEditableTextPara_PreviewCell");       

        final XAccessibleEditableText editText = eText;
View Full Code Here

TOP

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

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.