Autopsy  4.7.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
HashLookupSettingsPanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2018 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.modules.hashdatabase;
20 
21 import java.awt.Color;
22 import java.awt.Component;
23 import java.awt.EventQueue;
24 import java.awt.Frame;
25 import java.awt.event.KeyEvent;
26 import java.beans.PropertyChangeEvent;
27 import java.beans.PropertyChangeListener;
28 import java.io.File;
29 import java.util.ArrayList;
30 import java.util.List;
31 import java.util.logging.Level;
32 import javax.swing.JComponent;
33 import javax.swing.JOptionPane;
34 import javax.swing.JTable;
35 import javax.swing.ListSelectionModel;
36 import javax.swing.SwingUtilities;
37 import javax.swing.event.ListSelectionEvent;
38 import javax.swing.event.ListSelectionListener;
39 import javax.swing.table.AbstractTableModel;
40 import javax.swing.table.TableCellRenderer;
41 import org.netbeans.spi.options.OptionsPanelController;
42 import org.openide.util.NbBundle;
43 import org.openide.util.NbBundle.Messages;
54 import org.sleuthkit.datamodel.TskCoreException;
56 
61 @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
63 
64  private static final String NO_SELECTION_TEXT = NbBundle
65  .getMessage(HashLookupSettingsPanel.class, "HashDbConfigPanel.noSelectionText");
66  private static final String ERROR_GETTING_PATH_TEXT = NbBundle
67  .getMessage(HashLookupSettingsPanel.class, "HashDbConfigPanel.errorGettingPathText");
68  private static final String ERROR_GETTING_INDEX_STATUS_TEXT = NbBundle
69  .getMessage(HashLookupSettingsPanel.class, "HashDbConfigPanel.errorGettingIndexStatusText");
70  private final HashDbManager hashSetManager = HashDbManager.getInstance();
71  private final HashSetTableModel hashSetTableModel = new HashSetTableModel();
72  private final List<Integer> newReferenceSetIDs = new ArrayList<>();
73 
75  initComponents();
76  customizeComponents();
77  updateComponentsForNoSelection();
78 
79  // Listen to the ingest modules to refresh the enabled/disabled state of
80  // the components in sync with file ingest.
81  IngestManager.getInstance().addIngestJobEventListener(new PropertyChangeListener() {
82  @Override
83  public void propertyChange(PropertyChangeEvent evt) {
84  if (isLocalIngestJobEvent(evt)) {
85  EventQueue.invokeLater(new Runnable() {
86  @Override
87  public void run() {
88  updateComponents();
89  }
90  });
91  }
92  }
93  });
94  }
95 
96  @NbBundle.Messages({"HashLookupSettingsPanel.Title=Global Hash Lookup Settings"})
97  private void customizeComponents() {
98  setName(Bundle.HashLookupSettingsPanel_Title());
99  this.ingestWarningLabel.setVisible(false);
100  this.hashSetTable.setModel(hashSetTableModel);
101  this.hashSetTable.setTableHeader(null);
102  hashSetTable.getParent().setBackground(hashSetTable.getBackground());
103  hashSetTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
104  hashSetTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
105  @Override
106  public void valueChanged(ListSelectionEvent e) {
107  if (!e.getValueIsAdjusting()) {
108  updateComponents();
109  }
110  }
111  });
112  }
113 
114  private void updateComponents() {
115  HashDb db = ((HashSetTable) hashSetTable).getSelection();
116  if (db != null) {
117  updateComponentsForSelection(db);
118  } else {
119  updateComponentsForNoSelection();
120  }
121  }
122 
124  boolean ingestIsRunning = IngestManager.getInstance().isIngestRunning();
125 
126  // Update descriptive labels.
127  hashDbNameLabel.setText(NO_SELECTION_TEXT);
128  hashDbTypeLabel.setText(NO_SELECTION_TEXT);
129  hashDbLocationLabel.setText(NO_SELECTION_TEXT);
130  hashDbVersionLabel.setText(NO_SELECTION_TEXT);
131  hashDbOrgLabel.setText(NO_SELECTION_TEXT);
132  hashDbReadOnlyLabel.setText(NO_SELECTION_TEXT);
133  indexPathLabel.setText(NO_SELECTION_TEXT);
134 
135  // Update indexing components.
136  hashDbIndexStatusLabel.setText(NO_SELECTION_TEXT);
137  hashDbIndexStatusLabel.setForeground(Color.black);
138  indexButton.setText(NbBundle.getMessage(this.getClass(), "HashDbConfigPanel.indexButtonText.index"));
139  indexButton.setEnabled(false);
140  addHashesToDatabaseButton.setEnabled(false);
141 
142  // Update ingest options.
143  sendIngestMessagesCheckBox.setSelected(false);
144  sendIngestMessagesCheckBox.setEnabled(false);
145  optionsLabel.setEnabled(false);
146  optionsSeparator.setEnabled(false);
147 
148  // Update database action buttons.
149  createDatabaseButton.setEnabled(true);
150  importDatabaseButton.setEnabled(true);
151  deleteDatabaseButton.setEnabled(false);
152 
153  // Update ingest in progress warning label.
154  ingestWarningLabel.setVisible(ingestIsRunning);
155  }
156 
157  @NbBundle.Messages({"HashLookupSettingsPanel.readOnly=Read only",
158  "HashLookupSettingsPanel.editable=Editable",
159  "HashLookupSettingsPanel.updateStatusError=Error reading status",
160  "HashLookupSettingsPanel.notApplicable=N/A",
161  "HashLookupSettingsPanel.centralRepo=Central Repository"
162  })
164  boolean ingestIsRunning = IngestManager.getInstance().isIngestRunning();
165 
166  // Update descriptive labels.
167  hashDbNameLabel.setText(db.getHashSetName());
168  hashDbTypeLabel.setText(db.getKnownFilesType().getDisplayName());
169  try {
170  if (db.isUpdateable()) {
171  hashDbReadOnlyLabel.setText(Bundle.HashLookupSettingsPanel_editable());
172  } else {
173  hashDbReadOnlyLabel.setText(Bundle.HashLookupSettingsPanel_readOnly());
174  }
175  } catch (TskCoreException ex) {
176  hashDbReadOnlyLabel.setText(Bundle.HashLookupSettingsPanel_updateStatusError());
177  }
178 
179  try {
180  addHashesToDatabaseButton.setEnabled(!ingestIsRunning && db.isUpdateable());
181  } catch (TskCoreException ex) {
182  Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.SEVERE, "Error identifying if the hash set is updateable.", ex); //NON-NLS
183  addHashesToDatabaseButton.setEnabled(false);
184  }
185 
186  if (db instanceof SleuthkitHashSet) {
187  SleuthkitHashSet hashDb = (SleuthkitHashSet) db;
188 
189  // Disable the central repo fields
190  hashDbVersionLabel.setText(Bundle.HashLookupSettingsPanel_notApplicable());
191  hashDbOrgLabel.setText(Bundle.HashLookupSettingsPanel_notApplicable());
192 
193  // Enable the delete button if ingest is not running
194  deleteDatabaseButton.setEnabled(!ingestIsRunning);
195 
196  try {
197  hashDbLocationLabel.setText(shortenPath(db.getDatabasePath()));
198  } catch (TskCoreException ex) {
199  Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.SEVERE, "Error getting hash set path of " + db.getHashSetName() + " hash set", ex); //NON-NLS
200  hashDbLocationLabel.setText(ERROR_GETTING_PATH_TEXT);
201  }
202 
203  try {
204  indexPathLabel.setText(shortenPath(hashDb.getIndexPath()));
205  } catch (TskCoreException ex) {
206  Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.SEVERE, "Error getting index path of " + db.getHashSetName() + " hash set", ex); //NON-NLS
207  indexPathLabel.setText(ERROR_GETTING_PATH_TEXT);
208  }
209 
210  // Update indexing components.
211  try {
212  if (hashDb.isIndexing()) {
213  indexButton.setText(
214  NbBundle.getMessage(this.getClass(), "HashDbConfigPanel.indexButtonText.indexing"));
215  hashDbIndexStatusLabel.setText(
216  NbBundle.getMessage(this.getClass(), "HashDbConfigPanel.indexStatusText.indexGen"));
217  hashDbIndexStatusLabel.setForeground(Color.black);
218  indexButton.setEnabled(false);
219  } else if (hashDb.hasIndex()) {
220  if (hashDb.hasIndexOnly()) {
221  hashDbIndexStatusLabel.setText(
222  NbBundle.getMessage(this.getClass(), "HashDbConfigPanel.indexStatusText.indexOnly"));
223  } else {
224  hashDbIndexStatusLabel.setText(
225  NbBundle.getMessage(this.getClass(), "HashDbConfigPanel.indexStatusText.indexed"));
226  }
227  hashDbIndexStatusLabel.setForeground(Color.black);
228  if (hashDb.canBeReIndexed()) {
229  indexButton.setText(
230  NbBundle.getMessage(this.getClass(), "HashDbConfigPanel.indexButtonText.reIndex"));
231  indexButton.setEnabled(true);
232  } else {
233  indexButton.setText(NbBundle.getMessage(this.getClass(), "HashDbConfigPanel.indexButtonText.index"));
234  indexButton.setEnabled(false);
235  }
236  } else {
237  hashDbIndexStatusLabel.setText(
238  NbBundle.getMessage(this.getClass(), "HashDbConfigPanel.indexStatusText.noIndex"));
239  hashDbIndexStatusLabel.setForeground(Color.red);
240  indexButton.setText(NbBundle.getMessage(this.getClass(), "HashDbConfigPanel.indexButtonText.index"));
241  indexButton.setEnabled(true);
242  }
243  } catch (TskCoreException ex) {
244  Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.SEVERE, "Error getting index state of hash set", ex); //NON-NLS
245  hashDbIndexStatusLabel.setText(ERROR_GETTING_INDEX_STATUS_TEXT);
246  hashDbIndexStatusLabel.setForeground(Color.red);
247  indexButton.setText(NbBundle.getMessage(this.getClass(), "HashDbConfigPanel.indexButtonText.index"));
248  indexButton.setEnabled(false);
249  }
250  } else {
251 
252  // Disable the file type fields/buttons
253  indexPathLabel.setText(Bundle.HashLookupSettingsPanel_notApplicable());
254  hashDbIndexStatusLabel.setText(Bundle.HashLookupSettingsPanel_notApplicable());
255  hashDbLocationLabel.setText(Bundle.HashLookupSettingsPanel_centralRepo());
256  indexButton.setEnabled(false);
257  deleteDatabaseButton.setEnabled(false);
258 
259  CentralRepoHashSet crDb = (CentralRepoHashSet) db;
260 
261  hashDbVersionLabel.setText(crDb.getVersion());
262  hashDbOrgLabel.setText(crDb.getOrgName());
263  }
264 
265  // Disable the indexing button if ingest is in progress.
266  if (ingestIsRunning) {
267  indexButton.setEnabled(false);
268  }
269 
270  // Update ingest option components.
271  sendIngestMessagesCheckBox.setSelected(db.getSendIngestMessages());
272  sendIngestMessagesCheckBox.setEnabled(!ingestIsRunning && db.getKnownFilesType().equals(KnownFilesType.KNOWN_BAD));
273  optionsLabel.setEnabled(!ingestIsRunning);
274  optionsSeparator.setEnabled(!ingestIsRunning);
275 
276  // Update database action buttons.
277  createDatabaseButton.setEnabled(true);
278  importDatabaseButton.setEnabled(true);
279 
280  // Update ingest in progress warning label.
281  ingestWarningLabel.setVisible(ingestIsRunning);
282  }
283 
284  private static String shortenPath(String path) {
285  String shortenedPath = path;
286  if (shortenedPath.length() > 50) {
287  shortenedPath = shortenedPath.substring(0, 10 + shortenedPath.substring(10).indexOf(File.separator) + 1) + "..." + shortenedPath.substring((shortenedPath.length() - 20) + shortenedPath.substring(shortenedPath.length() - 20).indexOf(File.separator));
288  }
289  return shortenedPath;
290  }
291 
292  private boolean isLocalIngestJobEvent(PropertyChangeEvent evt) {
293  if (evt instanceof AutopsyEvent) {
294  AutopsyEvent event = (AutopsyEvent) evt;
295  if (event.getSourceType() == AutopsyEvent.SourceType.LOCAL) {
296  String eventType = event.getPropertyName();
297  return (eventType.equals(IngestManager.IngestJobEvent.STARTED.toString())
298  || eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())
299  || eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString()));
300  }
301  }
302  return false;
303  }
304 
305  @Override
306  @Messages({"HashLookupSettingsPanel.saveFail.message=Couldn't save hash set settings.",
307  "HashLookupSettingsPanel.saveFail.title=Save Fail"})
308  public void saveSettings() {
309  // Clear out the list of new central repo hash sets. They don't need to be
310  // indexed so will all be saved on both code paths.
311  newReferenceSetIDs.clear();
312 
313  //Checking for for any unindexed databases
314  List<SleuthkitHashSet> unindexed = new ArrayList<>();
315  for (HashDb db : hashSetManager.getAllHashSets()) {
316  if (db instanceof SleuthkitHashSet) {
317  try {
318  SleuthkitHashSet hashDatabase = (SleuthkitHashSet) db;
319  if (!hashDatabase.hasIndex()) {
320  unindexed.add(hashDatabase);
321  }
322  } catch (TskCoreException ex) {
323  Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.SEVERE, "Error getting index info for hash set", ex); //NON-NLS
324  }
325  }
326  }
327 
328  // If there are unindexed databases, give the user the option to index them now. This
329  // needs to be on the EDT, and will save the hash settings after completing
330  if (!unindexed.isEmpty()) {
331  SwingUtilities.invokeLater(new Runnable() {
332  @Override
333  public void run() {
334  //If unindexed ones are found, show a popup box that will either index them, or remove them.
335  if (unindexed.size() == 1) {
336  showInvalidIndex(false, unindexed);
337  } else if (unindexed.size() > 1) {
338  showInvalidIndex(true, unindexed);
339  }
340  }
341  });
342  } else {
343  try {
344  hashSetManager.save();
346  SwingUtilities.invokeLater(() -> {
347  JOptionPane.showMessageDialog(this, Bundle.HashLookupSettingsPanel_saveFail_message(), Bundle.HashLookupSettingsPanel_saveFail_title(), JOptionPane.ERROR_MESSAGE);
348  });
349  }
350  }
351  }
352 
353  @Override
354  public void load() {
355  hashSetTable.clearSelection();
356  hashSetTableModel.refreshModel();
357  }
358 
359  @Override
360  public void store() {
361  saveSettings();
362  }
363 
364  public void cancel() {
365  /*
366  * Revert back to last settings only if the user could have made
367  * changes. Doing this while ingest is running causes hash dbs to be
368  * closed while they are still being used.
369  */
370  if (IngestManager.getInstance().isIngestRunning() == false) {
371  // Remove any new central repo hash sets from the database
372  for (int refID : newReferenceSetIDs) {
373  try {
374  if (EamDb.isEnabled()) {
376  } else {
377  // This is the case where the user imported a database, then switched over to the central
378  // repo panel and disabled it before cancelling. We can't delete the database at this point.
379  Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.WARNING, "Error reverting central repository hash sets"); //NON-NLS
380  }
381  } catch (EamDbException ex) {
382  Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.SEVERE, "Error reverting central repository hash sets", ex); //NON-NLS
383  }
384  }
386  }
387  }
388 
389  @Messages({"# {0} - hash lookup name", "HashLookupSettingsPanel.removeDatabaseFailure.message=Failed to remove hash lookup: {0}"})
390  void removeThese(List<SleuthkitHashSet> toRemove) {
391  for (SleuthkitHashSet hashDb : toRemove) {
392  try {
393  hashSetManager.removeHashDatabaseNoSave(hashDb);
394  } catch (HashDbManager.HashDbManagerException ex) {
395  JOptionPane.showMessageDialog(this, Bundle.HashLookupSettingsPanel_removeDatabaseFailure_message(hashDb.getHashSetName()));
396  }
397  }
398  hashSetTableModel.refreshModel();
399  }
400 
409  private void showInvalidIndex(boolean plural, List<SleuthkitHashSet> unindexed) {
410  String total = "";
411  String message;
412  for (HashDb hdb : unindexed) {
413  total += "\n" + hdb.getHashSetName();
414  }
415  if (plural) {
416  message = NbBundle.getMessage(this.getClass(), "HashDbConfigPanel.dbsNotIndexedMsg", total);
417  } else {
418  message = NbBundle.getMessage(this.getClass(), "HashDbConfigPanel.dbNotIndexedMsg", total);
419  }
420  int res = JOptionPane.showConfirmDialog(this, message,
421  NbBundle.getMessage(this.getClass(),
422  "HashDbConfigPanel.unindexedDbsMsg"),
423  JOptionPane.YES_NO_OPTION);
424  if (res == JOptionPane.YES_OPTION) {
425  ModalNoButtons indexingDialog = new ModalNoButtons(this, new Frame(), unindexed);
426  indexingDialog.setLocationRelativeTo(null);
427  indexingDialog.setVisible(true);
428  indexingDialog.setModal(true);
429  hashSetTableModel.refreshModel();
430  }
431  if (res == JOptionPane.NO_OPTION) {
432  JOptionPane.showMessageDialog(this, NbBundle.getMessage(this.getClass(),
433  "HashDbConfigPanel.allUnindexedDbsRmFromListMsg"));
434  removeThese(unindexed);
435  }
436  try {
437  hashSetManager.save();
439  JOptionPane.showMessageDialog(this, Bundle.HashLookupSettingsPanel_saveFail_message(), Bundle.HashLookupSettingsPanel_saveFail_title(), JOptionPane.ERROR_MESSAGE);
440  }
441  }
442 
443  boolean valid() {
444  return true;
445  }
446 
450  private class HashSetTable extends JTable {
451 
452  @Override
453  public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
454  // Use the hash set name as the cell text.
455  JComponent cellRenderer = (JComponent) super.prepareRenderer(renderer, row, column);
456  cellRenderer.setToolTipText((String) getValueAt(row, column));
457 
458  // Give the user a visual indication of any hash sets with a hash
459  // database that needs to be indexed by displaying the hash set name
460  // in red.
461  if (hashSetTableModel.isValid(row)) {
462  cellRenderer.setForeground(Color.black);
463  } else {
464  cellRenderer.setForeground(Color.red);
465  }
466 
467  return cellRenderer;
468  }
469 
470  public HashDb getSelection() {
471  return hashSetTableModel.getHashSetAt(getSelectionModel().getMinSelectionIndex());
472  }
473 
474  public void setSelection(int index) {
475  if (index >= 0 && index < hashSetTable.getRowCount()) {
476  getSelectionModel().setSelectionInterval(index, index);
477  }
478  }
479 
480  public void selectRowByDatabase(HashDb db) {
481  setSelection(hashSetTableModel.getIndexByDatabase(db));
482  }
483 
484  @Deprecated
485  public void selectRowByName(String name) {
486  setSelection(hashSetTableModel.getIndexByName(name));
487  }
488  }
489 
494  private class HashSetTableModel extends AbstractTableModel {
495 
496  List<HashDb> hashSets = HashDbManager.getInstance().getAllHashSets();
497 
498  @Override
499  public int getColumnCount() {
500  return 1;
501  }
502 
503  @Override
504  public int getRowCount() {
505  return hashSets.size();
506  }
507 
508  @Override
509  public String getColumnName(int column) {
510  return NbBundle.getMessage(this.getClass(), "HashDbConfigPanel.nameColLbl");
511  }
512 
513  @Override
514  public Object getValueAt(int rowIndex, int columnIndex) {
515  return hashSets.get(rowIndex).getDisplayName();
516  }
517 
518  private boolean isValid(int rowIndex) {
519  try {
520  return hashSets.get(rowIndex).isValid();
521  } catch (TskCoreException ex) {
522  Logger.getLogger(HashSetTableModel.class.getName()).log(Level.SEVERE, "Error getting index info for hash set", ex); //NON-NLS
523  return false;
524  }
525  }
526 
527  @Override
528  public boolean isCellEditable(int rowIndex, int columnIndex) {
529  return false;
530  }
531 
532  @Override
533  public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
534  throw new UnsupportedOperationException(
535  NbBundle.getMessage(this.getClass(), "HashDbConfigPanel.editingCellsNotSupportedMsg"));
536  }
537 
538  @Override
539  public Class<?> getColumnClass(int c) {
540  return getValueAt(0, c).getClass();
541  }
542 
543  HashDb getHashSetAt(int index) {
544  if (!hashSets.isEmpty() && index >= 0 && index < hashSets.size()) {
545  return hashSets.get(index);
546  } else {
547  return null;
548  }
549  }
550 
551  int getIndexByDatabase(HashDb db) {
552  for (int i = 0; i < hashSets.size(); ++i) {
553  if (hashSets.get(i).equals(db)) {
554  return i;
555  }
556  }
557  return -1;
558  }
559 
560  @Deprecated
561  int getIndexByName(String name) {
562  for (int i = 0; i < hashSets.size(); ++i) {
563  if (hashSets.get(i).getHashSetName().equals(name)) {
564  return i;
565  }
566  }
567  return -1;
568  }
569 
570  void refreshModel() {
571  hashSets = HashDbManager.getInstance().getAllHashSets();
572  refreshDisplay();
573  }
574 
575  void refreshDisplay() {
576  fireTableDataChanged();
577  }
578  }
579 
585  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
586  private void initComponents() {
587 
588  jLabel2 = new javax.swing.JLabel();
589  jLabel4 = new javax.swing.JLabel();
590  jLabel6 = new javax.swing.JLabel();
591  jButton3 = new javax.swing.JButton();
592  jScrollPane2 = new javax.swing.JScrollPane();
593  jPanel1 = new javax.swing.JPanel();
594  ingestWarningLabel = new javax.swing.JLabel();
595  jScrollPane1 = new javax.swing.JScrollPane();
596  hashSetTable = new HashSetTable();
597  deleteDatabaseButton = new javax.swing.JButton();
598  importDatabaseButton = new javax.swing.JButton();
599  hashDatabasesLabel = new javax.swing.JLabel();
600  nameLabel = new javax.swing.JLabel();
601  hashDbNameLabel = new javax.swing.JLabel();
602  hashDbLocationLabel = new javax.swing.JLabel();
603  locationLabel = new javax.swing.JLabel();
604  typeLabel = new javax.swing.JLabel();
605  hashDbTypeLabel = new javax.swing.JLabel();
606  hashDbIndexStatusLabel = new javax.swing.JLabel();
607  indexLabel = new javax.swing.JLabel();
608  indexButton = new javax.swing.JButton();
609  sendIngestMessagesCheckBox = new javax.swing.JCheckBox();
610  informationLabel = new javax.swing.JLabel();
611  optionsLabel = new javax.swing.JLabel();
612  informationSeparator = new javax.swing.JSeparator();
613  optionsSeparator = new javax.swing.JSeparator();
614  createDatabaseButton = new javax.swing.JButton();
615  indexPathLabelLabel = new javax.swing.JLabel();
616  indexPathLabel = new javax.swing.JLabel();
617  addHashesToDatabaseButton = new javax.swing.JButton();
618  versionLabel = new javax.swing.JLabel();
619  hashDbVersionLabel = new javax.swing.JLabel();
620  orgLabel = new javax.swing.JLabel();
621  hashDbOrgLabel = new javax.swing.JLabel();
622  readOnlyLabel = new javax.swing.JLabel();
623  hashDbReadOnlyLabel = new javax.swing.JLabel();
624 
625  jLabel2.setFont(jLabel2.getFont().deriveFont(jLabel2.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
626  org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.jLabel2.text")); // NOI18N
627 
628  jLabel4.setFont(jLabel4.getFont().deriveFont(jLabel4.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
629  org.openide.awt.Mnemonics.setLocalizedText(jLabel4, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.jLabel4.text")); // NOI18N
630 
631  jLabel6.setFont(jLabel6.getFont().deriveFont(jLabel6.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
632  org.openide.awt.Mnemonics.setLocalizedText(jLabel6, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.jLabel6.text")); // NOI18N
633 
634  jButton3.setFont(jButton3.getFont().deriveFont(jButton3.getFont().getStyle() & ~java.awt.Font.BOLD, 14));
635  org.openide.awt.Mnemonics.setLocalizedText(jButton3, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.jButton3.text")); // NOI18N
636 
637  ingestWarningLabel.setFont(ingestWarningLabel.getFont().deriveFont(ingestWarningLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
638  ingestWarningLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/hashdatabase/warning16.png"))); // NOI18N
639  org.openide.awt.Mnemonics.setLocalizedText(ingestWarningLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.ingestWarningLabel.text")); // NOI18N
640 
641  hashSetTable.setFont(hashSetTable.getFont().deriveFont(hashSetTable.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
642  hashSetTable.setModel(new javax.swing.table.DefaultTableModel(
643  new Object [][] {
644 
645  },
646  new String [] {
647 
648  }
649  ));
650  hashSetTable.setShowHorizontalLines(false);
651  hashSetTable.setShowVerticalLines(false);
652  hashSetTable.addKeyListener(new java.awt.event.KeyAdapter() {
653  public void keyPressed(java.awt.event.KeyEvent evt) {
654  hashSetTableKeyPressed(evt);
655  }
656  });
657  jScrollPane1.setViewportView(hashSetTable);
658 
659  deleteDatabaseButton.setFont(deleteDatabaseButton.getFont().deriveFont(deleteDatabaseButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
660  deleteDatabaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/hashdatabase/delete16.png"))); // NOI18N
661  org.openide.awt.Mnemonics.setLocalizedText(deleteDatabaseButton, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.deleteDatabaseButton.text")); // NOI18N
662  deleteDatabaseButton.setMaximumSize(new java.awt.Dimension(140, 25));
663  deleteDatabaseButton.setMinimumSize(new java.awt.Dimension(140, 25));
664  deleteDatabaseButton.addActionListener(new java.awt.event.ActionListener() {
665  public void actionPerformed(java.awt.event.ActionEvent evt) {
666  deleteDatabaseButtonActionPerformed(evt);
667  }
668  });
669 
670  importDatabaseButton.setFont(importDatabaseButton.getFont().deriveFont(importDatabaseButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
671  importDatabaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/hashdatabase/import16.png"))); // NOI18N
672  org.openide.awt.Mnemonics.setLocalizedText(importDatabaseButton, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.importDatabaseButton.text")); // NOI18N
673  importDatabaseButton.setToolTipText(org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.importDatabaseButton.toolTipText")); // NOI18N
674  importDatabaseButton.setMaximumSize(new java.awt.Dimension(140, 25));
675  importDatabaseButton.setMinimumSize(new java.awt.Dimension(140, 25));
676  importDatabaseButton.addActionListener(new java.awt.event.ActionListener() {
677  public void actionPerformed(java.awt.event.ActionEvent evt) {
678  importDatabaseButtonActionPerformed(evt);
679  }
680  });
681 
682  hashDatabasesLabel.setFont(hashDatabasesLabel.getFont().deriveFont(hashDatabasesLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
683  org.openide.awt.Mnemonics.setLocalizedText(hashDatabasesLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.hashDatabasesLabel.text")); // NOI18N
684 
685  nameLabel.setFont(nameLabel.getFont().deriveFont(nameLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
686  org.openide.awt.Mnemonics.setLocalizedText(nameLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.nameLabel.text")); // NOI18N
687 
688  hashDbNameLabel.setFont(hashDbNameLabel.getFont().deriveFont(hashDbNameLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
689  org.openide.awt.Mnemonics.setLocalizedText(hashDbNameLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.hashDbNameLabel.text")); // NOI18N
690 
691  hashDbLocationLabel.setFont(hashDbLocationLabel.getFont().deriveFont(hashDbLocationLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
692  org.openide.awt.Mnemonics.setLocalizedText(hashDbLocationLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.hashDbLocationLabel.text")); // NOI18N
693 
694  locationLabel.setFont(locationLabel.getFont().deriveFont(locationLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
695  org.openide.awt.Mnemonics.setLocalizedText(locationLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.locationLabel.text")); // NOI18N
696 
697  typeLabel.setFont(typeLabel.getFont().deriveFont(typeLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
698  org.openide.awt.Mnemonics.setLocalizedText(typeLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.typeLabel.text")); // NOI18N
699 
700  hashDbTypeLabel.setFont(hashDbTypeLabel.getFont().deriveFont(hashDbTypeLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
701  org.openide.awt.Mnemonics.setLocalizedText(hashDbTypeLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.hashDbTypeLabel.text")); // NOI18N
702 
703  hashDbIndexStatusLabel.setFont(hashDbIndexStatusLabel.getFont().deriveFont(hashDbIndexStatusLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
704  org.openide.awt.Mnemonics.setLocalizedText(hashDbIndexStatusLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.hashDbIndexStatusLabel.text")); // NOI18N
705 
706  indexLabel.setFont(indexLabel.getFont().deriveFont(indexLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
707  org.openide.awt.Mnemonics.setLocalizedText(indexLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.indexLabel.text")); // NOI18N
708 
709  indexButton.setFont(indexButton.getFont().deriveFont(indexButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
710  org.openide.awt.Mnemonics.setLocalizedText(indexButton, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.indexButton.text")); // NOI18N
711  indexButton.setEnabled(false);
712  indexButton.addActionListener(new java.awt.event.ActionListener() {
713  public void actionPerformed(java.awt.event.ActionEvent evt) {
714  indexButtonActionPerformed(evt);
715  }
716  });
717 
718  sendIngestMessagesCheckBox.setFont(sendIngestMessagesCheckBox.getFont().deriveFont(sendIngestMessagesCheckBox.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
719  org.openide.awt.Mnemonics.setLocalizedText(sendIngestMessagesCheckBox, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.sendIngestMessagesCheckBox.text")); // NOI18N
720  sendIngestMessagesCheckBox.addActionListener(new java.awt.event.ActionListener() {
721  public void actionPerformed(java.awt.event.ActionEvent evt) {
722  sendIngestMessagesCheckBoxActionPerformed(evt);
723  }
724  });
725 
726  informationLabel.setFont(informationLabel.getFont().deriveFont(informationLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
727  org.openide.awt.Mnemonics.setLocalizedText(informationLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.informationLabel.text")); // NOI18N
728 
729  optionsLabel.setFont(optionsLabel.getFont().deriveFont(optionsLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
730  org.openide.awt.Mnemonics.setLocalizedText(optionsLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.optionsLabel.text")); // NOI18N
731 
732  createDatabaseButton.setFont(createDatabaseButton.getFont().deriveFont(createDatabaseButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
733  createDatabaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/hashdatabase/new16.png"))); // NOI18N
734  org.openide.awt.Mnemonics.setLocalizedText(createDatabaseButton, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.createDatabaseButton.text")); // NOI18N
735  createDatabaseButton.setToolTipText(org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.createDatabaseButton.toolTipText")); // NOI18N
736  createDatabaseButton.setMaximumSize(new java.awt.Dimension(140, 25));
737  createDatabaseButton.setMinimumSize(new java.awt.Dimension(140, 25));
738  createDatabaseButton.addActionListener(new java.awt.event.ActionListener() {
739  public void actionPerformed(java.awt.event.ActionEvent evt) {
740  createDatabaseButtonActionPerformed(evt);
741  }
742  });
743 
744  indexPathLabelLabel.setFont(indexPathLabelLabel.getFont().deriveFont(indexPathLabelLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
745  org.openide.awt.Mnemonics.setLocalizedText(indexPathLabelLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.indexPathLabelLabel.text")); // NOI18N
746 
747  indexPathLabel.setFont(indexPathLabel.getFont().deriveFont(indexPathLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
748  org.openide.awt.Mnemonics.setLocalizedText(indexPathLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.indexPathLabel.text")); // NOI18N
749 
750  addHashesToDatabaseButton.setFont(addHashesToDatabaseButton.getFont().deriveFont(addHashesToDatabaseButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
751  org.openide.awt.Mnemonics.setLocalizedText(addHashesToDatabaseButton, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.addHashesToDatabaseButton.text")); // NOI18N
752  addHashesToDatabaseButton.setEnabled(false);
753  addHashesToDatabaseButton.addActionListener(new java.awt.event.ActionListener() {
754  public void actionPerformed(java.awt.event.ActionEvent evt) {
755  addHashesToDatabaseButtonActionPerformed(evt);
756  }
757  });
758 
759  org.openide.awt.Mnemonics.setLocalizedText(versionLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.versionLabel.text_1")); // NOI18N
760 
761  org.openide.awt.Mnemonics.setLocalizedText(hashDbVersionLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.hashDbVersionLabel.text_1")); // NOI18N
762 
763  org.openide.awt.Mnemonics.setLocalizedText(orgLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.orgLabel.text_1")); // NOI18N
764 
765  org.openide.awt.Mnemonics.setLocalizedText(hashDbOrgLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.hashDbOrgLabel.text_1")); // NOI18N
766 
767  org.openide.awt.Mnemonics.setLocalizedText(readOnlyLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.readOnlyLabel.text_1")); // NOI18N
768 
769  org.openide.awt.Mnemonics.setLocalizedText(hashDbReadOnlyLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.hashDbReadOnlyLabel.text_1")); // NOI18N
770 
771  javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
772  jPanel1.setLayout(jPanel1Layout);
773  jPanel1Layout.setHorizontalGroup(
774  jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
775  .addGroup(jPanel1Layout.createSequentialGroup()
776  .addContainerGap()
777  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
778  .addGroup(jPanel1Layout.createSequentialGroup()
779  .addGap(1, 1, 1)
780  .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
781  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
782  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
783  .addGroup(jPanel1Layout.createSequentialGroup()
784  .addComponent(informationLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
785  .addGap(309, 309, 309))
786  .addGroup(jPanel1Layout.createSequentialGroup()
787  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
788  .addGroup(jPanel1Layout.createSequentialGroup()
789  .addGap(10, 10, 10)
790  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
791  .addGroup(jPanel1Layout.createSequentialGroup()
792  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
793  .addComponent(indexLabel)
794  .addComponent(indexPathLabelLabel))
795  .addGap(55, 55, 55)
796  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
797  .addComponent(hashDbIndexStatusLabel)
798  .addComponent(indexPathLabel)))
799  .addGroup(jPanel1Layout.createSequentialGroup()
800  .addComponent(indexButton)
801  .addGap(10, 10, 10)
802  .addComponent(addHashesToDatabaseButton))
803  .addGroup(jPanel1Layout.createSequentialGroup()
804  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
805  .addComponent(locationLabel)
806  .addComponent(typeLabel)
807  .addComponent(versionLabel)
808  .addComponent(orgLabel)
809  .addComponent(readOnlyLabel)
810  .addComponent(nameLabel))
811  .addGap(55, 55, 55)
812  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
813  .addComponent(hashDbNameLabel)
814  .addComponent(hashDbTypeLabel)
815  .addComponent(hashDbLocationLabel)
816  .addComponent(hashDbVersionLabel)
817  .addComponent(hashDbOrgLabel)
818  .addComponent(hashDbReadOnlyLabel)))))
819  .addGroup(jPanel1Layout.createSequentialGroup()
820  .addGap(70, 70, 70)
821  .addComponent(informationSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 305, javax.swing.GroupLayout.PREFERRED_SIZE))
822  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
823  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
824  .addComponent(optionsLabel)
825  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
826  .addComponent(optionsSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 334, javax.swing.GroupLayout.PREFERRED_SIZE))
827  .addGroup(jPanel1Layout.createSequentialGroup()
828  .addGap(25, 25, 25)
829  .addComponent(sendIngestMessagesCheckBox))
830  .addGroup(jPanel1Layout.createSequentialGroup()
831  .addGap(10, 10, 10)
832  .addComponent(ingestWarningLabel))))
833  .addContainerGap(24, Short.MAX_VALUE))))
834  .addGroup(jPanel1Layout.createSequentialGroup()
835  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
836  .addComponent(hashDatabasesLabel)
837  .addGroup(jPanel1Layout.createSequentialGroup()
838  .addComponent(createDatabaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
839  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
840  .addComponent(importDatabaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
841  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
842  .addComponent(deleteDatabaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
843  .addGap(0, 0, Short.MAX_VALUE))))
844  );
845 
846  jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {indexLabel, indexPathLabelLabel, locationLabel, nameLabel, orgLabel, readOnlyLabel, typeLabel, versionLabel});
847 
848  jPanel1Layout.setVerticalGroup(
849  jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
850  .addGroup(jPanel1Layout.createSequentialGroup()
851  .addContainerGap()
852  .addComponent(hashDatabasesLabel)
853  .addGap(6, 6, 6)
854  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
855  .addGroup(jPanel1Layout.createSequentialGroup()
856  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
857  .addComponent(informationLabel)
858  .addGroup(jPanel1Layout.createSequentialGroup()
859  .addGap(7, 7, 7)
860  .addComponent(informationSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 3, javax.swing.GroupLayout.PREFERRED_SIZE)))
861  .addGap(7, 7, 7)
862  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
863  .addComponent(nameLabel)
864  .addComponent(hashDbNameLabel))
865  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
866  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
867  .addComponent(typeLabel)
868  .addComponent(hashDbTypeLabel))
869  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
870  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
871  .addComponent(locationLabel)
872  .addComponent(hashDbLocationLabel))
873  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
874  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
875  .addComponent(versionLabel)
876  .addComponent(hashDbVersionLabel))
877  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
878  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
879  .addComponent(orgLabel)
880  .addComponent(hashDbOrgLabel))
881  .addGap(7, 7, 7)
882  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
883  .addComponent(readOnlyLabel)
884  .addComponent(hashDbReadOnlyLabel))
885  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
886  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
887  .addComponent(indexPathLabelLabel)
888  .addComponent(indexPathLabel))
889  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
890  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
891  .addComponent(indexLabel)
892  .addComponent(hashDbIndexStatusLabel))
893  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
894  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
895  .addComponent(indexButton)
896  .addComponent(addHashesToDatabaseButton))
897  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
898  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
899  .addComponent(optionsLabel)
900  .addComponent(optionsSeparator, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
901  .addGap(18, 18, 18)
902  .addComponent(sendIngestMessagesCheckBox)
903  .addGap(18, 18, 18)
904  .addComponent(ingestWarningLabel)
905  .addGap(0, 0, Short.MAX_VALUE))
906  .addComponent(jScrollPane1))
907  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
908  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
909  .addComponent(createDatabaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
910  .addComponent(importDatabaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
911  .addComponent(deleteDatabaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
912  .addContainerGap())
913  );
914 
915  jScrollPane2.setViewportView(jPanel1);
916 
917  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
918  this.setLayout(layout);
919  layout.setHorizontalGroup(
920  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
921  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
922  .addComponent(jScrollPane2)
923  .addContainerGap())
924  );
925  layout.setVerticalGroup(
926  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
927  .addComponent(jScrollPane2)
928  );
929  }// </editor-fold>//GEN-END:initComponents
930 
931  private void addHashesToDatabaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addHashesToDatabaseButtonActionPerformed
932 
933  HashDb hashDb = ((HashSetTable) hashSetTable).getSelection();
935  }//GEN-LAST:event_addHashesToDatabaseButtonActionPerformed
936 
937  private void createDatabaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createDatabaseButtonActionPerformed
938  HashDb hashDb = new HashDbCreateDatabaseDialog().getHashDatabase();
939  if (null != hashDb) {
940  if (hashDb instanceof CentralRepoHashSet) {
941  int newDbIndex = ((CentralRepoHashSet) hashDb).getReferenceSetID();
942  newReferenceSetIDs.add(newDbIndex);
943  }
944 
945  hashSetTableModel.refreshModel();
946  ((HashSetTable) hashSetTable).selectRowByDatabase(hashDb);
947  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
948  }
949  }//GEN-LAST:event_createDatabaseButtonActionPerformed
950 
951  private void sendIngestMessagesCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sendIngestMessagesCheckBoxActionPerformed
952  HashDb hashDb = ((HashSetTable) hashSetTable).getSelection();
953  if (hashDb != null) {
954  hashDb.setSendIngestMessages(sendIngestMessagesCheckBox.isSelected());
955  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
956  }
957  }//GEN-LAST:event_sendIngestMessagesCheckBoxActionPerformed
958 
959  private void indexButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_indexButtonActionPerformed
960  final HashDb hashDatabase = ((HashSetTable) hashSetTable).getSelection();
961  assert hashDatabase != null;
962  assert hashDatabase instanceof SleuthkitHashSet;
963 
964  // Add a listener for the INDEXING_DONE event. This listener will update
965  // the UI.
966  SleuthkitHashSet hashDb = (SleuthkitHashSet) hashDatabase;
967  hashDb.addPropertyChangeListener(new PropertyChangeListener() {
968  @Override
969  public void propertyChange(PropertyChangeEvent evt) {
970  if (evt.getPropertyName().equals(SleuthkitHashSet.Event.INDEXING_DONE.toString())) {
971  HashDb selectedHashDb = ((HashSetTable) hashSetTable).getSelection();
972  if (selectedHashDb != null && hashDb != null && hashDb.equals(selectedHashDb)) {
973  updateComponents();
974  }
975  hashSetTableModel.refreshDisplay();
976  }
977  }
978  });
979 
980  // Display a modal dialog box to kick off the indexing on a worker thread
981  // and try to persuade the user to wait for the indexing task to finish.
982  // TODO: If the user waits, this defeats the purpose of doing the indexing on a worker thread.
983  // But if the user cancels the dialog, other operations on the database
984  // may be attempted when it is not in a suitable state.
985  ModalNoButtons indexDialog = new ModalNoButtons(this, new Frame(), hashDb);
986  indexDialog.setLocationRelativeTo(null);
987  indexDialog.setVisible(true);
988  indexDialog.setModal(true);
989  }//GEN-LAST:event_indexButtonActionPerformed
990 
991  private void importDatabaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importDatabaseButtonActionPerformed
992  HashDb hashDb = new HashDbImportDatabaseDialog().getHashDatabase();
993  if (null != hashDb) {
994  if (hashDb instanceof CentralRepoHashSet) {
995  int newReferenceSetID = ((CentralRepoHashSet) hashDb).getReferenceSetID();
996  newReferenceSetIDs.add(newReferenceSetID);
997  }
998 
999  hashSetTableModel.refreshModel();
1000  ((HashSetTable) hashSetTable).selectRowByDatabase(hashDb);
1001  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1002  }
1003  }//GEN-LAST:event_importDatabaseButtonActionPerformed
1004 
1005  @Messages({
1006  "HashLookupSettingsPanel.promptTitle.deleteHashDb=Delete Hash Database from Configuration",
1007  "HashLookupSettingsPanel.promptMessage.deleteHashDb=This will make the hash database unavailable for lookup. Do you want to proceed?\n\nNote: The hash database can still be re-imported later."
1008  })
1009  private void deleteDatabaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteDatabaseButtonActionPerformed
1010  if (JOptionPane.showConfirmDialog(this,
1011  Bundle.HashLookupSettingsPanel_promptMessage_deleteHashDb(),
1012  Bundle.HashLookupSettingsPanel_promptTitle_deleteHashDb(),
1013  JOptionPane.YES_NO_OPTION,
1014  JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
1015  HashDb hashDb = ((HashSetTable) hashSetTable).getSelection();
1016  if (hashDb != null) {
1017  try {
1018  hashSetManager.removeHashDatabaseNoSave(hashDb);
1019  } catch (HashDbManager.HashDbManagerException ex) {
1020  JOptionPane.showMessageDialog(this, Bundle.HashLookupSettingsPanel_removeDatabaseFailure_message(hashDb.getHashSetName()));
1021  }
1022  hashSetTableModel.refreshModel();
1023  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1024  }
1025  }
1026  }//GEN-LAST:event_deleteDatabaseButtonActionPerformed
1027 
1028  private void hashSetTableKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_hashSetTableKeyPressed
1029  if (evt.getKeyCode() == KeyEvent.VK_DELETE) {
1030  HashDb hashDb = ((HashSetTable) hashSetTable).getSelection();
1031  if (hashDb != null) {
1032  try {
1033  hashSetManager.removeHashDatabaseNoSave(hashDb);
1034  } catch (HashDbManager.HashDbManagerException ex) {
1035  JOptionPane.showMessageDialog(this, Bundle.HashLookupSettingsPanel_removeDatabaseFailure_message(hashDb.getHashSetName()));
1036  }
1037  hashSetTableModel.refreshModel();
1038  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
1039  }
1040  }
1041  }//GEN-LAST:event_hashSetTableKeyPressed
1042 
1043  // Variables declaration - do not modify//GEN-BEGIN:variables
1044  private javax.swing.JButton addHashesToDatabaseButton;
1045  private javax.swing.JButton createDatabaseButton;
1046  private javax.swing.JButton deleteDatabaseButton;
1047  private javax.swing.JLabel hashDatabasesLabel;
1048  private javax.swing.JLabel hashDbIndexStatusLabel;
1049  private javax.swing.JLabel hashDbLocationLabel;
1050  private javax.swing.JLabel hashDbNameLabel;
1051  private javax.swing.JLabel hashDbOrgLabel;
1052  private javax.swing.JLabel hashDbReadOnlyLabel;
1053  private javax.swing.JLabel hashDbTypeLabel;
1054  private javax.swing.JLabel hashDbVersionLabel;
1055  private javax.swing.JTable hashSetTable;
1056  private javax.swing.JButton importDatabaseButton;
1057  private javax.swing.JButton indexButton;
1058  private javax.swing.JLabel indexLabel;
1059  private javax.swing.JLabel indexPathLabel;
1060  private javax.swing.JLabel indexPathLabelLabel;
1061  private javax.swing.JLabel informationLabel;
1062  private javax.swing.JSeparator informationSeparator;
1063  private javax.swing.JLabel ingestWarningLabel;
1064  private javax.swing.JButton jButton3;
1065  private javax.swing.JLabel jLabel2;
1066  private javax.swing.JLabel jLabel4;
1067  private javax.swing.JLabel jLabel6;
1068  private javax.swing.JPanel jPanel1;
1069  private javax.swing.JScrollPane jScrollPane1;
1070  private javax.swing.JScrollPane jScrollPane2;
1071  private javax.swing.JLabel locationLabel;
1072  private javax.swing.JLabel nameLabel;
1073  private javax.swing.JLabel optionsLabel;
1074  private javax.swing.JSeparator optionsSeparator;
1075  private javax.swing.JLabel orgLabel;
1076  private javax.swing.JLabel readOnlyLabel;
1077  private javax.swing.JCheckBox sendIngestMessagesCheckBox;
1078  private javax.swing.JLabel typeLabel;
1079  private javax.swing.JLabel versionLabel;
1080  // End of variables declaration//GEN-END:variables
1081 }
void showInvalidIndex(boolean plural, List< SleuthkitHashSet > unindexed)
static synchronized IngestManager getInstance()
Component prepareRenderer(TableCellRenderer renderer, int row, int column)
void addIngestJobEventListener(final PropertyChangeListener listener)
synchronized void removeHashDatabaseNoSave(HashDb hashDb)
abstract void addPropertyChangeListener(PropertyChangeListener pcl)
synchronized static Logger getLogger(String name)
Definition: Logger.java:124

Copyright © 2012-2016 Basis Technology. Generated on: Mon Jun 18 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.