Example usage for javax.accessibility AccessibleSelection getAccessibleSelectionCount

List of usage examples for javax.accessibility AccessibleSelection getAccessibleSelectionCount

Introduction

In this page you can find the example usage for javax.accessibility AccessibleSelection getAccessibleSelectionCount.

Prototype

public int getAccessibleSelectionCount();

Source Link

Document

Returns the number of Accessible children currently selected.

Usage

From source file:MainClass.java

void dumpSelectionInfo(AccessibleContext ac) {
    AccessibleSelection as = ac.getAccessibleSelection();
    if (as != null) {
        int count = as.getAccessibleSelectionCount();

        for (int i = 0; i < count; i++) {
            Accessible a = as.getAccessibleSelection(i);
            AccessibleContext ac2 = a.getAccessibleContext();
            String s = ac2.getAccessibleName();
            System.out.println("Name = " + s);
        }/*  w  w w.j a v  a 2 s . co  m*/

        return;
    }

    int nChildren = ac.getAccessibleChildrenCount();

    for (int i = 0; i < nChildren; i++)
        dumpSelectionInfo(ac.getAccessibleChild(i).getAccessibleContext());
}