Removed the edit comment from the data result popup menu

This commit is contained in:
Kelly Kelly 2022-01-06 12:10:53 -05:00
parent c84725c979
commit ead84a3dc6
2 changed files with 16 additions and 11 deletions

View File

@ -28,6 +28,7 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeUti
import org.sleuthkit.autopsy.corecomponentinterfaces.ContextMenuActionsProvider;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository;
import org.sleuthkit.datamodel.DataArtifact;
/**
* This creates a single context menu item for adding or editing a Central
@ -39,19 +40,23 @@ public class CentralRepoContextMenuActionsProvider implements ContextMenuActions
@Override
public List<Action> getActions() {
ArrayList<Action> actionsList = new ArrayList<>();
Collection<? extends AbstractFile> selectedFiles = Utilities.actionsGlobalContext().lookupAll(AbstractFile.class);
Collection<? extends DataArtifact> artifacts = Utilities.actionsGlobalContext().lookupAll(DataArtifact.class);
if(artifacts.isEmpty()) {
Collection<? extends AbstractFile> selectedFiles = Utilities.actionsGlobalContext().lookupAll(AbstractFile.class);
if (selectedFiles.size() != 1) {
return actionsList;
}
if (selectedFiles.size() != 1) {
return actionsList;
}
for (AbstractFile file : selectedFiles) {
if (CentralRepository.isEnabled() && CorrelationAttributeUtil.isSupportedAbstractFileType(file) && file.isFile()) {
AddEditCentralRepoCommentAction action = new AddEditCentralRepoCommentAction(file);
if (action.getCorrelationAttribute() == null) {
action.setEnabled(false);
for (AbstractFile file : selectedFiles) {
if (CentralRepository.isEnabled() && CorrelationAttributeUtil.isSupportedAbstractFileType(file) && file.isFile()) {
AddEditCentralRepoCommentAction action = new AddEditCentralRepoCommentAction(file);
if (action.getCorrelationAttribute() == null) {
action.setEnabled(false);
}
actionsList.add(action);
}
actionsList.add(action);
}
}

View File

@ -86,6 +86,6 @@ public class DataArtifactNode extends ArtifactNode<DataArtifact, DataArtifactRow
@Override
protected boolean shouldUpdateSCOColumns(long eventObjId) {
return eventObjId == getRowDTO().getArtifact().getObjectID();
return false;
}
}