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."
47 private static final long serialVersionUID = 1L;
50 Bundle.PastCasesPanel_caseColumn_title(),
56 Bundle.PastCasesPanel_countColumn_title(),
61 private static final List<ColumnModel<Pair<String, Long>>> DEFAULT_COLUMNS = Arrays.asList(CASE_COL, COUNT_COL);
67 private final List<JTablePanel<?>> tables = Arrays.asList(
87 dataFetchComponents = Arrays.asList(
90 (result) -> handleResult(result))
109 fetchInformation(dataFetchComponents, dataSource);
114 onNewDataSource(dataFetchComponents, tables, dataSource);
128 @SuppressWarnings(
"unchecked")
130 private
void initComponents() {
132 javax.swing.JScrollPane mainScrollPane =
new javax.swing.JScrollPane();
133 javax.swing.JPanel mainContentPanel =
new javax.swing.JPanel();
134 javax.swing.JPanel ingestRunningPanel = ingestRunningLabel;
135 javax.swing.JLabel notableFileLabel =
new javax.swing.JLabel();
136 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));
137 javax.swing.JPanel notableFilePanel = notableFileTable;
138 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));
139 javax.swing.JLabel sameIdLabel =
new javax.swing.JLabel();
140 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));
141 javax.swing.JPanel sameIdPanel = sameIdTable;
142 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));
144 mainContentPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(10, 10, 10, 10));
145 mainContentPanel.setLayout(
new javax.swing.BoxLayout(mainContentPanel, javax.swing.BoxLayout.PAGE_AXIS));
147 ingestRunningPanel.setAlignmentX(0.0F);
148 ingestRunningPanel.setMaximumSize(
new java.awt.Dimension(32767, 25));
149 ingestRunningPanel.setMinimumSize(
new java.awt.Dimension(10, 25));
150 ingestRunningPanel.setPreferredSize(
new java.awt.Dimension(10, 25));
151 mainContentPanel.add(ingestRunningPanel);
153 org.openide.awt.Mnemonics.setLocalizedText(notableFileLabel,
org.openide.util.NbBundle.getMessage(
PastCasesPanel.class,
"PastCasesPanel.notableFileLabel.text"));
154 mainContentPanel.add(notableFileLabel);
155 notableFileLabel.getAccessibleContext().setAccessibleName(
org.openide.util.NbBundle.getMessage(
PastCasesPanel.class,
"PastCasesPanel.notableFileLabel.text"));
157 filler1.setAlignmentX(0.0F);
158 mainContentPanel.add(filler1);
160 notableFilePanel.setAlignmentX(0.0F);
161 notableFilePanel.setMaximumSize(
new java.awt.Dimension(32767, 106));
162 notableFilePanel.setMinimumSize(
new java.awt.Dimension(100, 106));
163 notableFilePanel.setPreferredSize(
new java.awt.Dimension(100, 106));
164 mainContentPanel.add(notableFilePanel);
166 filler2.setAlignmentX(0.0F);
167 mainContentPanel.add(filler2);
169 org.openide.awt.Mnemonics.setLocalizedText(sameIdLabel,
org.openide.util.NbBundle.getMessage(
PastCasesPanel.class,
"PastCasesPanel.sameIdLabel.text"));
170 mainContentPanel.add(sameIdLabel);
172 filler3.setAlignmentX(0.0F);
173 mainContentPanel.add(filler3);
175 sameIdPanel.setAlignmentX(0.0F);
176 sameIdPanel.setMaximumSize(
new java.awt.Dimension(32767, 106));
177 sameIdPanel.setMinimumSize(
new java.awt.Dimension(100, 106));
178 sameIdPanel.setPreferredSize(
new java.awt.Dimension(100, 106));
179 mainContentPanel.add(sameIdPanel);
181 filler5.setAlignmentX(0.0F);
182 mainContentPanel.add(filler5);
184 mainScrollPane.setViewportView(mainContentPanel);
186 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
187 this.setLayout(layout);
188 layout.setHorizontalGroup(
189 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
190 .addComponent(mainScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
192 layout.setVerticalGroup(
193 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
194 .addComponent(mainScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
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)
PastCasesResult getPastCasesData(DataSource dataSource)
static< T > JTablePanel< T > getJTablePanel(List< ColumnModel< T >> columns)
PastCasesPanel(PastCasesSummary pastCaseData)
void onNewDataSource(DataSource dataSource)
final List< DataFetchComponents< DataSource,?> > dataFetchComponents
void fetchInformation(DataSource dataSource)