mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Remove dead code from DirectoryTreeTopComponent
This commit is contained in:
parent
02fd2adfd1
commit
87603d6d6f
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2014 Basis Technology Corp.
|
* Copyright 2011-2015 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -84,21 +84,14 @@ import org.sleuthkit.datamodel.TskException;
|
|||||||
// Registered as a service provider for DataExplorer in layer.xml
|
// Registered as a service provider for DataExplorer in layer.xml
|
||||||
public final class DirectoryTreeTopComponent extends TopComponent implements DataExplorer, ExplorerManager.Provider, BlackboardResultViewer {
|
public final class DirectoryTreeTopComponent extends TopComponent implements DataExplorer, ExplorerManager.Provider, BlackboardResultViewer {
|
||||||
|
|
||||||
private transient ExplorerManager em = new ExplorerManager();
|
private final transient ExplorerManager em = new ExplorerManager();
|
||||||
private static DirectoryTreeTopComponent instance;
|
private static DirectoryTreeTopComponent instance;
|
||||||
private DataResultTopComponent dataResult = new DataResultTopComponent(true, NbBundle.getMessage(this.getClass(),
|
private final DataResultTopComponent dataResult = new DataResultTopComponent(true, NbBundle.getMessage(this.getClass(),
|
||||||
"DirectoryTreeTopComponent.title.text"));
|
"DirectoryTreeTopComponent.title.text"));
|
||||||
private LinkedList<String[]> backList;
|
private final LinkedList<String[]> backList;
|
||||||
private LinkedList<String[]> forwardList;
|
private final LinkedList<String[]> forwardList;
|
||||||
/**
|
|
||||||
* path to the icon used by the component and its open action
|
|
||||||
*/
|
|
||||||
// static final String ICON_PATH = "SET/PATH/TO/ICON/HERE";
|
|
||||||
private static final String PREFERRED_ID = "DirectoryTreeTopComponent"; //NON-NLS
|
private static final String PREFERRED_ID = "DirectoryTreeTopComponent"; //NON-NLS
|
||||||
private PropertyChangeSupport pcs;
|
private final PropertyChangeSupport pcs;
|
||||||
// for error handling
|
|
||||||
private JPanel caller;
|
|
||||||
private String className = this.getClass().toString();
|
|
||||||
private static final Logger logger = Logger.getLogger(DirectoryTreeTopComponent.class.getName());
|
private static final Logger logger = Logger.getLogger(DirectoryTreeTopComponent.class.getName());
|
||||||
private RootContentChildren contentChildren;
|
private RootContentChildren contentChildren;
|
||||||
|
|
||||||
@ -794,56 +787,6 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Refreshes the nodes in the tree to reflect updates in the database should
|
|
||||||
* be called in the gui thread
|
|
||||||
*/
|
|
||||||
// public void refreshResultsTree(final BlackboardArtifact.ARTIFACT_TYPE... types) {
|
|
||||||
// //save current selection
|
|
||||||
// Node selectedNode = getSelectedNode();
|
|
||||||
// final String[] selectedPath = NodeOp.createPath(selectedNode, em.getRootContext());
|
|
||||||
//
|
|
||||||
// //TODO: instead, we should choose a specific key to refresh? Maybe?
|
|
||||||
// //contentChildren.refreshKeys();
|
|
||||||
//
|
|
||||||
// Children dirChilds = em.getRootContext().getChildren();
|
|
||||||
//
|
|
||||||
// Node results = dirChilds.findChild(ResultsNode.NAME);
|
|
||||||
// if (results == null) {
|
|
||||||
// logger.log(Level.SEVERE, "Cannot find Results filter node, won't refresh the bb tree"); //NON-NLS
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// OriginalNode original = results.getLookup().lookup(OriginalNode.class);
|
|
||||||
// ResultsNode resultsNode = (ResultsNode) original.getNode();
|
|
||||||
// RootContentChildren resultsNodeChilds = (RootContentChildren) resultsNode.getChildren();
|
|
||||||
// resultsNodeChilds.refreshKeys(types);
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// final TreeView tree = getTree();
|
|
||||||
// // @@@ tree.expandNode(results);
|
|
||||||
//
|
|
||||||
// Children resultsChilds = results.getChildren();
|
|
||||||
// if (resultsChilds == null) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Node childNode = resultsChilds.findChild(KeywordHits.NAME);
|
|
||||||
// if (childNode == null) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// // @@@tree.expandNode(childNode);
|
|
||||||
//
|
|
||||||
// childNode = resultsChilds.findChild(ExtractedContent.NAME);
|
|
||||||
// if (childNode == null) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// tree.expandNode(childNode);
|
|
||||||
//
|
|
||||||
// //restores selection if it was under the Results node
|
|
||||||
// //@@@ setSelectedNode(selectedPath, ResultsNode.NAME);
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
/**
|
/**
|
||||||
* Set the selected node using a path to a previously selected node.
|
* Set the selected node using a path to a previously selected node.
|
||||||
*
|
*
|
||||||
@ -1013,10 +956,6 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
|
|||||||
new BlackboardArtifactNode(art)).actionPerformed(null);
|
new BlackboardArtifactNode(art)).actionPerformed(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// private class HistoryManager<T> {
|
|
||||||
// private Stack<T> past, future;
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
@Override
|
@Override
|
||||||
public void addOnFinishedListener(PropertyChangeListener l) {
|
public void addOnFinishedListener(PropertyChangeListener l) {
|
||||||
DirectoryTreeTopComponent.this.addPropertyChangeListener(l);
|
DirectoryTreeTopComponent.this.addPropertyChangeListener(l);
|
||||||
|
@ -37,8 +37,8 @@ import javax.swing.JLabel;
|
|||||||
import javax.swing.JList;
|
import javax.swing.JList;
|
||||||
import javax.swing.JSeparator;
|
import javax.swing.JSeparator;
|
||||||
import javax.swing.ListCellRenderer;
|
import javax.swing.ListCellRenderer;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
|
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
|
||||||
@ -237,26 +237,28 @@ class DateSearchFilter extends AbstractFileSearchFilter<DateSearchPanel> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
String changed = evt.getPropertyName();
|
switch (Case.Events.valueOf(evt.getPropertyName())) {
|
||||||
Object oldValue = evt.getOldValue();
|
case CURRENT_CASE:
|
||||||
Object newValue = evt.getNewValue();
|
Object newValue = evt.getNewValue();
|
||||||
|
if (null == newValue) {
|
||||||
if (changed.equals(Case.Events.CURRENT_CASE.toString())) {
|
/**
|
||||||
// create or open a case
|
* Closing a case. Nothing to do.
|
||||||
if (newValue != null) {
|
*/
|
||||||
DateSearchFilter.this.updateTimeZoneList();
|
break;
|
||||||
}
|
}
|
||||||
}
|
/**
|
||||||
|
* Else opening a case, fall through.
|
||||||
// if the image is added to the case
|
*/
|
||||||
if (changed.equals(Case.Events.DATA_SOURCE_ADDED.toString())) {
|
case DATA_SOURCE_ADDED:
|
||||||
DateSearchFilter.this.updateTimeZoneList();
|
case DATA_SOURCE_DELETED:
|
||||||
}
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
// if the image is removed from the case
|
public void run() {
|
||||||
if (changed.equals(Case.Events.DATA_SOURCE_DELETED.toString())) {
|
DateSearchFilter.this.updateTimeZoneList();
|
||||||
DateSearchFilter.this.updateTimeZoneList();
|
}
|
||||||
}
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2014 Basis Technology Corp.
|
* Copyright 2014-2015 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -58,7 +58,6 @@ import org.joda.time.Interval;
|
|||||||
import org.joda.time.ReadablePeriod;
|
import org.joda.time.ReadablePeriod;
|
||||||
import org.joda.time.format.DateTimeFormat;
|
import org.joda.time.format.DateTimeFormat;
|
||||||
import org.joda.time.format.DateTimeFormatter;
|
import org.joda.time.format.DateTimeFormatter;
|
||||||
import org.openide.util.Exceptions;
|
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.windows.WindowManager;
|
import org.openide.windows.WindowManager;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
@ -81,7 +80,8 @@ import org.sleuthkit.datamodel.SleuthkitCase;
|
|||||||
import org.sleuthkit.datamodel.SleuthkitCase.CaseDbQuery;
|
import org.sleuthkit.datamodel.SleuthkitCase.CaseDbQuery;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
|
|
||||||
/** Controller in the MVC design along with model = {@link FilteredEventsModel}
|
/**
|
||||||
|
* Controller in the MVC design along with model = {@link FilteredEventsModel}
|
||||||
* and views = {@link TimeLineView}. Forwards interpreted user gestures form
|
* and views = {@link TimeLineView}. Forwards interpreted user gestures form
|
||||||
* views to model. Provides model to view. Is entry point for timeline module.
|
* views to model. Provides model to view. Is entry point for timeline module.
|
||||||
*
|
*
|
||||||
@ -100,7 +100,7 @@ public class TimeLineController {
|
|||||||
private static final Logger LOGGER = Logger.getLogger(TimeLineController.class.getName());
|
private static final Logger LOGGER = Logger.getLogger(TimeLineController.class.getName());
|
||||||
|
|
||||||
private static final String DO_REPOPULATE_MESSAGE = NbBundle.getMessage(TimeLineController.class,
|
private static final String DO_REPOPULATE_MESSAGE = NbBundle.getMessage(TimeLineController.class,
|
||||||
"Timeline.do_repopulate.msg");
|
"Timeline.do_repopulate.msg");
|
||||||
|
|
||||||
private static final ReadOnlyObjectWrapper<TimeZone> timeZone = new ReadOnlyObjectWrapper<>(TimeZone.getDefault());
|
private static final ReadOnlyObjectWrapper<TimeZone> timeZone = new ReadOnlyObjectWrapper<>(TimeZone.getDefault());
|
||||||
|
|
||||||
@ -234,7 +234,9 @@ public class TimeLineController {
|
|||||||
caseListener = new AutopsyCaseListener();
|
caseListener = new AutopsyCaseListener();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return a shared events model */
|
/**
|
||||||
|
* @return a shared events model
|
||||||
|
*/
|
||||||
public FilteredEventsModel getEventsModel() {
|
public FilteredEventsModel getEventsModel() {
|
||||||
return filteredEvents;
|
return filteredEvents;
|
||||||
}
|
}
|
||||||
@ -312,7 +314,9 @@ public class TimeLineController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** show the timeline window and prompt for rebuilding database */
|
/**
|
||||||
|
* show the timeline window and prompt for rebuilding database
|
||||||
|
*/
|
||||||
synchronized void openTimeLine() {
|
synchronized void openTimeLine() {
|
||||||
|
|
||||||
// listen for case changes (specifically images being added, and case changes).
|
// listen for case changes (specifically images being added, and case changes).
|
||||||
@ -359,7 +363,7 @@ public class TimeLineController {
|
|||||||
private long getCaseLastArtifactID(final SleuthkitCase sleuthkitCase) {
|
private long getCaseLastArtifactID(final SleuthkitCase sleuthkitCase) {
|
||||||
long caseLastArtfId = -1;
|
long caseLastArtfId = -1;
|
||||||
String query = "select Max(artifact_id) as max_id from blackboard_artifacts"; // NON-NLS
|
String query = "select Max(artifact_id) as max_id from blackboard_artifacts"; // NON-NLS
|
||||||
|
|
||||||
try (CaseDbQuery dbQuery = sleuthkitCase.executeQuery(query)) {
|
try (CaseDbQuery dbQuery = sleuthkitCase.executeQuery(query)) {
|
||||||
ResultSet resultSet = dbQuery.getResultSet();
|
ResultSet resultSet = dbQuery.getResultSet();
|
||||||
while (resultSet.next()) {
|
while (resultSet.next()) {
|
||||||
@ -481,12 +485,12 @@ public class TimeLineController {
|
|||||||
if (newLOD == DescriptionLOD.FULL && count > 10_000) {
|
if (newLOD == DescriptionLOD.FULL && count > 10_000) {
|
||||||
|
|
||||||
int showConfirmDialog = JOptionPane.showConfirmDialog(mainFrame,
|
int showConfirmDialog = JOptionPane.showConfirmDialog(mainFrame,
|
||||||
NbBundle.getMessage(this.getClass(),
|
NbBundle.getMessage(this.getClass(),
|
||||||
"Timeline.pushDescrLOD.confdlg.msg",
|
"Timeline.pushDescrLOD.confdlg.msg",
|
||||||
NumberFormat.getInstance().format(count)),
|
NumberFormat.getInstance().format(count)),
|
||||||
NbBundle.getMessage(TimeLineTopComponent.class,
|
NbBundle.getMessage(TimeLineTopComponent.class,
|
||||||
"Timeline.pushDescrLOD.confdlg.details"),
|
"Timeline.pushDescrLOD.confdlg.details"),
|
||||||
JOptionPane.YES_NO_OPTION);
|
JOptionPane.YES_NO_OPTION);
|
||||||
|
|
||||||
shouldContinue = (showConfirmDialog == JOptionPane.YES_OPTION);
|
shouldContinue = (showConfirmDialog == JOptionPane.YES_OPTION);
|
||||||
}
|
}
|
||||||
@ -634,7 +638,7 @@ public class TimeLineController {
|
|||||||
return JOptionPane.showConfirmDialog(mainFrame,
|
return JOptionPane.showConfirmDialog(mainFrame,
|
||||||
DO_REPOPULATE_MESSAGE,
|
DO_REPOPULATE_MESSAGE,
|
||||||
NbBundle.getMessage(TimeLineTopComponent.class,
|
NbBundle.getMessage(TimeLineTopComponent.class,
|
||||||
"Timeline.showLastPopulatedWhileIngestingConf.confDlg.details"),
|
"Timeline.showLastPopulatedWhileIngestingConf.confDlg.details"),
|
||||||
JOptionPane.YES_NO_OPTION,
|
JOptionPane.YES_NO_OPTION,
|
||||||
JOptionPane.QUESTION_MESSAGE);
|
JOptionPane.QUESTION_MESSAGE);
|
||||||
|
|
||||||
@ -663,17 +667,7 @@ public class TimeLineController {
|
|||||||
@Override
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
switch (IngestManager.IngestModuleEvent.valueOf(evt.getPropertyName())) {
|
switch (IngestManager.IngestModuleEvent.valueOf(evt.getPropertyName())) {
|
||||||
case CONTENT_CHANGED:
|
|
||||||
// ((ModuleContentEvent)evt.getOldValue())????
|
|
||||||
//ModuleContentEvent doesn't seem to provide any usefull information...
|
|
||||||
break;
|
|
||||||
case DATA_ADDED:
|
|
||||||
// Collection<BlackboardArtifact> artifacts = ((ModuleDataEvent) evt.getOldValue()).getArtifacts();
|
|
||||||
//new artifacts, insert them into db
|
|
||||||
break;
|
|
||||||
case FILE_DONE:
|
case FILE_DONE:
|
||||||
// Long fileID = (Long) evt.getOldValue();
|
|
||||||
//update file (known status) for file with id
|
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
newEventsFlag.set(true);
|
newEventsFlag.set(true);
|
||||||
});
|
});
|
||||||
@ -690,8 +684,12 @@ public class TimeLineController {
|
|||||||
switch (IngestManager.IngestJobEvent.valueOf(evt.getPropertyName())) {
|
switch (IngestManager.IngestJobEvent.valueOf(evt.getPropertyName())) {
|
||||||
case CANCELLED:
|
case CANCELLED:
|
||||||
case COMPLETED:
|
case COMPLETED:
|
||||||
//if we are doing incremental updates, drop this
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
outOfDatePromptAndRebuild();
|
@Override
|
||||||
|
public void run() {
|
||||||
|
outOfDatePromptAndRebuild();
|
||||||
|
}
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -704,13 +702,21 @@ public class TimeLineController {
|
|||||||
public void propertyChange(PropertyChangeEvent evt) {
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
switch (Case.Events.valueOf(evt.getPropertyName())) {
|
switch (Case.Events.valueOf(evt.getPropertyName())) {
|
||||||
case DATA_SOURCE_ADDED:
|
case DATA_SOURCE_ADDED:
|
||||||
// Content content = (Content) evt.getNewValue();
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
//if we are doing incremental updates, drop this
|
@Override
|
||||||
outOfDatePromptAndRebuild();
|
public void run() {
|
||||||
|
outOfDatePromptAndRebuild();
|
||||||
|
}
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
case CURRENT_CASE:
|
case CURRENT_CASE:
|
||||||
OpenTimelineAction.invalidateController();
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
closeTimeLine();
|
@Override
|
||||||
|
public void run() {
|
||||||
|
OpenTimelineAction.invalidateController();
|
||||||
|
closeTimeLine();
|
||||||
|
}
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user