19 package org.sleuthkit.autopsy.actions;
21 import java.util.Collection;
22 import java.util.concurrent.ExecutionException;
23 import java.util.logging.Level;
24 import javafx.application.Platform;
25 import javafx.scene.control.Alert;
26 import javax.swing.SwingWorker;
27 import org.openide.util.NbBundle;
28 import org.openide.util.Utilities;
52 if (null == instance) {
69 "# {0} - old tag name",
71 "ReplaceBlackboardArtifactTagAction.replaceTag.alert=Unable to replace tag {0} for artifact {1}."})
73 protected void replaceTag( BlackboardArtifactTag oldArtifactTag, TagName newTagName) {
74 new SwingWorker<Void, Void>() {
77 protected Void doInBackground()
throws Exception {
82 logger.log(Level.SEVERE,
"Error replacing artifact tag. No open case found.", ex);
84 ->
new Alert(Alert.AlertType.ERROR, Bundle.ReplaceBlackboardArtifactTagAction_replaceTag_alert(oldArtifactTag.getName().getDisplayName(), oldArtifactTag.getArtifact().getArtifactID())).show()
90 logger.log(Level.INFO,
"Replacing tag {0} with tag {1} for artifact {2}",
new Object[]{oldArtifactTag.getName().getDisplayName(), newTagName.getDisplayName(), oldArtifactTag.getContent().getName()});
95 }
catch (TskCoreException tskCoreException) {
96 logger.log(Level.SEVERE,
"Error replacing artifact tag", tskCoreException);
98 ->
new Alert(Alert.AlertType.ERROR, Bundle.ReplaceBlackboardArtifactTagAction_replaceTag_alert(oldArtifactTag.getName().getDisplayName(), oldArtifactTag.getArtifact().getArtifactID())).show()
105 protected void done() {
109 }
catch (InterruptedException | ExecutionException ex) {
110 logger.log(Level.SEVERE,
"Unexpected exception while replacing artifact tag", ex);
122 Collection<? extends BlackboardArtifactTag> getTagsToReplace() {
123 return Utilities.actionsGlobalContext().lookupAll(BlackboardArtifactTag.class);
void replaceTag(BlackboardArtifactTag oldArtifactTag, TagName newTagName)
static final Logger logger
TagsManager getTagsManager()
static synchronized ReplaceBlackboardArtifactTagAction getInstance()
static ReplaceBlackboardArtifactTagAction instance
ReplaceBlackboardArtifactTagAction()
synchronized static Logger getLogger(String name)
static Case getCurrentCaseThrows()
static final long serialVersionUID