19 package org.sleuthkit.autopsy.datasourcesummary.ui;
21 import java.util.Arrays;
22 import java.util.List;
23 import java.util.function.Function;
24 import org.apache.commons.lang3.tuple.Pair;
25 import org.openide.util.NbBundle.Messages;
44 "PastCasesPanel_caseColumn_title=Case",
45 "PastCasesPanel_countColumn_title=Count",
46 "PastCasesPanel_onNoCrIngest_message=No results will be shown because the Central Repository module was not run."
50 private static final long serialVersionUID = 1L;
55 Bundle.PastCasesPanel_caseColumn_title(),
61 Bundle.PastCasesPanel_countColumn_title(),
66 private static final List<ColumnModel<Pair<String, Long>>> DEFAULT_COLUMNS = Arrays.asList(CASE_COL, COUNT_COL);
72 private final List<JTablePanel<?>> tables = Arrays.asList(
90 dataFetchComponents = Arrays.asList(
93 (result) -> handleResult(result))
106 showResultWithModuleCheck(notableFileTable, getSubResult(result, (res) -> res.getTaggedNotable()), CR_FACTORY, CR_NAME);
107 showResultWithModuleCheck(sameIdTable, getSubResult(result, (res) -> res.getSameIdsResults()), CR_FACTORY, CR_NAME);
123 if (inputResult == null) {
126 O innerData = (inputResult.
getData() == null) ? null : getSubResult.apply(inputResult.
getData());
129 return DataFetchResult.getErrorResult(inputResult.
getException());
135 fetchInformation(dataFetchComponents, dataSource);
140 onNewDataSource(dataFetchComponents, tables, dataSource);
154 @SuppressWarnings(
"unchecked")
156 private
void initComponents() {
158 javax.swing.JScrollPane mainScrollPane =
new javax.swing.JScrollPane();
159 javax.swing.JPanel mainContentPanel =
new javax.swing.JPanel();
160 javax.swing.JPanel ingestRunningPanel = ingestRunningLabel;
161 javax.swing.JLabel notableFileLabel =
new javax.swing.JLabel();
162 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));
163 javax.swing.JPanel notableFilePanel = notableFileTable;
164 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));
165 javax.swing.JLabel sameIdLabel =
new javax.swing.JLabel();
166 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));
167 javax.swing.JPanel sameIdPanel = sameIdTable;
168 javax.swing.Box.Filler filler5 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 0),
new java.awt.Dimension(0, 0),
new java.awt.Dimension(0, 32767));
170 mainContentPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(10, 10, 10, 10));
171 mainContentPanel.setLayout(
new javax.swing.BoxLayout(mainContentPanel, javax.swing.BoxLayout.PAGE_AXIS));
173 ingestRunningPanel.setAlignmentX(0.0F);
174 ingestRunningPanel.setMaximumSize(
new java.awt.Dimension(32767, 25));
175 ingestRunningPanel.setMinimumSize(
new java.awt.Dimension(10, 25));
176 ingestRunningPanel.setPreferredSize(
new java.awt.Dimension(10, 25));
177 mainContentPanel.add(ingestRunningPanel);
179 org.openide.awt.Mnemonics.setLocalizedText(notableFileLabel,
org.openide.util.NbBundle.getMessage(
PastCasesPanel.class,
"PastCasesPanel.notableFileLabel.text"));
180 mainContentPanel.add(notableFileLabel);
181 notableFileLabel.getAccessibleContext().setAccessibleName(
org.openide.util.NbBundle.getMessage(
PastCasesPanel.class,
"PastCasesPanel.notableFileLabel.text"));
183 filler1.setAlignmentX(0.0F);
184 mainContentPanel.add(filler1);
186 notableFilePanel.setAlignmentX(0.0F);
187 notableFilePanel.setMaximumSize(
new java.awt.Dimension(32767, 106));
188 notableFilePanel.setMinimumSize(
new java.awt.Dimension(100, 106));
189 notableFilePanel.setPreferredSize(
new java.awt.Dimension(100, 106));
190 mainContentPanel.add(notableFilePanel);
192 filler2.setAlignmentX(0.0F);
193 mainContentPanel.add(filler2);
195 org.openide.awt.Mnemonics.setLocalizedText(sameIdLabel,
org.openide.util.NbBundle.getMessage(
PastCasesPanel.class,
"PastCasesPanel.sameIdLabel.text"));
196 mainContentPanel.add(sameIdLabel);
198 filler3.setAlignmentX(0.0F);
199 mainContentPanel.add(filler3);
201 sameIdPanel.setAlignmentX(0.0F);
202 sameIdPanel.setMaximumSize(
new java.awt.Dimension(32767, 106));
203 sameIdPanel.setMinimumSize(
new java.awt.Dimension(100, 106));
204 sameIdPanel.setPreferredSize(
new java.awt.Dimension(100, 106));
205 mainContentPanel.add(sameIdPanel);
207 filler5.setAlignmentX(0.0F);
208 mainContentPanel.add(filler5);
210 mainScrollPane.setViewportView(mainContentPanel);
212 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
213 this.setLayout(layout);
214 layout.setHorizontalGroup(
215 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
216 .addComponent(mainScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
218 layout.setVerticalGroup(
219 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
220 .addComponent(mainScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
void handleResult(DataFetchResult< PastCasesResult > result)
ResultType getResultType()
PastCasesResult getPastCasesData(DataSource dataSource)
static< T > JTablePanel< T > getJTablePanel(List< ColumnModel< T >> columns)
PastCasesPanel(PastCasesSummary pastCaseData)
static String getModuleName()
void onNewDataSource(DataSource dataSource)
final List< DataFetchComponents< DataSource,?> > dataFetchComponents
static< R > DataFetchResult< R > getSuccessResult(R data)
void fetchInformation(DataSource dataSource)