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));