Package com.sun.star.accessibility

Examples of com.sun.star.accessibility.XAccessibleRelationSet


    public String[] getTestMethodNames() {
        return new String[]{"contents_flows_to","contents_flows_from"};
    }

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


        assure("didn't gain correct target paragraph",
               atarget.getText().equals(paraTxt2.getText()) );
    }

    public void contents_flows_from() {
        XAccessibleRelationSet set = getAccessibleRelation(para2);

        boolean res = true;
        short[] relationtypes = new short[2];
        XAccessibleText[] atargets = new XAccessibleText[2];
        if (set != null) {
            log.println("Count of relations "+set.getRelationCount());
            assure("didn't gain correct count of relations",
                   set.getRelationCount() == 2);
            try {
                short tmprelation = set.getRelation(0).RelationType;
                if ( tmprelation == 1 )
                {
                  Object oTmp = set.getRelation(0).TargetSet[0];
                  atargets[0] = (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class, oTmp);
                  relationtypes[0] = tmprelation;
                }
                else if ( tmprelation == 2 )
                {
                  Object oTmp = set.getRelation(0).TargetSet[0];
                  atargets[1] = (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class, oTmp);
                  relationtypes[1] = tmprelation;
                }
                else
                {
                  assure("didn't gain correct relation type", false);
                }
                tmprelation = set.getRelation(1).RelationType;
                if ( tmprelation == 1 )
                {
                  Object oTmp = set.getRelation(1).TargetSet[0];
                  atargets[0] = (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class, oTmp);
                  relationtypes[0] = tmprelation;
                }
                else if ( tmprelation == 2 )
                {
                  Object oTmp = set.getRelation(1).TargetSet[0];
                  atargets[1] = (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class, oTmp);
                  relationtypes[1] = tmprelation;
                }
                else
                {
View Full Code Here

        assure("didn't gain correct target paragraph",
               atargets[1].getText().equals(paraTxt3.getText()) );
    }

    private boolean getResult(XAccessible aPara, short index, int nr) {
        XAccessibleRelationSet set = getAccessibleRelation(aPara);

        boolean res = true;
        short firstrelation=-1;
        if (set != null) {
            log.println("Count of relations "+set.getRelationCount());
            try {
                firstrelation = set.getRelation(0).RelationType;
            } catch (IndexOutOfBoundsException e) {
                log.println("Exception when getting relations "+e);
                res = false;
            }
        }
View Full Code Here

    public XAccessibleRelationSet getAccessibleRelation(XAccessible xAcc) {
        XAccessibleContext oObj = (XAccessibleContext)
        UnoRuntime.queryInterface(XAccessibleContext.class, xAcc);

        XAccessibleRelationSet set = oObj.getAccessibleRelationSet();
        return set;
    }
View Full Code Here

     * Just gets the set. <p>
     *
     * Has <b> OK </b> status if the set is not null.
     */
    public void _getAccessibleRelationSet() {
        XAccessibleRelationSet set = oObj.getAccessibleRelationSet();
        tRes.tested("getAccessibleRelationSet()", true);
    }
View Full Code Here

     * Just gets the set. <p>
     *
     * Has <b> OK </b> status if the set is not null.
     */
    public boolean _getAccessibleRelationSet() {
        XAccessibleRelationSet set = oObj.getAccessibleRelationSet();
        return set != null;
    }
View Full Code Here

     * Just gets the set. <p>
     *
     * Has <b> OK </b> status if the set is not null.
     */
    public void _getAccessibleRelationSet() {
        XAccessibleRelationSet set = oObj.getAccessibleRelationSet();
        tRes.tested("getAccessibleRelationSet()", true);
    }
View Full Code Here

    private XAccessible para3 = null;
    private XTextDocument xTextDoc = null;
    private final static String[] types = {"INVALID","CONTENT_FLOWS_FROM","CONTENT_FLOWS_TO","CONTROLLED_BY","CONTROLLER_FOR","LABEL_FOR","LABELED_BY","MEMBER_OF","SUB_WINDOW_OF"};

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

        short firstrelation=-1;
        XAccessibleText atarget=null;
        if (set != null) {
            assertEquals(
                "didn't gain correct count of relations", 1,
                set.getRelationCount());
            try {
                firstrelation = set.getRelation(0).RelationType;
                Object oTmp = set.getRelation(0).TargetSet[0];
                atarget = (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class, oTmp);
            } catch (IndexOutOfBoundsException e) {
                fail("Exception when getting relations "+e);
            }
        }
View Full Code Here

            "didn't gain correct target paragraph", atarget.getText(),
            paraTxt2.getText());
    }

    @Test public void contents_flows_from() {
        XAccessibleRelationSet set = getAccessibleRelation(para2);

        short[] relationtypes = new short[2];
        XAccessibleText[] atargets = new XAccessibleText[2];
        if (set != null) {
            assertEquals(
                "didn't gain correct count of relations", 2,
                set.getRelationCount());
            try {
                short tmprelation = set.getRelation(0).RelationType;
                if ( tmprelation == 1 )
                {
                  Object oTmp = set.getRelation(0).TargetSet[0];
                  atargets[0] = (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class, oTmp);
                  relationtypes[0] = tmprelation;
                }
                else if ( tmprelation == 2 )
                {
                  Object oTmp = set.getRelation(0).TargetSet[0];
                  atargets[1] = (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class, oTmp);
                  relationtypes[1] = tmprelation;
                }
                else
                {
                    fail("didn't gain correct relation type");
                }
                tmprelation = set.getRelation(1).RelationType;
                if ( tmprelation == 1 )
                {
                  Object oTmp = set.getRelation(1).TargetSet[0];
                  atargets[0] = (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class, oTmp);
                  relationtypes[0] = tmprelation;
                }
                else if ( tmprelation == 2 )
                {
                  Object oTmp = set.getRelation(1).TargetSet[0];
                  atargets[1] = (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class, oTmp);
                  relationtypes[1] = tmprelation;
                }
                else
                {
View Full Code Here

    public XAccessibleRelationSet getAccessibleRelation(XAccessible xAcc) {
        XAccessibleContext oObj = (XAccessibleContext)
        UnoRuntime.queryInterface(XAccessibleContext.class, xAcc);

        XAccessibleRelationSet set = oObj.getAccessibleRelationSet();
        return set;
    }
View Full Code Here

TOP

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

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.