Another attempt at fixing the thread issue

This commit is contained in:
Kelly Kelly 2019-05-23 12:23:59 -04:00
parent f6ebad6944
commit 5669681df7
3 changed files with 14 additions and 17 deletions

View File

@ -118,16 +118,12 @@ public final class ContactsViewer extends JPanel implements RelationshipsViewer{
outlineViewPanel.getExplorerManager().getRootContext().addNodeListener(new NodeAdapter(){
@Override
public void childrenAdded(NodeMemberEvent nme) {
SwingUtilities.invokeLater(() -> {
updateOutlineViewPanel();
});
}
@Override
public void childrenRemoved(NodeMemberEvent nme) {
updateOutlineViewPanel(); SwingUtilities.invokeLater(() -> {
updateOutlineViewPanel();
});
}
});
}

View File

@ -130,16 +130,12 @@ public final class MessagesViewer extends JPanel implements RelationshipsViewer
outlineViewPanel.getExplorerManager().getRootContext().addNodeListener(new NodeAdapter() {
@Override
public void childrenAdded(NodeMemberEvent nme) {
SwingUtilities.invokeLater(() -> {
updateOutlineViewPanel();
});
}
@Override
public void childrenRemoved(NodeMemberEvent nme) {
SwingUtilities.invokeLater(() -> {
updateOutlineViewPanel();
});
}
});
}

View File

@ -19,6 +19,7 @@
package org.sleuthkit.autopsy.communications.relationships;
import java.awt.CardLayout;
import javax.swing.SwingUtilities;
import org.openide.explorer.ExplorerManager;
import static org.openide.explorer.ExplorerUtils.createLookup;
import org.openide.explorer.view.OutlineView;
@ -62,17 +63,21 @@ public class OutlineViewPanel extends javax.swing.JPanel implements ExplorerMana
* @param message String message to show on the panel.
*/
public void hideOutlineView(String message) {
SwingUtilities.invokeLater(() -> {
CardLayout layout = (CardLayout)this.getLayout();
layout.show(this, "messageCard"); //NON-NLS
messageLabel.setText(message);
});
}
/**
* Hides the message panel and shows the OutlineView.
*/
public void showOutlineView() {
SwingUtilities.invokeLater(() -> {
CardLayout layout = (CardLayout)this.getLayout();
layout.show(this, "outlineCard"); //NON-NLS
});
}
/**