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