diff options
author | Andre Fischer <af@openoffice.org> | 2002-04-08 10:12:25 +0000 |
---|---|---|
committer | Andre Fischer <af@openoffice.org> | 2002-04-08 10:12:25 +0000 |
commit | c6ea813f88c413b2e8dd226b1adc9c72179a282c (patch) | |
tree | 6cfe242487e816b10f3223cde009a390d3b6a398 /toolkit/test/accessibility/AccessibilityWorkBench.java | |
parent | b1124d48c332ae7171cc3829b79da25bc6b6867f (diff) |
#97772# Instead of replacing the whole tree model, now only its root node is replaced.
Diffstat (limited to 'toolkit/test/accessibility/AccessibilityWorkBench.java')
-rwxr-xr-x | toolkit/test/accessibility/AccessibilityWorkBench.java | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/toolkit/test/accessibility/AccessibilityWorkBench.java b/toolkit/test/accessibility/AccessibilityWorkBench.java index 60ef39204202..b475319a7e8f 100755 --- a/toolkit/test/accessibility/AccessibilityWorkBench.java +++ b/toolkit/test/accessibility/AccessibilityWorkBench.java @@ -361,10 +361,19 @@ public class AccessibilityWorkBench maCanvas.clear (); // create new model (with new documents) - AccessibilityTreeModel aModel = - new AccessibilityTreeModel (createTreeModelRoot(), this, this); - aModel.setCanvas( maCanvas ); - maTree.setModel( aModel ); + if (maTree.getModel() instanceof AccessibilityTreeModel) + { + AccessibilityTreeModel aModel = (AccessibilityTreeModel)maTree.getModel(); + aModel.setRoot (createTreeModelRoot()); + } + else + { + System.out.println ("creating new tree model"); + AccessibilityTreeModel aModel = + new AccessibilityTreeModel (createTreeModelRoot(), this, this); + aModel.setCanvas (maCanvas); + maTree.setModel (aModel); + } aConnectButton.setEnabled (true); aQuitButton.setEnabled (true); @@ -447,7 +456,7 @@ public class AccessibilityWorkBench /** Create an AccessibilityTreeModel root which contains the documents */ - private Object createTreeModelRoot() + private AccessibleTreeNode createTreeModelRoot() { // create root node VectorNode aRoot = new VectorNode ("Accessibility Tree", null); @@ -456,13 +465,13 @@ public class AccessibilityWorkBench XDesktop xDesktop = office.getDesktop(); if (xDesktop == null) { - return "ERROR: Can't connect. (No desktop)"; + return new StringNode ("ERROR: Can't connect. (No desktop)", null); } XEnumerationAccess xEA = xDesktop.getComponents(); if (xEA == null) { - return "ERROR: Can't get components"; + return new StringNode ("ERROR: Can't get components", null); } XEnumeration xE = xEA.createEnumeration(); while (xE.hasMoreElements()) |