mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-14 17:06:16 +00:00
7634 fix setting of nod
This commit is contained in:
parent
fe3c159e99
commit
3dd90ece00
@ -31,7 +31,6 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Observer;
|
import java.util.Observer;
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import javax.swing.event.ListSelectionListener;
|
import javax.swing.event.ListSelectionListener;
|
||||||
@ -66,7 +65,7 @@ final class DataSourceBrowser extends javax.swing.JPanel implements ExplorerMana
|
|||||||
private final ExplorerManager explorerManager;
|
private final ExplorerManager explorerManager;
|
||||||
private final List<DataSourceSummary> dataSourceSummaryList;
|
private final List<DataSourceSummary> dataSourceSummaryList;
|
||||||
private final RightAlignedTableCellRenderer rightAlignedRenderer = new RightAlignedTableCellRenderer();
|
private final RightAlignedTableCellRenderer rightAlignedRenderer = new RightAlignedTableCellRenderer();
|
||||||
private SwingWorker<List<DataSourceSummary>, Void> rootNodeWorker = null;
|
private SwingWorker<Void, Void> rootNodeWorker = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new form DataSourceBrowser
|
* Creates new form DataSourceBrowser
|
||||||
@ -256,34 +255,28 @@ final class DataSourceBrowser extends javax.swing.JPanel implements ExplorerMana
|
|||||||
}
|
}
|
||||||
|
|
||||||
dataSourceSummaryList.clear();
|
dataSourceSummaryList.clear();
|
||||||
rootNodeWorker = new SwingWorker<List<DataSourceSummary>, Void>() {
|
rootNodeWorker = new SwingWorker<Void, Void>() {
|
||||||
@Override
|
@Override
|
||||||
protected List<DataSourceSummary> doInBackground() throws Exception {
|
protected Void doInBackground() throws Exception {
|
||||||
Map<Long, String> usageMap = CaseDataSourcesSummary.getDataSourceTypes();
|
Map<Long, String> usageMap = CaseDataSourcesSummary.getDataSourceTypes();
|
||||||
Map<Long, Long> fileCountsMap = CaseDataSourcesSummary.getCountsOfFiles();
|
Map<Long, Long> fileCountsMap = CaseDataSourcesSummary.getCountsOfFiles();
|
||||||
return getDataSourceSummaryList(usageMap, fileCountsMap);
|
dataSourceSummaryList.addAll(getDataSourceSummaryList(usageMap, fileCountsMap));
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void done() {
|
protected void done() {
|
||||||
List<DataSourceSummary> dsSummaryList = null;
|
explorerManager.setRootContext(new DataSourceSummaryNode(dataSourceSummaryList));
|
||||||
try {
|
|
||||||
dsSummaryList = get();
|
|
||||||
} catch (InterruptedException | ExecutionException ex) {
|
|
||||||
logger.log(Level.WARNING, "Error populating root node of Data Source Browser", ex);
|
|
||||||
}
|
|
||||||
if (dsSummaryList != null) {
|
|
||||||
dataSourceSummaryList.addAll(dsSummaryList);
|
|
||||||
}
|
|
||||||
addObserver(dsSummaryDialog);
|
|
||||||
selectDataSource(selectedDataSourceId);
|
selectDataSource(selectedDataSourceId);
|
||||||
|
addObserver(dsSummaryDialog);
|
||||||
dsSummaryDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
dsSummaryDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
rootNodeWorker.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cancel(){
|
void cancel() {
|
||||||
if (rootNodeWorker != null && !rootNodeWorker.isDone()){
|
if (rootNodeWorker != null && !rootNodeWorker.isDone()) {
|
||||||
rootNodeWorker.cancel(true);
|
rootNodeWorker.cancel(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user