mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
Merge pull request #4028 from wschaeferB/4014-PreStoryCleanup
4014 pre story cleanup
This commit is contained in:
commit
047dc39b31
@ -24,10 +24,8 @@ import java.awt.event.ActionEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.ActionMap;
|
||||
@ -105,7 +103,16 @@ public class GetTagNameAndCommentDialog extends JDialog {
|
||||
public static TagNameAndComment doDialog(Window owner) {
|
||||
GetTagNameAndCommentDialog dialog = new GetTagNameAndCommentDialog(owner);
|
||||
dialog.display();
|
||||
return dialog.tagNameAndComment;
|
||||
return dialog.getTagNameAndComment();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the TagNameAndComment.
|
||||
*
|
||||
* @return the tagNameAndComment
|
||||
*/
|
||||
private TagNameAndComment getTagNameAndComment() {
|
||||
return tagNameAndComment;
|
||||
}
|
||||
|
||||
private GetTagNameAndCommentDialog(Window owner) {
|
||||
@ -114,14 +121,14 @@ public class GetTagNameAndCommentDialog extends JDialog {
|
||||
ModalityType.APPLICATION_MODAL);
|
||||
}
|
||||
|
||||
|
||||
private void display() {
|
||||
initComponents();
|
||||
tagCombo.setRenderer(new DefaultListCellRenderer() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
||||
String status = ((TagName) value).getKnownStatus() == TskData.FileKnown.BAD ?TagsManager.getNotableTagLabel() : "";
|
||||
String status = ((TagName) value).getKnownStatus() == TskData.FileKnown.BAD ? TagsManager.getNotableTagLabel() : "";
|
||||
String newValue = ((TagName) value).getDisplayName() + status;
|
||||
return super.getListCellRendererComponent(list, newValue, index, isSelected, cellHasFocus);
|
||||
}
|
||||
@ -160,7 +167,6 @@ public class GetTagNameAndCommentDialog extends JDialog {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||
Logger.getLogger(GetTagNameAndCommentDialog.class
|
||||
.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS
|
||||
@ -320,4 +326,5 @@ public class GetTagNameAndCommentDialog extends JDialog {
|
||||
private javax.swing.JComboBox<TagName> tagCombo;
|
||||
private javax.swing.JLabel tagLabel;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
}
|
||||
|
@ -922,7 +922,7 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
||||
* Used as a key to ensure we eliminate duplicates from the result set by
|
||||
* not overwriting CR correlation instances.
|
||||
*/
|
||||
static final class UniquePathKey {
|
||||
private static final class UniquePathKey {
|
||||
|
||||
private final String dataSourceID;
|
||||
private final String filePath;
|
||||
@ -943,9 +943,9 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
||||
public boolean equals(Object other) {
|
||||
if (other instanceof UniquePathKey) {
|
||||
UniquePathKey otherKey = (UniquePathKey) (other);
|
||||
return (Objects.equals(otherKey.dataSourceID, this.dataSourceID)
|
||||
&& Objects.equals(otherKey.filePath, this.filePath)
|
||||
&& Objects.equals(otherKey.type, this.type));
|
||||
return (Objects.equals(otherKey.getDataSourceID(), this.getDataSourceID())
|
||||
&& Objects.equals(otherKey.getFilePath(), this.getFilePath())
|
||||
&& Objects.equals(otherKey.getType(), this.getType()));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -955,7 +955,34 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
||||
//int hash = 7;
|
||||
//hash = 67 * hash + this.dataSourceID.hashCode();
|
||||
//hash = 67 * hash + this.filePath.hashCode();
|
||||
return Objects.hash(dataSourceID, filePath, type);
|
||||
return Objects.hash(getDataSourceID(), getFilePath(), getType());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the type of this UniquePathKey.
|
||||
*
|
||||
* @return the type
|
||||
*/
|
||||
String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the file path for the UniquePathKey.
|
||||
*
|
||||
* @return the filePath
|
||||
*/
|
||||
String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the data source id for the UniquePathKey.
|
||||
*
|
||||
* @return the dataSourceID
|
||||
*/
|
||||
String getDataSourceID() {
|
||||
return dataSourceID;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,8 @@ import org.openide.util.NbBundle.Messages;
|
||||
*/
|
||||
public class DataContentViewerOtherCasesTableModel extends AbstractTableModel {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Messages({"DataContentViewerOtherCasesTableModel.case=Case",
|
||||
"DataContentViewerOtherCasesTableModel.device=Device",
|
||||
"DataContentViewerOtherCasesTableModel.dataSource=Data Source",
|
||||
@ -66,7 +68,7 @@ public class DataContentViewerOtherCasesTableModel extends AbstractTableModel {
|
||||
}
|
||||
};
|
||||
|
||||
List<OtherOccurrenceNodeData> nodeDataList;
|
||||
private final List<OtherOccurrenceNodeData> nodeDataList;
|
||||
|
||||
DataContentViewerOtherCasesTableModel() {
|
||||
nodeDataList = new ArrayList<>();
|
||||
@ -118,7 +120,7 @@ public class DataContentViewerOtherCasesTableModel extends AbstractTableModel {
|
||||
/**
|
||||
* Map a column ID to the value in that cell for node message data.
|
||||
*
|
||||
* @param nodeData The node message data.
|
||||
* @param nodeData The node message data.
|
||||
* @param columnId The ID of the cell column.
|
||||
*
|
||||
* @return The value in the cell.
|
||||
@ -133,7 +135,7 @@ public class DataContentViewerOtherCasesTableModel extends AbstractTableModel {
|
||||
/**
|
||||
* Map a column ID to the value in that cell for node instance data.
|
||||
*
|
||||
* @param nodeData The node instance data.
|
||||
* @param nodeData The node instance data.
|
||||
* @param columnId The ID of the cell column.
|
||||
*
|
||||
* @return The value in the cell.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2017-18 Basis Technology Corp.
|
||||
* Copyright 2017-2018 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
@ -117,8 +117,8 @@ public class MessageContentViewer extends javax.swing.JPanel implements DataCont
|
||||
|
||||
drp.open();
|
||||
drpExplorerManager = drp.getExplorerManager();
|
||||
drpExplorerManager.addPropertyChangeListener(evt ->
|
||||
viewInNewWindowButton.setEnabled(drpExplorerManager.getSelectedNodes().length == 1));
|
||||
drpExplorerManager.addPropertyChangeListener(evt
|
||||
-> viewInNewWindowButton.setEnabled(drpExplorerManager.getSelectedNodes().length == 1));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -21,14 +21,12 @@ package org.sleuthkit.autopsy.datamodel;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.swing.Action;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openide.nodes.Children;
|
||||
import org.openide.nodes.Sheet;
|
||||
@ -38,9 +36,6 @@ import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||
import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent;
|
||||
import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent;
|
||||
import org.sleuthkit.autopsy.centralrepository.AddEditCentralRepoCommentAction;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamArtifactUtil;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import static org.sleuthkit.autopsy.datamodel.AbstractAbstractFileNode.AbstractFilePropertyType.*;
|
||||
import static org.sleuthkit.autopsy.datamodel.Bundle.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011 Basis Technology Corp.
|
||||
* Copyright 2011-2018 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -29,6 +29,7 @@ import org.sleuthkit.datamodel.AbstractFile;
|
||||
* Abstract class that implements the commonality between File and Directory
|
||||
* Nodes (same properties).
|
||||
*
|
||||
* @param <T> extends AbstractFile
|
||||
*/
|
||||
public abstract class AbstractFsContentNode<T extends AbstractFile> extends AbstractAbstractFileNode<T> {
|
||||
|
||||
|
@ -48,8 +48,6 @@ import org.sleuthkit.autopsy.casemodule.events.BlackBoardArtifactTagAddedEvent;
|
||||
import org.sleuthkit.autopsy.casemodule.events.BlackBoardArtifactTagDeletedEvent;
|
||||
import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent;
|
||||
import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent;
|
||||
import org.sleuthkit.autopsy.centralrepository.AddEditCentralRepoCommentAction;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||
import static org.sleuthkit.autopsy.datamodel.DisplayableItemNode.findLinked;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Copyright 2011-2018 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -19,6 +19,7 @@
|
||||
package org.sleuthkit.autopsy.datamodel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
@ -46,11 +47,11 @@ public class LayoutFileNode extends AbstractAbstractFileNode<LayoutFile> {
|
||||
public static enum LayoutContentPropertyType {
|
||||
|
||||
PARTS {
|
||||
@Override
|
||||
public String toString() {
|
||||
return NbBundle.getMessage(this.getClass(), "LayoutFileNode.propertyType.parts");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return NbBundle.getMessage(this.getClass(), "LayoutFileNode.propertyType.parts");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static String nameForLayoutFile(LayoutFile lf) {
|
||||
@ -115,9 +116,7 @@ public class LayoutFileNode extends AbstractAbstractFileNode<LayoutFile> {
|
||||
@Override
|
||||
public Action[] getActions(boolean context) {
|
||||
List<Action> actionsList = new ArrayList<>();
|
||||
for (Action a : super.getActions(true)) {
|
||||
actionsList.add(a);
|
||||
}
|
||||
actionsList.addAll(Arrays.asList(super.getActions(true)));
|
||||
actionsList.add(new NewWindowViewAction(
|
||||
NbBundle.getMessage(this.getClass(), "LayoutFileNode.getActions.viewInNewWin.text"), this));
|
||||
actionsList.add(new ExternalViewerAction(
|
||||
@ -127,9 +126,9 @@ public class LayoutFileNode extends AbstractAbstractFileNode<LayoutFile> {
|
||||
actionsList.add(null); // creates a menu separator
|
||||
actionsList.add(AddContentTagAction.getInstance());
|
||||
|
||||
final Collection<AbstractFile> selectedFilesList =
|
||||
new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
|
||||
if(selectedFilesList.size() == 1) {
|
||||
final Collection<AbstractFile> selectedFilesList
|
||||
= new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
|
||||
if (selectedFilesList.size() == 1) {
|
||||
actionsList.add(DeleteFileContentTagAction.getInstance());
|
||||
}
|
||||
|
||||
@ -137,8 +136,7 @@ public class LayoutFileNode extends AbstractAbstractFileNode<LayoutFile> {
|
||||
return actionsList.toArray(new Action[actionsList.size()]);
|
||||
}
|
||||
|
||||
|
||||
void fillPropertyMap(Map<String, Object> map) {
|
||||
void fillPropertyMap(Map<String, Object> map) {
|
||||
AbstractAbstractFileNode.fillPropertyMap(map, getContent());
|
||||
map.put(LayoutContentPropertyType.PARTS.toString(), content.getNumParts());
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Copyright 2011-2018 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
@ -125,7 +125,7 @@ public class LocalFileNode extends AbstractAbstractFileNode<AbstractFile> {
|
||||
logger.log(Level.WARNING, "Unable to add unzip with password action to context menus", ex);
|
||||
}
|
||||
}
|
||||
return actionsList.toArray(new Action[0]);
|
||||
return actionsList.toArray(new Action[actionsList.size()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -50,8 +50,6 @@ public class VirtualDirectoryNode extends SpecialDirectoryNode {
|
||||
|
||||
this.setDisplayName(nameForVirtualDirectory(ld));
|
||||
|
||||
String name = ld.getName();
|
||||
|
||||
//set icon for name, special case for logical file set
|
||||
if (ld.isDataSource()) {
|
||||
this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/fileset-icon-16.png"); //NON-NLS
|
||||
|
Loading…
x
Reference in New Issue
Block a user