2 import com
.sun
.star
.uno
.UnoRuntime
;
3 import com
.sun
.star
.accessibility
.XAccessibleContext
;
4 import com
.sun
.star
.accessibility
.XAccessibleAction
;
5 import com
.sun
.star
.lang
.IndexOutOfBoundsException
;
7 class AccessibleActionHandler
10 public NodeHandler
createHandler (XAccessibleContext xContext
)
12 XAccessibleAction xEComponent
=
13 (XAccessibleAction
) UnoRuntime
.queryInterface (
14 XAccessibleAction
.class, xContext
);
15 if (xEComponent
!= null)
16 return new AccessibleActionHandler (xEComponent
);
21 public AccessibleActionHandler ()
25 public AccessibleActionHandler (XAccessibleAction xAction
)
28 maChildList
.setSize (1 + xAction
.getAccessibleActionCount());
31 protected static XAccessibleAction
getAction (AccTreeNode aParent
)
33 return (XAccessibleAction
) UnoRuntime
.queryInterface (
34 XAccessibleAction
.class, aParent
.getContext());
37 public AccessibleTreeNode
createChild (
38 AccessibleTreeNode aParent
,
41 AccessibleTreeNode aChild
= null;
43 if (aParent
instanceof AccTreeNode
)
45 XAccessibleAction xAction
= getAction ((AccTreeNode
)aParent
);
49 aChild
= new StringNode ("Number of actions: " + xAction
.getAccessibleActionCount(),
56 aChild
= new AccessibleActionNode (
57 "Action " + nIndex
+ " : "
58 + xAction
.getAccessibleActionDescription (nIndex
),
62 catch( IndexOutOfBoundsException e
)
64 aChild
= new StringNode ("ERROR", aParent
);