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