mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 10:17:41 +00:00
Make sure property change handlers dispatch to EDT
This commit is contained in:
parent
e590490b79
commit
a29db0a501
@ -544,29 +544,49 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
|
|||||||
// data model objects when a case is closed.
|
// data model objects when a case is closed.
|
||||||
if (oldValue != null && newValue == null) {
|
if (oldValue != null && newValue == null) {
|
||||||
// The current case has been closed. Reset the ExplorerManager.
|
// The current case has been closed. Reset the ExplorerManager.
|
||||||
Node emptyNode = new AbstractNode(Children.LEAF);
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
em.setRootContext(emptyNode);
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Node emptyNode = new AbstractNode(Children.LEAF);
|
||||||
|
em.setRootContext(emptyNode);
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (newValue != null) {
|
} else if (newValue != null) {
|
||||||
// A new case has been opened. Reset the ExplorerManager.
|
// A new case has been opened. Reset the ExplorerManager.
|
||||||
Case newCase = (Case) newValue;
|
Case newCase = (Case) newValue;
|
||||||
String newCaseName = newCase.getName();
|
final String newCaseName = newCase.getName();
|
||||||
em.getRootContext().setName(newCaseName);
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
em.getRootContext().setDisplayName(newCaseName);
|
@Override
|
||||||
|
public void run() {
|
||||||
|
em.getRootContext().setName(newCaseName);
|
||||||
|
em.getRootContext().setDisplayName(newCaseName);
|
||||||
|
|
||||||
// Reset the forward and back
|
// Reset the forward and back
|
||||||
// buttons. Note that a call to CoreComponentControl.openCoreWindows()
|
// buttons. Note that a call to CoreComponentControl.openCoreWindows()
|
||||||
// by the new Case object will lead to a componentOpened() call
|
// by the new Case object will lead to a componentOpened() call
|
||||||
// that will repopulate the tree.
|
// that will repopulate the tree.
|
||||||
// @@@ The repopulation of the tree in this fashion also merits
|
// @@@ The repopulation of the tree in this fashion also merits
|
||||||
// reconsideration.
|
// reconsideration.
|
||||||
resetHistory();
|
resetHistory();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} // if the image is added to the case
|
} // if the image is added to the case
|
||||||
else if (changed.equals(Case.Events.DATA_SOURCE_ADDED.toString())) {
|
else if (changed.equals(Case.Events.DATA_SOURCE_ADDED.toString())) {
|
||||||
componentOpened();
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
componentOpened();
|
||||||
|
}
|
||||||
|
});
|
||||||
} // change in node selection
|
} // change in node selection
|
||||||
else if (changed.equals(ExplorerManager.PROP_SELECTED_NODES)) {
|
else if (changed.equals(ExplorerManager.PROP_SELECTED_NODES)) {
|
||||||
respondSelection((Node[]) oldValue, (Node[]) newValue);
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
respondSelection((Node[]) oldValue, (Node[]) newValue);
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (changed.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
|
} else if (changed.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
|
||||||
// nothing to do here.
|
// nothing to do here.
|
||||||
// all nodes should be listening for these events and update accordingly.
|
// all nodes should be listening for these events and update accordingly.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user