mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 07:56:16 +00:00
Added default Action to MessageNode
This commit is contained in:
parent
d37dcc73b3
commit
6be682ee45
@ -18,11 +18,14 @@
|
||||
*/
|
||||
package org.sleuthkit.autopsy.communications.relationships;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.Action;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openide.nodes.Sheet;
|
||||
import org.openide.util.NbBundle.Messages;
|
||||
import org.openide.util.actions.SystemAction;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.datamodel.NodeProperty;
|
||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||
@ -55,6 +58,8 @@ class MessageNode extends BlackboardArtifactNode {
|
||||
|
||||
private final Action preferredAction;
|
||||
|
||||
private final Action defaultNoopAction = new DefaultMessageAction();
|
||||
|
||||
MessageNode(BlackboardArtifact artifact, String threadID, Action preferredAction) {
|
||||
super(artifact);
|
||||
|
||||
@ -148,7 +153,7 @@ class MessageNode extends BlackboardArtifactNode {
|
||||
|
||||
@Override
|
||||
public Action getPreferredAction() {
|
||||
return preferredAction;
|
||||
return preferredAction != null ? preferredAction : defaultNoopAction;
|
||||
}
|
||||
|
||||
private int getAttachmentsCount() throws TskCoreException {
|
||||
@ -171,4 +176,15 @@ class MessageNode extends BlackboardArtifactNode {
|
||||
|
||||
return attachmentsCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* A no op action to override the default action of BlackboardArtifactNode
|
||||
*/
|
||||
private class DefaultMessageAction extends AbstractAction {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
// Do Nothing.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user