Skip to content

Commit 3202b22

Browse files
committed
FileSystemTree: run UI updates in the event dispatch thread
rather than in the file system watcher thread. This is perhaps a fix to the whole Fiji UI lock ups I've been seeing randomly in association with e.g. saving a file in the Script Editor whose parent folder is listed in the FileSystemTree.
1 parent 49bd653 commit 3202b22

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/main/java/org/scijava/ui/swing/script/FileSystemTree.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,10 +507,14 @@ public void run() {
507507
if (null != node) nodes.add(node);
508508
}
509509

510-
for (final Node node : nodes) {
511-
node.updateChildrenList(FileSystemTree.this.getModel());
512-
FileSystemTree.this.expandPath(new TreePath(node.getPath()));
513-
}
510+
SwingUtilities.invokeLater(new Runnable() {
511+
public void run() {
512+
for (final Node node : nodes) {
513+
node.updateChildrenList(FileSystemTree.this.getModel());
514+
FileSystemTree.this.expandPath(new TreePath(node.getPath()));
515+
}
516+
}
517+
});
514518

515519
boolean valid = key.reset();
516520
if (!valid) {

0 commit comments

Comments
 (0)