1 2 import com.sun.star.uno.UnoRuntime; 3 import com.sun.star.accessibility.XAccessibleContext; 4 import com.sun.star.accessibility.XAccessibleHypertext; 5 6 7 class AccessibleHypertextHandler extends AccessibleTreeHandler 8 { 9 public NodeHandler createHandler (XAccessibleContext xContext) 10 { 11 XAccessibleHypertext xText = 12 (XAccessibleHypertext) UnoRuntime.queryInterface ( 13 XAccessibleHypertext.class, xContext); 14 if (xText != null) 15 return new AccessibleHypertextHandler (xText); 16 else 17 return null; 18 } 19 20 public AccessibleHypertextHandler () 21 { 22 } 23 24 public AccessibleHypertextHandler (XAccessibleHypertext xText) 25 { 26 if (xText != null) 27 maChildList.setSize (1); 28 } 29 30 protected static XAccessibleHypertext getHypertext (AccTreeNode aNode) 31 { 32 XAccessibleHypertext xHypertext = 33 (XAccessibleHypertext) UnoRuntime.queryInterface ( 34 XAccessibleHypertext.class, aNode.getContext()); 35 return xHypertext; 36 } 37 38 public AccessibleTreeNode getChild (AccessibleTreeNode aParent, int nIndex) 39 { 40 return new StringNode ("interface XAccessibleHypertext is supported", aParent); 41 } 42 } 43