summaryrefslogtreecommitdiff
path: root/toolkit/test/accessibility/AccTreeNode.java
diff options
context:
space:
mode:
authorAndre Fischer <af@openoffice.org>2002-04-12 13:10:13 +0000
committerAndre Fischer <af@openoffice.org>2002-04-12 13:10:13 +0000
commit03ac7c8170d926aa6f9f383e7781f633f3487047 (patch)
tree6a5a1a507bdc2e58d217aedb951f32193e817421 /toolkit/test/accessibility/AccTreeNode.java
parent21e3539f99e001207ec881503f0263cd5ab85bb5 (diff)
#97772# Added update function to handlers.
Diffstat (limited to 'toolkit/test/accessibility/AccTreeNode.java')
-rw-r--r--toolkit/test/accessibility/AccTreeNode.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/toolkit/test/accessibility/AccTreeNode.java b/toolkit/test/accessibility/AccTreeNode.java
index 36d656676176..e3564b8b1105 100644
--- a/toolkit/test/accessibility/AccTreeNode.java
+++ b/toolkit/test/accessibility/AccTreeNode.java
@@ -275,4 +275,35 @@ class AccTreeNode
}
return null;
}
+
+ /** Update the specified handlers. This results in re-reading the
+ information regarding the XAccessibleComponentInterface.
+ @return
+ The returned array containes the indices of the updated children
+ and can be used to create a TreeModelEvent.
+ */
+ public Vector update (java.lang.Class class1)
+ {return update (class1, null); }
+ public Vector update (java.lang.Class class1, java.lang.Class class2)
+ {
+ Vector aChildIndices = new Vector();
+ int nOffset = 0;
+ for(int i=0; i < maHandlers.size(); i++)
+ {
+ HandlerDescriptor aDescriptor = getHandlerDescriptor (i);
+ if ((class1.isInstance(aDescriptor.maHandler))
+ || (class2 !=null && class2.isInstance(aDescriptor.maHandler)))
+ {
+ aDescriptor.maHandler.update(this);
+ // Get updated number of children.
+ int nChildCount = aDescriptor.maHandler.getChildCount (this);
+ aDescriptor.mnChildCount = nChildCount;
+ // Fill in the indices of the updated children.
+ for (int j=0; j<nChildCount; j++)
+ aChildIndices.add(new Integer(j+nOffset));
+ }
+ nOffset += aDescriptor.mnChildCount;
+ }
+ return aChildIndices;
+ }
}