fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / toolkit / test / accessibility / AccessibleTreeNode.java
blobb0a8a782c0173a658d1fdf6b54b5355415986816
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 import java.util.ArrayList;
21 import com.sun.star.lang.IndexOutOfBoundsException;
23 /**
24 Base class for all tree nodes.
26 class AccessibleTreeNode
28 /// The parent node. It is null for the root node.
29 protected AccessibleTreeNode maParent;
31 /// The object to be displayed.
32 private Object maDisplayObject;
34 public AccessibleTreeNode (Object aDisplayObject, AccessibleTreeNode aParent)
36 maDisplayObject = aDisplayObject;
37 maParent = aParent;
40 public void update ()
42 // Empty
45 public AccessibleTreeNode getParent ()
47 return maParent;
50 public Object getDisplayObject ()
52 return maDisplayObject;
55 public int getChildCount ()
57 return 0;
60 public AccessibleTreeNode getChild (int nIndex)
61 throws IndexOutOfBoundsException
63 throw new IndexOutOfBoundsException();
66 public AccessibleTreeNode getChildNoCreate (int nIndex)
67 throws IndexOutOfBoundsException
69 throw new IndexOutOfBoundsException();
72 public boolean removeChild (int nIndex)
73 throws IndexOutOfBoundsException
75 throw new IndexOutOfBoundsException();
78 public int indexOf (AccessibleTreeNode aNode)
80 return -1;
83 /** Create a path to this node by first asking the parent for its path
84 and then appending this object.
86 public void createPath (java.util.List<AccessibleTreeNode> aPath)
88 if (maParent != null)
89 maParent.createPath (aPath);
90 aPath.add (this);
93 public Object[] createPath ()
95 ArrayList<AccessibleTreeNode> aPath = new ArrayList<AccessibleTreeNode> (1);
96 createPath (aPath);
97 return aPath.toArray();
100 public boolean isLeaf()
102 return true;
105 public String toString()
107 return maDisplayObject.toString();
110 /** get names of suported actions */
111 public String[] getActions ()
113 return new String[] {};
116 /** perform action */
117 public void performAction (int nIndex)