void () { myStructureTreeModel.invalidateAsync().thenRun(() -> { ApplicationManager.getApplication().invokeLater(() -> { // After updating the tree we have to synchronize the selection in the tree // with selected element in the hierarchy syncSelection(); }); }); }