/** Starts the tree from scratch taking into account new sort orders. */ private void redoTreeView() { UIUtilities.invokeLater( () -> { ((DefaultTreeModel) tree.getModel()).setRoot(null); ((DefaultTreeModel) tree.getModel()).setRoot(new TreeViewNode(null, null)); if (scroller != null) { scroller.unregister(); } scroller = new TreeTreeScroller(swingEventBus, tree); for (WindowModel window : windowManager.getRootWindows()) { addWindow(null, windowFactory.getSwingWindow(window)); final Collection<WindowModel> childWindows = windowManager.getChildren(window); for (WindowModel childWindow : childWindows) { addWindow( nodes.get(windowFactory.getSwingWindow(window)), windowFactory.getSwingWindow(childWindow)); } } if (activeFrameManager.getActiveFrame() != null) { selectionChanged(new SwingWindowSelectedEvent(activeFrameManager.getActiveFrame())); } }); }
@Handler(invocation = EdtHandlerInvocation.class, delivery = Invoke.Asynchronously) public void unreadStatusChanged(final UnreadStatusChangedEvent event) { synchronized (nodes) { final TreeViewNode node = nodes.get(windowFactory.getSwingWindow(event.getSource())); if (node != null) { final NodeLabel label = node.getLabel(); if (label != null) { label.unreadStatusChanged(event); tree.repaint(); } } } }