19 package org.sleuthkit.autopsy.filequery;
21 import com.google.common.eventbus.Subscribe;
22 import java.awt.Component;
23 import java.awt.Image;
24 import java.awt.event.ItemEvent;
25 import java.awt.event.MouseAdapter;
26 import java.awt.event.MouseEvent;
27 import java.util.ArrayList;
28 import java.util.HashSet;
29 import java.util.List;
31 import java.util.concurrent.CancellationException;
32 import java.util.concurrent.ExecutionException;
33 import java.util.logging.Level;
34 import javax.swing.DefaultComboBoxModel;
35 import javax.swing.DefaultListCellRenderer;
36 import javax.swing.DefaultListModel;
37 import javax.swing.JList;
38 import javax.swing.JOptionPane;
39 import javax.swing.JPopupMenu;
40 import javax.swing.SwingUtilities;
41 import javax.swing.SwingWorker;
42 import javax.swing.event.ListSelectionListener;
43 import org.openide.util.NbBundle.Messages;
88 @Messages({
"ResultsPanel.viewFileInDir.name=View File in Directory",
89 "ResultsPanel.openInExternalViewer.name=Open in External Viewer"})
95 videoThumbnailViewer.addListSelectionListener((e) -> {
96 if (
resultType == FileSearchData.FileType.VIDEO) {
97 if (!e.getValueIsAdjusting()) {
98 populateInstancesList();
100 instancesList.clearSelection();
104 imageThumbnailViewer.addListSelectionListener((e) -> {
105 if (
resultType == FileSearchData.FileType.IMAGE) {
106 if (!e.getValueIsAdjusting()) {
107 populateInstancesList();
109 instancesList.clearSelection();
113 documentPreviewViewer.addListSelectionListener((e) -> {
114 if (resultType == FileSearchData.FileType.DOCUMENTS) {
115 if (!e.getValueIsAdjusting()) {
116 populateInstancesList();
118 instancesList.clearSelection();
123 instancesList.addMouseListener(
new MouseAdapter() {
125 public void mousePressed(MouseEvent e) {
126 if (SwingUtilities.isRightMouseButton(e)) {
127 SwingUtilities.invokeLater(() -> {
128 instancesList.setSelectedIndex(instancesList.locationToIndex(e.getPoint()));
129 Set<AbstractFile> files =
new HashSet<>();
130 files.add(instancesList.getSelectedValue());
131 JPopupMenu menu =
new JPopupMenu();
132 menu.add(
new ViewContextAction(Bundle.ResultsPanel_viewFileInDir_name(), instancesList.getSelectedValue()));
133 menu.add(
new ExternalViewerAction(Bundle.ResultsPanel_openInExternalViewer_name(),
new FileNode(instancesList.getSelectedValue())));
134 menu.add(ViewFileInTimelineAction.createViewFileAction(instancesList.getSelectedValue()));
135 menu.add(
new DiscoveryExtractAction(files));
136 menu.add(AddContentTagAction.getInstance().getMenuForContent(files));
137 menu.add(DeleteFileContentTagAction.getInstance().getMenuForFiles(files));
138 menu.add(AddContentToHashDbAction.getInstance().getMenuForFiles(files));
139 menu.show(instancesList, e.getPoint().x, e.getPoint().y);
152 void addListSelectionListener(ListSelectionListener newListener) {
153 instancesList.removeListSelectionListener(listener);
154 listener = newListener;
155 instancesList.addListSelectionListener(listener);
161 synchronized void populateInstancesList() {
162 SwingUtilities.invokeLater(() -> {
163 List<AbstractFile> files = getInstancesForSelected();
164 if (files.isEmpty()) {
166 instancesListModel.removeAllElements();
169 instancesList.removeListSelectionListener(listener);
170 instancesListModel.removeAllElements();
171 for (AbstractFile file : files) {
172 instancesListModel.addElement(file);
175 instancesList.addListSelectionListener(listener);
176 if (!instancesListModel.isEmpty()) {
177 instancesList.setSelectedIndex(0);
189 synchronized AbstractFile getSelectedFile() {
190 if (instancesList.getSelectedIndex() == -1) {
193 return instancesListModel.getElementAt(instancesList.getSelectedIndex());
205 if (null != resultType) {
206 switch (resultType) {
208 return videoThumbnailViewer.getInstancesForSelected();
210 return imageThumbnailViewer.getInstancesForSelected();
212 return documentPreviewViewer.getInstancesForSelected();
217 return new ArrayList<>();
226 void handlePageRetrievedEvent(DiscoveryEventUtils.PageRetrievedEvent pageRetrievedEvent) {
227 SwingUtilities.invokeLater(() -> {
228 populateInstancesList();
229 currentPage = pageRetrievedEvent.getPageNumber();
232 if (null != pageRetrievedEvent.getType()) {
233 switch (pageRetrievedEvent.getType()) {
235 populateImageViewer(pageRetrievedEvent.getSearchResults());
236 resultsViewerPanel.add(imageThumbnailViewer);
239 populateVideoViewer(pageRetrievedEvent.getSearchResults());
240 resultsViewerPanel.add(videoThumbnailViewer);
243 populateDocumentViewer(pageRetrievedEvent.getSearchResults());
244 resultsViewerPanel.add(documentPreviewViewer);
250 resultsViewerPanel.revalidate();
251 resultsViewerPanel.repaint();
260 synchronized void resetResultViewer() {
261 resultsViewerPanel.remove(imageThumbnailViewer);
262 resultsViewerPanel.remove(videoThumbnailViewer);
263 resultsViewerPanel.remove(documentPreviewViewer);
265 for (SwingWorker<Void, Void> thumbWorker : resultContentWorkers) {
266 if (!thumbWorker.isDone()) {
267 thumbWorker.cancel(
true);
271 resultContentWorkers.clear();
272 videoThumbnailViewer.clearViewer();
273 imageThumbnailViewer.clearViewer();
274 documentPreviewViewer.clearViewer();
283 synchronized void populateVideoViewer(List<ResultFile> files) {
284 for (ResultFile file : files) {
285 VideoThumbnailWorker thumbWorker =
new VideoThumbnailWorker(file);
286 thumbWorker.execute();
288 resultContentWorkers.add(thumbWorker);
298 synchronized void populateImageViewer(List<ResultFile> files) {
299 for (ResultFile file : files) {
300 ImageThumbnailWorker thumbWorker =
new ImageThumbnailWorker(file);
301 thumbWorker.execute();
303 resultContentWorkers.add(thumbWorker);
313 synchronized void populateDocumentViewer(List<ResultFile> files) {
314 for (ResultFile file : files) {
315 DocumentPreviewWorker documentWorker =
new DocumentPreviewWorker(file);
316 documentWorker.execute();
318 resultContentWorkers.add(documentWorker);
328 void handleGroupSelectedEvent(DiscoveryEventUtils.GroupSelectedEvent groupSelectedEvent) {
329 SwingUtilities.invokeLater(() -> {
330 searchFilters = groupSelectedEvent.getFilters();
331 groupingAttribute = groupSelectedEvent.getGroupingAttr();
332 groupSort = groupSelectedEvent.getGroupSort();
333 fileSortMethod = groupSelectedEvent.getFileSort();
334 selectedGroupKey = groupSelectedEvent.getGroupKey();
335 resultType = groupSelectedEvent.getResultType();
336 groupSize = groupSelectedEvent.getGroupSize();
348 void handleNoResultsEvent(DiscoveryEventUtils.NoResultsEvent noResultsEvent) {
349 SwingUtilities.invokeLater(() -> {
353 videoThumbnailViewer.clearViewer();
354 imageThumbnailViewer.clearViewer();
355 documentPreviewViewer.clearViewer();
356 resultsViewerPanel.revalidate();
357 resultsViewerPanel.repaint();
367 private synchronized void setPage(
int startingEntry) {
368 int pageSize = pageSizeComboBox.getItemAt(pageSizeComboBox.getSelectedIndex());
369 synchronized (
this) {
370 if (pageWorker != null && !pageWorker.isDone()) {
371 pageWorker.cancel(
true);
379 logger.log(Level.SEVERE,
"Error loading central repository database, no central repository options will be available for File Discovery", ex);
382 pageWorker =
new PageWorker(searchFilters, groupingAttribute, groupSort, fileSortMethod, selectedGroupKey, startingEntry, pageSize, resultType, centralRepo);
383 pageWorker.execute();
390 @Messages({
"# {0} - currentPage",
391 "# {1} - totalPages",
392 "ResultsPanel.currentPage.displayValue=Page: {0} of {1}"})
394 previousPageSize = pageSizeComboBox.getItemAt(pageSizeComboBox.getSelectedIndex());
395 int pageSize = pageSizeComboBox.getItemAt(pageSizeComboBox.getSelectedIndex());
397 double maxPageDouble = groupSize == 0 ? 1 : Math.ceil((
double) groupSize / pageSize);
398 currentPageLabel.setText(Bundle.ResultsPanel_currentPage_displayValue(currentPage + 1, maxPageDouble));
399 previousPageButton.setEnabled(currentPage != 0);
400 nextPageButton.setEnabled(groupSize > ((currentPage + 1) * pageSize));
401 gotoPageField.setEnabled(groupSize > pageSize);
402 pageSizeComboBox.setEnabled(
true);
410 @SuppressWarnings(
"unchecked")
412 private
void initComponents() {
414 javax.swing.JPanel pagingPanel =
new javax.swing.JPanel();
415 previousPageButton =
new javax.swing.JButton();
416 currentPageLabel =
new javax.swing.JLabel();
417 nextPageButton =
new javax.swing.JButton();
418 javax.swing.JLabel pageControlsLabel =
new javax.swing.JLabel();
419 javax.swing.JLabel gotoPageLabel =
new javax.swing.JLabel();
420 gotoPageField =
new javax.swing.JTextField();
421 javax.swing.JLabel pageSizeLabel =
new javax.swing.JLabel();
422 pageSizeComboBox =
new javax.swing.JComboBox<>();
423 javax.swing.JSplitPane resultsSplitPane =
new javax.swing.JSplitPane();
424 javax.swing.JPanel instancesPanel =
new javax.swing.JPanel();
425 javax.swing.JScrollPane instancesScrollPane =
new javax.swing.JScrollPane();
426 instancesList =
new javax.swing.JList<>();
427 resultsViewerPanel =
new javax.swing.JPanel();
429 setPreferredSize(
new java.awt.Dimension(777, 475));
431 pagingPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
433 previousPageButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_back.png")));
434 previousPageButton.setBorder(null);
435 previousPageButton.setDisabledIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_back_disabled.png")));
436 previousPageButton.setEnabled(
false);
437 previousPageButton.setFocusable(
false);
438 previousPageButton.setRolloverIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_back_hover.png")));
439 previousPageButton.addActionListener(
new java.awt.event.ActionListener() {
440 public void actionPerformed(java.awt.event.ActionEvent evt) {
441 previousPageButtonActionPerformed(evt);
445 org.openide.awt.Mnemonics.setLocalizedText(currentPageLabel,
org.openide.util.NbBundle.getMessage(
ResultsPanel.class,
"ResultsPanel.currentPageLabel.text"));
446 currentPageLabel.setMaximumSize(
new java.awt.Dimension(90, 23));
447 currentPageLabel.setMinimumSize(
new java.awt.Dimension(90, 23));
448 currentPageLabel.setPreferredSize(
new java.awt.Dimension(90, 23));
450 nextPageButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_forward.png")));
451 nextPageButton.setBorder(null);
452 nextPageButton.setDisabledIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_forward_disabled.png")));
453 nextPageButton.setEnabled(
false);
454 nextPageButton.setFocusable(
false);
455 nextPageButton.setRolloverIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_forward_hover.png")));
456 nextPageButton.addActionListener(
new java.awt.event.ActionListener() {
457 public void actionPerformed(java.awt.event.ActionEvent evt) {
458 nextPageButtonActionPerformed(evt);
462 org.openide.awt.Mnemonics.setLocalizedText(pageControlsLabel,
org.openide.util.NbBundle.getMessage(
ResultsPanel.class,
"ResultsPanel.pageControlsLabel.text"));
463 pageControlsLabel.setMaximumSize(
new java.awt.Dimension(33, 23));
464 pageControlsLabel.setMinimumSize(
new java.awt.Dimension(33, 23));
465 pageControlsLabel.setPreferredSize(
new java.awt.Dimension(33, 23));
467 org.openide.awt.Mnemonics.setLocalizedText(gotoPageLabel,
org.openide.util.NbBundle.getMessage(
ResultsPanel.class,
"ResultsPanel.gotoPageLabel.text"));
468 gotoPageLabel.setMaximumSize(
new java.awt.Dimension(70, 23));
469 gotoPageLabel.setMinimumSize(
new java.awt.Dimension(70, 23));
470 gotoPageLabel.setPreferredSize(
new java.awt.Dimension(70, 23));
472 gotoPageField.setEnabled(
false);
473 gotoPageField.addActionListener(
new java.awt.event.ActionListener() {
474 public void actionPerformed(java.awt.event.ActionEvent evt) {
475 gotoPageFieldActionPerformed(evt);
479 org.openide.awt.Mnemonics.setLocalizedText(pageSizeLabel,
org.openide.util.NbBundle.getMessage(
ResultsPanel.class,
"ResultsPanel.pageSizeLabel.text"));
480 pageSizeLabel.setMaximumSize(
new java.awt.Dimension(60, 23));
481 pageSizeLabel.setMinimumSize(
new java.awt.Dimension(60, 23));
482 pageSizeLabel.setPreferredSize(
new java.awt.Dimension(60, 23));
484 pageSizeComboBox.setModel(
new DefaultComboBoxModel<Integer>(
new Integer[] {25,50,75,100,125,150,175,200}));
485 pageSizeComboBox.setSelectedIndex(3);
486 pageSizeComboBox.addItemListener(
new java.awt.event.ItemListener() {
487 public void itemStateChanged(java.awt.event.ItemEvent evt) {
488 pageSizeChanged(evt);
492 javax.swing.GroupLayout pagingPanelLayout =
new javax.swing.GroupLayout(pagingPanel);
493 pagingPanel.setLayout(pagingPanelLayout);
494 pagingPanelLayout.setHorizontalGroup(
495 pagingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
496 .addGroup(pagingPanelLayout.createSequentialGroup()
498 .addComponent(currentPageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
500 .addComponent(pageControlsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
501 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
502 .addComponent(previousPageButton)
504 .addComponent(nextPageButton)
506 .addComponent(gotoPageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
507 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
508 .addComponent(gotoPageField, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
510 .addComponent(pageSizeLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
511 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
512 .addComponent(pageSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
513 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
515 pagingPanelLayout.setVerticalGroup(
516 pagingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
517 .addGroup(pagingPanelLayout.createSequentialGroup()
519 .addGroup(pagingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
520 .addComponent(nextPageButton, javax.swing.GroupLayout.Alignment.TRAILING)
521 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pagingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
522 .addComponent(previousPageButton, javax.swing.GroupLayout.Alignment.TRAILING)
523 .addComponent(currentPageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
524 .addComponent(pageControlsLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
525 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pagingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
526 .addComponent(gotoPageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
527 .addComponent(gotoPageField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
528 .addComponent(pageSizeLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
529 .addComponent(pageSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
533 resultsSplitPane.setDividerLocation(380);
534 resultsSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
535 resultsSplitPane.setResizeWeight(1.0);
536 resultsSplitPane.setToolTipText(
org.openide.util.NbBundle.getMessage(
ResultsPanel.class,
"ResultsPanel.resultsSplitPane.toolTipText"));
537 resultsSplitPane.setLastDividerLocation(180);
538 resultsSplitPane.setOpaque(
false);
539 resultsSplitPane.setPreferredSize(
new java.awt.Dimension(777, 440));
541 instancesPanel.setPreferredSize(
new java.awt.Dimension(775, 68));
543 instancesScrollPane.setPreferredSize(
new java.awt.Dimension(775, 60));
545 instancesList.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
ResultsPanel.class,
"ResultsPanel.instancesList.border.title")));
546 instancesList.setModel(instancesListModel);
547 instancesList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
549 instancesList.setVisibleRowCount(2);
550 instancesScrollPane.setViewportView(instancesList);
552 javax.swing.GroupLayout instancesPanelLayout =
new javax.swing.GroupLayout(instancesPanel);
553 instancesPanel.setLayout(instancesPanelLayout);
554 instancesPanelLayout.setHorizontalGroup(
555 instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
556 .addGap(0, 775, Short.MAX_VALUE)
557 .addGroup(instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
558 .addComponent(instancesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
560 instancesPanelLayout.setVerticalGroup(
561 instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
562 .addGap(0, 68, Short.MAX_VALUE)
563 .addGroup(instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
564 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, instancesPanelLayout.createSequentialGroup()
566 .addComponent(instancesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
569 resultsSplitPane.setRightComponent(instancesPanel);
571 resultsViewerPanel.setPreferredSize(
new java.awt.Dimension(0, 380));
572 resultsViewerPanel.setLayout(
new java.awt.BorderLayout());
573 resultsSplitPane.setLeftComponent(resultsViewerPanel);
575 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
576 this.setLayout(layout);
577 layout.setHorizontalGroup(
578 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
579 .addComponent(pagingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
580 .addComponent(resultsSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
582 layout.setVerticalGroup(
583 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
584 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
585 .addComponent(pagingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
587 .addComponent(resultsSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
598 if (currentPage > 0) {
599 disablePagingControls();
600 int previousPage = currentPage - 1;
601 int pageSize = pageSizeComboBox.getItemAt(pageSizeComboBox.getSelectedIndex());
602 setPage(previousPage * pageSize);
612 disablePagingControls();
613 int nextPage = currentPage + 1;
614 int pageSize = pageSizeComboBox.getItemAt(pageSizeComboBox.getSelectedIndex());
615 setPage(nextPage * pageSize);
623 @Messages({
"# {0} - selectedPage",
625 "ResultsPanel.invalidPageNumber.message=The selected page number {0} does not exist. Please select a value from 1 to {1}.",
626 "ResultsPanel.invalidPageNumber.title=Invalid Page Number"})
630 newPage = Integer.parseInt(gotoPageField.getText());
631 }
catch (NumberFormatException e) {
635 int pageSize = pageSizeComboBox.getItemAt(pageSizeComboBox.getSelectedIndex());
636 if ((newPage - 1) < 0 || groupSize <= ((newPage - 1) * pageSize)) {
637 JOptionPane.showMessageDialog(
this,
638 Bundle.ResultsPanel_invalidPageNumber_message(newPage, Math.ceil((
double) groupSize / pageSize)),
639 Bundle.ResultsPanel_invalidPageNumber_title(),
640 JOptionPane.WARNING_MESSAGE);
643 disablePagingControls();
644 setPage((newPage - 1) * pageSize);
648 if (evt.getStateChange() == ItemEvent.SELECTED) {
649 disablePagingControls();
650 int previousPage = currentPage - 1;
651 int pageSize = pageSizeComboBox.getItemAt(pageSizeComboBox.getSelectedIndex());
652 if (previousPageSize != pageSize) {
655 setPage(previousPage * pageSize);
663 nextPageButton.setEnabled(
false);
664 previousPageButton.setEnabled(
false);
665 gotoPageField.setEnabled(
false);
666 pageSizeComboBox.setEnabled(
false);
694 thumbnailWrapper =
new VideoThumbnailsWrapper(file);
695 videoThumbnailViewer.addVideo(thumbnailWrapper);
700 FileSearch.getVideoThumbnails(thumbnailWrapper);
708 }
catch (InterruptedException | ExecutionException ex) {
709 logger.log(Level.WARNING,
"Video Worker Exception for file: " + thumbnailWrapper.getResultFile().getFirstInstance().getId(), ex);
710 }
catch (CancellationException ignored) {
713 videoThumbnailViewer.repaint();
733 imageThumbnailViewer.addImage(thumbnailWrapper);
739 if (thumbnail != null) {
740 thumbnailWrapper.setImageThumbnail(thumbnail);
749 }
catch (InterruptedException | ExecutionException ex) {
750 logger.log(Level.WARNING,
"Image Worker Exception for file: " + thumbnailWrapper.getResultFile().getFirstInstance().getId(), ex);
751 }
catch (CancellationException ignored) {
754 imageThumbnailViewer.repaint();
775 documentPreviewViewer.addDocument(documentWrapper);
778 @Messages({
"ResultsPanel.unableToCreate.text=Unable to create summary."})
781 TextSummary preview = FileSearch.summarize(documentWrapper.getResultFile().getFirstInstance());
782 if (preview == null) {
783 preview =
new TextSummary(Bundle.ResultsPanel_unableToCreate_text(), null, 0);
785 documentWrapper.setSummary(preview);
789 @Messages({
"ResultsPanel.documentPreview.text=Document preview creation cancelled."})
794 }
catch (InterruptedException | ExecutionException ex) {
795 documentWrapper.setSummary(
new TextSummary(ex.getMessage(), null, 0));
796 logger.log(Level.WARNING,
"Document Worker Exception", ex);
797 }
catch (CancellationException ignored) {
798 documentWrapper.setSummary(
new TextSummary(Bundle.ResultsPanel_documentPreview_text(), null, 0));
801 documentPreviewViewer.repaint();
811 private static final long serialVersionUID = 1L;
815 super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
817 if (value instanceof AbstractFile) {
818 AbstractFile file = (AbstractFile) value;
820 name = file.getUniquePath();
821 }
catch (TskCoreException ingored) {
822 name = file.getParentPath() +
"/" + file.getName();
ListSelectionListener listener
List< FileSearchFiltering.FileFilter > searchFilters
javax.swing.JButton previousPageButton
final List< SwingWorker< Void, Void > > resultContentWorkers
javax.swing.JLabel currentPageLabel
FileSearchData.FileType resultType
final ImageThumbnailWrapper thumbnailWrapper
void gotoPageFieldActionPerformed(java.awt.event.ActionEvent evt)
final VideoThumbnailViewer videoThumbnailViewer
javax.swing.JComboBox< Integer > pageSizeComboBox
Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus)
GroupKey selectedGroupKey
final DefaultListModel< AbstractFile > instancesListModel
javax.swing.JTextField gotoPageField
final DocumentPreviewViewer documentPreviewViewer
List< AbstractFile > getInstancesForSelected()
static final Logger logger
javax.swing.JPanel resultsViewerPanel
javax.swing.JList< AbstractFile > instancesList
void nextPageButtonActionPerformed(java.awt.event.ActionEvent evt)
void disablePagingControls()
static final long serialVersionUID
javax.swing.JButton nextPageButton
FileSorter.SortingMethod fileSortMethod
final DocumentWrapper documentWrapper
void previousPageButtonActionPerformed(java.awt.event.ActionEvent evt)
void pageSizeChanged(java.awt.event.ItemEvent evt)
final VideoThumbnailsWrapper thumbnailWrapper
FileGroup.GroupSortingAlgorithm groupSort
synchronized static Logger getLogger(String name)
final ImageThumbnailViewer imageThumbnailViewer
static BufferedImage getThumbnail(Content content, int iconSize)
static final int ICON_SIZE_LARGE
synchronized void setPage(int startingEntry)
static CentralRepository getInstance()
FileSearch.AttributeType groupingAttribute
static boolean isEnabled()