1 import javax
.swing
.JOptionPane
;
2 import com
.sun
.star
.accessibility
.XAccessibleAction
;
5 Base class for all tree nodes.
7 class AccessibleActionNode
10 public AccessibleActionNode (String aDisplayObject
,
11 AccessibleTreeNode aParent
,
14 super (aDisplayObject
, aParent
);
15 mnActionIndex
= nActionIndex
;
18 public String
[] getActions ()
20 return new String
[] {"Perform Action"};
24 public void performAction (int nIndex
)
28 boolean bResult
= false;
29 if (getParent() instanceof AccTreeNode
)
32 bResult
= AccessibleActionHandler
.getAction(
33 (AccTreeNode
)getParent()).doAccessibleAction (
36 catch (com
.sun
.star
.lang
.IndexOutOfBoundsException e
)
40 JOptionPane
.showMessageDialog (null,
41 "performed action " + mnActionIndex
42 + (bResult?
" with":" without") + " success",
43 "Action " + mnActionIndex
,
44 JOptionPane
.INFORMATION_MESSAGE
);
47 private int mnActionIndex
;