1 import java
.util
.Vector
;
2 import com
.sun
.star
.lang
.IndexOutOfBoundsException
;
5 Base class for all tree nodes.
7 class AccessibleTreeNode
9 /// The parent node. It is null for the root node.
10 protected AccessibleTreeNode maParent
;
12 /// The object to be displayed.
13 private Object maDisplayObject
;
15 public AccessibleTreeNode (Object aDisplayObject
, AccessibleTreeNode aParent
)
17 maDisplayObject
= aDisplayObject
;
26 public AccessibleTreeNode
getParent ()
31 public Object
getDisplayObject ()
33 return maDisplayObject
;
36 public int getChildCount ()
41 public AccessibleTreeNode
getChild (int nIndex
)
42 throws IndexOutOfBoundsException
44 throw new IndexOutOfBoundsException();
47 public AccessibleTreeNode
getChildNoCreate (int nIndex
)
48 throws IndexOutOfBoundsException
50 throw new IndexOutOfBoundsException();
53 public boolean removeChild (int nIndex
)
54 throws IndexOutOfBoundsException
56 throw new IndexOutOfBoundsException();
59 public int indexOf (AccessibleTreeNode aNode
)
64 /** Create a path to this node by first asking the parent for its path
65 and then appending this object.
67 public void createPath (java
.util
.Vector aPath
)
70 maParent
.createPath (aPath
);
74 public Object
[] createPath ()
76 Vector aPath
= new Vector (1);
78 return aPath
.toArray();
81 public boolean isLeaf()
86 public String
toString()
88 return maDisplayObject
.toString();
91 /** get names of suported actions */
92 public String
[] getActions ()
94 return new String
[] {};
98 public void performAction (int nIndex
)