mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 00:16:16 +00:00
Merge pull request #2811 from wschaeferB/2594-FixMenuText
2594 - reordered tag context menu items, removed ... from View Source…
This commit is contained in:
commit
982f3abf48
@ -19,6 +19,7 @@
|
|||||||
package org.sleuthkit.autopsy.datamodel;
|
package org.sleuthkit.autopsy.datamodel;
|
||||||
|
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@ -98,14 +99,13 @@ public class BlackboardArtifactTagNode extends DisplayableItemNode {
|
|||||||
|
|
||||||
return propertySheet;
|
return propertySheet;
|
||||||
}
|
}
|
||||||
@NbBundle.Messages("BlackboardArtifactTagNode.viewSourceArtifact.text=View Source Result...")
|
|
||||||
|
@NbBundle.Messages("BlackboardArtifactTagNode.viewSourceArtifact.text=View Source Result")
|
||||||
@Override
|
@Override
|
||||||
public Action[] getActions(boolean context) {
|
public Action[] getActions(boolean context) {
|
||||||
List<Action> actions = DataModelActionsFactory.getActions(tag.getContent(), true);
|
List<Action> actions = new ArrayList<>();
|
||||||
actions.addAll(Arrays.asList(super.getActions(context)));
|
actions.addAll(Arrays.asList(super.getActions(context)));
|
||||||
|
|
||||||
BlackboardArtifact artifact = getLookup().lookup(BlackboardArtifact.class);
|
BlackboardArtifact artifact = getLookup().lookup(BlackboardArtifact.class);
|
||||||
actions.add(new ViewTaggedArtifactAction(BlackboardArtifactTagNode_viewSourceArtifact_text(), artifact));
|
|
||||||
//if this artifact has a time stamp add the action to view it in the timeline
|
//if this artifact has a time stamp add the action to view it in the timeline
|
||||||
try {
|
try {
|
||||||
if (ViewArtifactInTimelineAction.hasSupportedTimeStamp(artifact)) {
|
if (ViewArtifactInTimelineAction.hasSupportedTimeStamp(artifact)) {
|
||||||
@ -126,14 +126,13 @@ public class BlackboardArtifactTagNode extends DisplayableItemNode {
|
|||||||
LOGGER.log(Level.SEVERE, MessageFormat.format("Error getting linked file from blackboard artifact{0}.", artifact.getArtifactID()), ex); //NON-NLS
|
LOGGER.log(Level.SEVERE, MessageFormat.format("Error getting linked file from blackboard artifact{0}.", artifact.getArtifactID()), ex); //NON-NLS
|
||||||
MessageNotifyUtil.Notify.error(Bundle.BlackboardArtifactNode_getAction_errorTitle(), Bundle.BlackboardArtifactNode_getAction_linkedFileMessage());
|
MessageNotifyUtil.Notify.error(Bundle.BlackboardArtifactNode_getAction_errorTitle(), Bundle.BlackboardArtifactNode_getAction_linkedFileMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
//if this artifact has associated content, add the action to view the content in the timeline
|
//if this artifact has associated content, add the action to view the content in the timeline
|
||||||
AbstractFile file = getLookup().lookup(AbstractFile.class);
|
AbstractFile file = getLookup().lookup(AbstractFile.class);
|
||||||
if (null != file) {
|
if (null != file) {
|
||||||
|
|
||||||
actions.add(ViewFileInTimelineAction.createViewSourceFileAction(file));
|
actions.add(ViewFileInTimelineAction.createViewSourceFileAction(file));
|
||||||
}
|
}
|
||||||
|
actions.add(new ViewTaggedArtifactAction(BlackboardArtifactTagNode_viewSourceArtifact_text(), artifact));
|
||||||
|
actions.addAll(DataModelActionsFactory.getActions(tag.getContent(), true));
|
||||||
actions.add(DeleteBlackboardArtifactTagAction.getInstance());
|
actions.add(DeleteBlackboardArtifactTagAction.getInstance());
|
||||||
return actions.toArray(new Action[0]);
|
return actions.toArray(new Action[0]);
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.datamodel;
|
package org.sleuthkit.autopsy.datamodel;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@ -111,14 +112,14 @@ class ContentTagNode extends DisplayableItemNode {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Action[] getActions(boolean context) {
|
public Action[] getActions(boolean context) {
|
||||||
List<Action> actions = DataModelActionsFactory.getActions(tag.getContent(), false);
|
List<Action> actions = new ArrayList<>();
|
||||||
actions.addAll(Arrays.asList(super.getActions(context)));
|
actions.addAll(Arrays.asList(super.getActions(context)));
|
||||||
|
|
||||||
AbstractFile file = getLookup().lookup(AbstractFile.class);
|
AbstractFile file = getLookup().lookup(AbstractFile.class);
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
actions.add(ViewFileInTimelineAction.createViewFileAction(file));
|
actions.add(ViewFileInTimelineAction.createViewFileAction(file));
|
||||||
}
|
}
|
||||||
actions.add(null); // Adds a menu item separator.
|
actions.addAll(DataModelActionsFactory.getActions(tag.getContent(), false));
|
||||||
actions.add(DeleteContentTagAction.getInstance());
|
actions.add(DeleteContentTagAction.getInstance());
|
||||||
return actions.toArray(new Action[actions.size()]);
|
return actions.toArray(new Action[actions.size()]);
|
||||||
}
|
}
|
||||||
|
@ -295,7 +295,7 @@ public class DataResultFilterNode extends FilterNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@NbBundle.Messages("DataResultFilterNode.viewSourceArtifact.text=View Source Result...")
|
@NbBundle.Messages("DataResultFilterNode.viewSourceArtifact.text=View Source Result")
|
||||||
/**
|
/**
|
||||||
* Uses the default nodes actions per node, adds some custom ones and
|
* Uses the default nodes actions per node, adds some custom ones and
|
||||||
* returns them per visited node type
|
* returns them per visited node type
|
||||||
|
Loading…
x
Reference in New Issue
Block a user