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