Skip to main content

Please review - tree refresh deletion support

3 replies [Last post]
bkurotsu
Offline
Joined: 2004-12-13
Points: 0

This should add support for deletion of nodes when doing a tree refresh. I believe this will also fix the array index out of bound exception.

First diff adds the support, second one fixes a NPE that always occurred right after the refresh.

https://jtharness.dev.java.net/source/browse/jtharness?rev=777&view=rev
https://jtharness.dev.java.net/source/browse/jtharness?rev=796&view=rev

Thanks.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bkurotsu
Offline
Joined: 2004-12-13
Points: 0

Basically the refresh system was updated to track changes for each node when it is updated. The main trick is to make sure Swing stays updated.

The most common problem is that automatic tree refreshes from swing will cause exceptions if the underlying model changes.

ktlooney
Offline
Joined: 2006-07-13
Points: 0

Here's a few minor things I saw in review:

In TRT_TreeNode.java:

In TreeNode updateDirectory(File f)

The javadoc:
* @return Returns index of tree node updated/created.

Looks like it is returning the TreeNode, not the index of.

Other than this, code changes in this file for the Tree-Refresh issue seemed to read like what they were intended to do.

I didn't have any comments on other files related to the Refresh NPE. Just from reading the code, everything looks reasonable.

Sorry for the rather superficial review, but at least it is another set of eyes on the problem.

Kevin L

bkurotsu
Offline
Joined: 2004-12-13
Points: 0

Thanks. Javadoc updated. All integrated to trunk.

Also includes fix to make the build-examples target dependent on the jar target.

https://jtharness.dev.java.net/source/browse/jtharness?rev=798&view=rev