19 package org.sleuthkit.autopsy.datasourcesummary.ui;
21 import java.awt.Component;
22 import java.util.Arrays;
23 import java.util.List;
24 import java.util.function.Consumer;
25 import javax.swing.JTabbedPane;
26 import org.openide.util.NbBundle.Messages;
35 "DataSourceSummaryTabbedPane_typesTab_title=Types",
36 "DataSourceSummaryTabbedPane_detailsTab_title=Container",
37 "DataSourceSummaryTabbedPane_userActivityTab_title=User Activity",
38 "DataSourceSummaryTabbedPane_ingestHistoryTab_title=Ingest History",
39 "DataSourceSummaryTabbedPane_recentFileTab_title=Recent Files",
40 "DataSourceSummaryTabbedPane_pastCasesTab_title=Past Cases",
41 "DataSourceSummaryTabbedPane_analysisTab_title=Analysis"
64 DataSourceTab(String tabTitle, Component component, Consumer<DataSource> onDataSource, Runnable onClose) {
65 this.tabTitle = tabTitle;
66 this.component = component;
67 this.onDataSource = onDataSource;
68 this.onClose = onClose;
77 DataSourceTab(String tabTitle, BaseDataSourceSummaryPanel panel) {
78 this.tabTitle = tabTitle;
79 this.component = panel;
80 this.onDataSource = panel::setDataSource;
81 this.onClose = panel::close;
87 String getTabTitle() {
94 Component getComponent() {
101 Consumer<DataSource> getOnDataSource() {
113 private static final long serialVersionUID = 1L;
117 private final List<DataSourceTab> tabs = Arrays.asList(
118 new DataSourceTab(Bundle.DataSourceSummaryTabbedPane_typesTab_title(),
new TypesPanel()),
124 new DataSourceTab(Bundle.DataSourceSummaryTabbedPane_ingestHistoryTab_title(), ingestHistoryPanel, ingestHistoryPanel::setDataSource, () -> {
126 new DataSourceTab(Bundle.DataSourceSummaryTabbedPane_detailsTab_title(),
new ContainerPanel())
129 private DataSource dataSource = null;
140 addTab(tab.getTabTitle(), tab.getComponent());
159 this.dataSource = dataSource;
162 tab.getOnDataSource().accept(dataSource);
171 tab.getOnClose().run();
DataSourceSummaryTabbedPane()
void setDataSource(DataSource dataSource)
DataSource getDataSource()
final Component component
final Consumer< DataSource > onDataSource