mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-14 08:56:15 +00:00
Move the update of the SCO columns to the EDT
This commit is contained in:
parent
952df29e89
commit
eb366cab64
@ -38,6 +38,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.swing.Action;
|
import javax.swing.Action;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
import org.openide.nodes.Sheet;
|
import org.openide.nodes.Sheet;
|
||||||
@ -179,27 +180,7 @@ public class BlackboardArtifactNode extends AbstractContentNode<BlackboardArtifa
|
|||||||
contentCache.invalidateAll();
|
contentCache.invalidateAll();
|
||||||
}
|
}
|
||||||
} else if (eventType.equals(NodeSpecificEvents.SCO_AVAILABLE.toString()) && !UserPreferences.getHideSCOColumns()) {
|
} else if (eventType.equals(NodeSpecificEvents.SCO_AVAILABLE.toString()) && !UserPreferences.getHideSCOColumns()) {
|
||||||
SCOData scoData = (SCOData) evt.getNewValue();
|
updateSCOColumns((SCOData) evt.getNewValue());
|
||||||
if (scoData.getScoreAndDescription() != null) {
|
|
||||||
updateSheet(new NodeProperty<>(
|
|
||||||
Bundle.BlackboardArtifactNode_createSheet_score_name(),
|
|
||||||
Bundle.BlackboardArtifactNode_createSheet_score_displayName(),
|
|
||||||
scoData.getScoreAndDescription().getRight(),
|
|
||||||
scoData.getScoreAndDescription().getLeft()));
|
|
||||||
}
|
|
||||||
if (scoData.getComment() != null) {
|
|
||||||
updateSheet(new NodeProperty<>(
|
|
||||||
Bundle.BlackboardArtifactNode_createSheet_comment_name(),
|
|
||||||
Bundle.BlackboardArtifactNode_createSheet_comment_displayName(),
|
|
||||||
NO_DESCR, scoData.getComment()));
|
|
||||||
}
|
|
||||||
if (scoData.getCountAndDescription() != null) {
|
|
||||||
updateSheet(new NodeProperty<>(
|
|
||||||
Bundle.BlackboardArtifactNode_createSheet_count_name(),
|
|
||||||
Bundle.BlackboardArtifactNode_createSheet_count_displayName(),
|
|
||||||
scoData.getCountAndDescription().getRight(),
|
|
||||||
scoData.getCountAndDescription().getLeft()));
|
|
||||||
}
|
|
||||||
} else if (eventType.equals(FileNameTransTask.getPropertyName())) {
|
} else if (eventType.equals(FileNameTransTask.getPropertyName())) {
|
||||||
/*
|
/*
|
||||||
* Replace the value of the Source File property with the
|
* Replace the value of the Source File property with the
|
||||||
@ -1224,6 +1205,41 @@ public class BlackboardArtifactNode extends AbstractContentNode<BlackboardArtifa
|
|||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the SCO columns with the data retrieved in the background
|
||||||
|
* thread.
|
||||||
|
*
|
||||||
|
* @param scoData The data for the SCO columns.
|
||||||
|
*/
|
||||||
|
private void updateSCOColumns(final SCOData scoData) {
|
||||||
|
// Make sure this happens in the EDT
|
||||||
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (scoData.getScoreAndDescription() != null) {
|
||||||
|
updateSheet(new NodeProperty<>(
|
||||||
|
Bundle.BlackboardArtifactNode_createSheet_score_name(),
|
||||||
|
Bundle.BlackboardArtifactNode_createSheet_score_displayName(),
|
||||||
|
scoData.getScoreAndDescription().getRight(),
|
||||||
|
scoData.getScoreAndDescription().getLeft()));
|
||||||
|
}
|
||||||
|
if (scoData.getComment() != null) {
|
||||||
|
updateSheet(new NodeProperty<>(
|
||||||
|
Bundle.BlackboardArtifactNode_createSheet_comment_name(),
|
||||||
|
Bundle.BlackboardArtifactNode_createSheet_comment_displayName(),
|
||||||
|
NO_DESCR, scoData.getComment()));
|
||||||
|
}
|
||||||
|
if (scoData.getCountAndDescription() != null) {
|
||||||
|
updateSheet(new NodeProperty<>(
|
||||||
|
Bundle.BlackboardArtifactNode_createSheet_count_name(),
|
||||||
|
Bundle.BlackboardArtifactNode_createSheet_count_displayName(),
|
||||||
|
scoData.getCountAndDescription().getRight(),
|
||||||
|
scoData.getCountAndDescription().getLeft()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the score property for the artifact represented by this node to the
|
* Adds the score property for the artifact represented by this node to the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user