19 package org.sleuthkit.autopsy.datasourcesummary.ui;
21 import java.util.Arrays;
22 import java.util.List;
23 import org.apache.commons.lang3.tuple.Pair;
24 import org.openide.util.NbBundle.Messages;
41 "PastCasesPanel_caseColumn_title=Case",
42 "PastCasesPanel_countColumn_title=Count",
43 "PastCasesPanel_onNoCrIngest_message=No results will be shown because the Central Repository module was not run.",})
46 private static final long serialVersionUID = 1L;
50 Bundle.PastCasesPanel_caseColumn_title(),
57 Bundle.PastCasesPanel_countColumn_title(),
64 = Arrays.asList(CASE_COL, COUNT_COL);
70 private final List<JTablePanel<?>> tables = Arrays.asList(
92 this.pastCasesFetcher = (dataSource) -> pastCaseData.
getPastCasesData(dataSource);
95 dataFetchComponents = Arrays.asList(
98 (result) -> handleResult(result))
118 fetchInformation(dataFetchComponents, dataSource);
123 onNewDataSource(dataFetchComponents, tables, dataSource);
137 @SuppressWarnings(
"unchecked")
139 private
void initComponents() {
141 javax.swing.JScrollPane mainScrollPane =
new javax.swing.JScrollPane();
142 javax.swing.JPanel mainContentPanel =
new javax.swing.JPanel();
143 javax.swing.JPanel ingestRunningPanel = ingestRunningLabel;
144 javax.swing.JLabel notableFileLabel =
new javax.swing.JLabel();
145 javax.swing.Box.Filler filler1 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 2),
new java.awt.Dimension(0, 2),
new java.awt.Dimension(0, 2));
146 javax.swing.JPanel notableFilePanel = notableFileTable;
147 javax.swing.Box.Filler filler2 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 20),
new java.awt.Dimension(0, 20),
new java.awt.Dimension(0, 20));
148 javax.swing.JLabel seenResultLabel =
new javax.swing.JLabel();
149 javax.swing.Box.Filler filler3 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 2),
new java.awt.Dimension(0, 2),
new java.awt.Dimension(0, 2));
150 javax.swing.JPanel seenResultPanel = seenResultTable;
151 javax.swing.Box.Filler filler4 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 20),
new java.awt.Dimension(0, 20),
new java.awt.Dimension(0, 20));
152 javax.swing.JLabel seenDeviceLabel =
new javax.swing.JLabel();
153 javax.swing.Box.Filler filler5 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 2),
new java.awt.Dimension(0, 2),
new java.awt.Dimension(0, 2));
154 javax.swing.JPanel seenDevicePanel = seenDeviceTable;
155 javax.swing.Box.Filler filler6 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 20),
new java.awt.Dimension(0, 20),
new java.awt.Dimension(0, 20));
156 javax.swing.JLabel warningLabel =
new javax.swing.JLabel();
158 mainContentPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(10, 10, 10, 10));
159 mainContentPanel.setLayout(
new javax.swing.BoxLayout(mainContentPanel, javax.swing.BoxLayout.PAGE_AXIS));
161 ingestRunningPanel.setAlignmentX(0.0F);
162 ingestRunningPanel.setMaximumSize(
new java.awt.Dimension(32767, 25));
163 ingestRunningPanel.setMinimumSize(
new java.awt.Dimension(10, 25));
164 ingestRunningPanel.setPreferredSize(
new java.awt.Dimension(10, 25));
165 mainContentPanel.add(ingestRunningPanel);
167 org.openide.awt.Mnemonics.setLocalizedText(notableFileLabel,
org.openide.util.NbBundle.getMessage(
PastCasesPanel.class,
"PastCasesPanel.notableFileLabel.text"));
168 mainContentPanel.add(notableFileLabel);
169 notableFileLabel.getAccessibleContext().setAccessibleName(
org.openide.util.NbBundle.getMessage(
PastCasesPanel.class,
"PastCasesPanel.notableFileLabel.text"));
171 filler1.setAlignmentX(0.0F);
172 mainContentPanel.add(filler1);
174 notableFilePanel.setAlignmentX(0.0F);
175 notableFilePanel.setMaximumSize(
new java.awt.Dimension(32767, 106));
176 notableFilePanel.setMinimumSize(
new java.awt.Dimension(100, 106));
177 notableFilePanel.setPreferredSize(
new java.awt.Dimension(100, 106));
178 mainContentPanel.add(notableFilePanel);
180 filler2.setAlignmentX(0.0F);
181 mainContentPanel.add(filler2);
183 org.openide.awt.Mnemonics.setLocalizedText(seenResultLabel,
org.openide.util.NbBundle.getMessage(
PastCasesPanel.class,
"PastCasesPanel.seenResultLabel.text"));
184 mainContentPanel.add(seenResultLabel);
186 filler3.setAlignmentX(0.0F);
187 mainContentPanel.add(filler3);
189 seenResultPanel.setAlignmentX(0.0F);
190 seenResultPanel.setMaximumSize(
new java.awt.Dimension(32767, 106));
191 seenResultPanel.setMinimumSize(
new java.awt.Dimension(100, 106));
192 seenResultPanel.setPreferredSize(
new java.awt.Dimension(100, 106));
193 mainContentPanel.add(seenResultPanel);
195 filler4.setAlignmentX(0.0F);
196 mainContentPanel.add(filler4);
198 org.openide.awt.Mnemonics.setLocalizedText(seenDeviceLabel,
org.openide.util.NbBundle.getMessage(
PastCasesPanel.class,
"PastCasesPanel.seenDeviceLabel.text"));
199 mainContentPanel.add(seenDeviceLabel);
201 filler5.setAlignmentX(0.0F);
202 mainContentPanel.add(filler5);
204 seenDevicePanel.setAlignmentX(0.0F);
205 seenDevicePanel.setMaximumSize(
new java.awt.Dimension(32767, 106));
206 seenDevicePanel.setMinimumSize(
new java.awt.Dimension(100, 106));
207 seenDevicePanel.setPreferredSize(
new java.awt.Dimension(100, 106));
208 mainContentPanel.add(seenDevicePanel);
210 filler6.setAlignmentX(0.0F);
211 mainContentPanel.add(filler6);
213 org.openide.awt.Mnemonics.setLocalizedText(warningLabel,
org.openide.util.NbBundle.getMessage(
PastCasesPanel.class,
"PastCasesPanel.warningLabel.text"));
214 mainContentPanel.add(warningLabel);
216 mainScrollPane.setViewportView(mainContentPanel);
218 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
219 this.setLayout(layout);
220 layout.setHorizontalGroup(
221 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
222 .addComponent(mainScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
224 layout.setVerticalGroup(
225 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
226 .addComponent(mainScrollPane)
void handleResult(DataFetchResult< PastCasesResult > result)
static< I, O > DataFetchResult< O > getSubResult(DataFetchResult< I > inputResult, Function< I, O > getSubResult)
void showDataFetchResult(DataFetchResult< T > result, String errorMessage, String noResultsMessage)
static< T, CextendsGuiCellModel > JTablePanel< T > getJTablePanel(List< ColumnModel< T, C >> columns)
PastCasesResult getPastCasesData(DataSource dataSource)
void onNewDataSource(DataSource dataSource)
PastCasesPanel(PastCasesSummaryGetter pastCaseData)
final List< DataFetchComponents< DataSource,?> > dataFetchComponents
final DataFetcher< DataSource, PastCasesResult > pastCasesFetcher
void fetchInformation(DataSource dataSource)