19 package org.sleuthkit.autopsy.centralrepository.optionspanel;
21 import java.awt.EventQueue;
23 import java.beans.PropertyChangeEvent;
24 import java.beans.PropertyChangeListener;
25 import java.util.EnumSet;
27 import javax.swing.JOptionPane;
28 import javax.swing.SwingUtilities;
29 import org.netbeans.spi.options.OptionsPanelController;
30 import org.openide.util.NbBundle;
31 import org.openide.util.NbBundle.Messages;
44 import java.awt.Component;
45 import java.beans.PropertyChangeSupport;
46 import java.util.logging.Level;
47 import javax.swing.ImageIcon;
48 import org.openide.util.ImageUtilities;
56 @SuppressWarnings(
"PMD.SingularField")
59 private static final long serialVersionUID = 1L;
64 private static final PropertyChangeSupport propertyChangeSupport =
new PropertyChangeSupport(
GlobalSettingsPanel.class);
67 private static PropertyChangeListener lastRegistered = null;
71 private final ImageIcon goodIcon =
new ImageIcon(ImageUtilities.loadImage(
"org/sleuthkit/autopsy/images/good.png",
false));
72 private final ImageIcon badIcon =
new ImageIcon(ImageUtilities.loadImage(
"org/sleuthkit/autopsy/images/bad.png",
false));
81 customizeComponents();
82 setupSettingsChangeListeners();
83 addIngestJobEventsListener();
86 ingestStateUpdated(evt.getNewValue() != null);
96 if (lastRegistered != null) {
101 lastRegistered = this::onSettingsChange;
114 setName(NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.pnCorrelationProperties.border.title"));
154 "GlobalSettingsPanel.onMultiUserChange.enable.title=Use with Central Repository?",
155 "GlobalSettingsPanel.onMultiUserChange.enable.description=Do you want to update the Central Repository to use this PostgreSQL database?",
156 "GlobalSettingsPanel.onMultiUserChange.enable.description2=The Central Repository stores hash values and accounts from past cases."
158 public static void onMultiUserChange(Component parent,
boolean muPreviouslySelected,
boolean muCurrentlySelected) {
162 if (!muPreviouslySelected && muCurrentlySelected) {
163 SwingUtilities.invokeLater(() -> {
164 if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(parent,
166 +
"<div style='width: 400px;'>"
167 +
"<p>" + Bundle.GlobalSettingsPanel_onMultiUserChange_enable_description() +
"</p>"
168 +
"<p style='margin-top: 10px'>" + Bundle.GlobalSettingsPanel_onMultiUserChange_enable_description2() +
"</p>"
171 Bundle.GlobalSettingsPanel_onMultiUserChange_enable_title(),
172 JOptionPane.YES_NO_OPTION)) {
177 checkStatusAndCreateDb(parent);
181 else if (muPreviouslySelected && !muCurrentlySelected && crEnabled && crMultiUser) {
182 SwingUtilities.invokeLater(() -> {
183 askForCentralRepoDbChoice(parent);
187 else if (muPreviouslySelected && muCurrentlySelected && crEnabled && crMultiUser) {
189 checkStatusAndCreateDb(parent);
200 SwingUtilities.invokeLater(() -> {
213 "GlobalSettingsPanel.onMultiUserChange.disabledMu.title=Central Repository Change Necessary",
214 "GlobalSettingsPanel.onMultiUserChange.disabledMu.description=The Central Repository will be reconfigured to use a local SQLite database.",
215 "GlobalSettingsPanel.onMultiUserChange.disabledMu.description2=Press Configure PostgreSQL to change to a PostgreSQL database.",
216 "GlobalSettingsPanel.askForCentralRepoDbChoice.sqliteChoice.text=Use SQLite",
217 "GlobalSettingsPanel.askForCentralRepoDbChoice.customPostgrestChoice.text=Configure PostgreSQL",
218 "GlobalSettingsPanel.askForCentralRepoDbChoice.disableChoice.text=Disable Central Repository"
222 Bundle.GlobalSettingsPanel_askForCentralRepoDbChoice_sqliteChoice_text(),
223 Bundle.GlobalSettingsPanel_askForCentralRepoDbChoice_customPostgrestChoice_text(),
224 Bundle.GlobalSettingsPanel_askForCentralRepoDbChoice_disableChoice_text()
227 int result = JOptionPane.showOptionDialog(
230 +
"<div style='width: 400px;'>"
231 +
"<p>" + Bundle.GlobalSettingsPanel_onMultiUserChange_disabledMu_description() +
"</p>"
232 +
"<p style='margin-top: 10px'>" + Bundle.GlobalSettingsPanel_onMultiUserChange_disabledMu_description2() +
"</p>"
235 Bundle.GlobalSettingsPanel_onMultiUserChange_disabledMu_title(),
236 JOptionPane.YES_NO_CANCEL_OPTION,
237 JOptionPane.PLAIN_MESSAGE,
243 if (JOptionPane.YES_OPTION == result) {
245 }
else if (JOptionPane.NO_OPTION == result) {
251 "GlobalSettingsPanel.testCurrentConfiguration.dbDoesNotExist.message=Database does not exist.",
270 switch (testResult) {
271 case TESTED_OK:
return showStatusOkay();
272 case DB_DOES_NOT_EXIST:
return showStatusFail(Bundle.GlobalSettingsPanel_testCurrentConfiguration_dbDoesNotExist_message());
273 case SCHEMA_INVALID:
return showStatusFail(Bundle.EamDbSettingsDialog_okButton_corruptDatabaseExists_message());
274 case CONNECTION_FAILED:
276 return showStatusFail(Bundle.EamDbSettingsDialog_okButton_databaseConnectionFailed_message());
281 return setStatus(goodIcon,
" ");
285 return setStatus(badIcon, message);
289 setStatus(null,
" ");
292 private boolean setStatus(ImageIcon icon, String text) {
293 synchronized (testStatusLabel) {
294 testStatusLabel.setIcon(icon);
295 testStatusLabel.setText(text);
305 @SuppressWarnings(
"unchecked")
307 private
void initComponents() {
309 jScrollPane1 =
new javax.swing.JScrollPane();
310 jPanel1 =
new javax.swing.JPanel();
311 lbCentralRepository =
new javax.swing.JLabel();
312 cbUseCentralRepo =
new javax.swing.JCheckBox();
313 pnDatabaseConfiguration =
new javax.swing.JPanel();
314 lbDbPlatformTypeLabel =
new javax.swing.JLabel();
315 lbDbNameLabel =
new javax.swing.JLabel();
316 lbDbLocationLabel =
new javax.swing.JLabel();
317 bnDbConfigure =
new javax.swing.JButton();
318 lbDbPlatformValue =
new javax.swing.JLabel();
319 lbDbNameValue =
new javax.swing.JLabel();
320 lbDbLocationValue =
new javax.swing.JLabel();
321 bnTestConfigure =
new javax.swing.JButton();
322 testStatusLabel =
new javax.swing.JLabel();
323 pnCorrelationProperties =
new javax.swing.JPanel();
324 bnManageTypes =
new javax.swing.JButton();
325 correlationPropertiesScrollPane =
new javax.swing.JScrollPane();
326 correlationPropertiesTextArea =
new javax.swing.JTextArea();
327 organizationPanel =
new javax.swing.JPanel();
328 manageOrganizationButton =
new javax.swing.JButton();
329 organizationScrollPane =
new javax.swing.JScrollPane();
330 organizationTextArea =
new javax.swing.JTextArea();
331 casesPanel =
new javax.swing.JPanel();
332 showCasesButton =
new javax.swing.JButton();
333 casesScrollPane =
new javax.swing.JScrollPane();
334 casesTextArea =
new javax.swing.JTextArea();
335 tbOops =
new javax.swing.JTextField();
336 ingestRunningWarningLabel =
new javax.swing.JLabel();
339 setPreferredSize(
new java.awt.Dimension(1022, 488));
341 jScrollPane1.setBorder(null);
342 jScrollPane1.setPreferredSize(
new java.awt.Dimension(1022, 407));
344 jPanel1.setMinimumSize(
new java.awt.Dimension(0, 0));
345 jPanel1.setPreferredSize(
new java.awt.Dimension(1020, 407));
347 org.openide.awt.Mnemonics.setLocalizedText(lbCentralRepository,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.lbCentralRepository.text"));
349 org.openide.awt.Mnemonics.setLocalizedText(cbUseCentralRepo,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.cbUseCentralRepo.text"));
350 cbUseCentralRepo.addActionListener(
new java.awt.event.ActionListener() {
351 public void actionPerformed(java.awt.event.ActionEvent evt) {
352 cbUseCentralRepoActionPerformed(evt);
356 pnDatabaseConfiguration.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.pnDatabaseConfiguration.title")));
358 org.openide.awt.Mnemonics.setLocalizedText(lbDbPlatformTypeLabel,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.lbDbPlatformTypeLabel.text"));
360 org.openide.awt.Mnemonics.setLocalizedText(lbDbNameLabel,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.lbDbNameLabel.text"));
362 org.openide.awt.Mnemonics.setLocalizedText(lbDbLocationLabel,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.lbDbLocationLabel.text"));
364 org.openide.awt.Mnemonics.setLocalizedText(bnDbConfigure,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.bnDbConfigure.text"));
365 bnDbConfigure.addActionListener(
new java.awt.event.ActionListener() {
366 public void actionPerformed(java.awt.event.ActionEvent evt) {
367 bnDbConfigureActionPerformed(evt);
371 org.openide.awt.Mnemonics.setLocalizedText(bnTestConfigure,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.bnTestConfigure.text"));
372 bnTestConfigure.addActionListener(
new java.awt.event.ActionListener() {
373 public void actionPerformed(java.awt.event.ActionEvent evt) {
374 bnTestConfigureActionPerformed(evt);
378 testStatusLabel.setFont(testStatusLabel.getFont().deriveFont(testStatusLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
379 testStatusLabel.setForeground(
new java.awt.Color(255, 0, 0));
380 org.openide.awt.Mnemonics.setLocalizedText(testStatusLabel,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.testStatusLabel.text"));
381 testStatusLabel.setToolTipText(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.testStatusLabel.toolTipText"));
382 testStatusLabel.setMaximumSize(
new java.awt.Dimension(387, 16));
383 testStatusLabel.setPreferredSize(
new java.awt.Dimension(387, 16));
385 javax.swing.GroupLayout pnDatabaseConfigurationLayout =
new javax.swing.GroupLayout(pnDatabaseConfiguration);
386 pnDatabaseConfiguration.setLayout(pnDatabaseConfigurationLayout);
387 pnDatabaseConfigurationLayout.setHorizontalGroup(
388 pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
389 .addGroup(pnDatabaseConfigurationLayout.createSequentialGroup()
391 .addGroup(pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
392 .addGroup(pnDatabaseConfigurationLayout.createSequentialGroup()
393 .addGroup(pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
394 .addComponent(lbDbPlatformTypeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
395 .addComponent(lbDbNameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
396 .addComponent(lbDbLocationLabel))
397 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
398 .addGroup(pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
399 .addComponent(lbDbNameValue, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
400 .addComponent(lbDbPlatformValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
401 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, pnDatabaseConfigurationLayout.createSequentialGroup()
402 .addComponent(lbDbLocationValue, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
403 .addGap(681, 681, 681))))
404 .addGroup(pnDatabaseConfigurationLayout.createSequentialGroup()
405 .addComponent(bnDbConfigure)
407 .addComponent(bnTestConfigure)
408 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
409 .addComponent(testStatusLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 675, javax.swing.GroupLayout.PREFERRED_SIZE)
410 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
412 pnDatabaseConfigurationLayout.setVerticalGroup(
413 pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
414 .addGroup(pnDatabaseConfigurationLayout.createSequentialGroup()
416 .addGroup(pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
417 .addComponent(lbDbPlatformTypeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
418 .addComponent(lbDbPlatformValue, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
419 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
420 .addGroup(pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
421 .addComponent(lbDbNameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
422 .addComponent(lbDbNameValue, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
423 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
424 .addGroup(pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
425 .addComponent(lbDbLocationLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
426 .addComponent(lbDbLocationValue, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
427 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
428 .addGroup(pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
429 .addComponent(testStatusLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
430 .addGroup(pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
431 .addComponent(bnDbConfigure)
432 .addComponent(bnTestConfigure)))
436 pnCorrelationProperties.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.pnCorrelationProperties.border.title")));
437 pnCorrelationProperties.setPreferredSize(
new java.awt.Dimension(674, 93));
439 org.openide.awt.Mnemonics.setLocalizedText(bnManageTypes,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.bnManageProperties.text"));
440 bnManageTypes.addActionListener(
new java.awt.event.ActionListener() {
441 public void actionPerformed(java.awt.event.ActionEvent evt) {
442 bnManageTypesActionPerformed(evt);
446 correlationPropertiesScrollPane.setBorder(null);
448 correlationPropertiesTextArea.setEditable(
false);
449 correlationPropertiesTextArea.setBackground(
new java.awt.Color(240, 240, 240));
450 correlationPropertiesTextArea.setColumns(20);
451 correlationPropertiesTextArea.setLineWrap(
true);
452 correlationPropertiesTextArea.setRows(1);
453 correlationPropertiesTextArea.setText(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.correlationPropertiesTextArea.text"));
454 correlationPropertiesTextArea.setToolTipText(
"");
455 correlationPropertiesTextArea.setWrapStyleWord(
true);
456 correlationPropertiesTextArea.setBorder(null);
457 correlationPropertiesTextArea.setOpaque(
false);
458 correlationPropertiesScrollPane.setViewportView(correlationPropertiesTextArea);
460 javax.swing.GroupLayout pnCorrelationPropertiesLayout =
new javax.swing.GroupLayout(pnCorrelationProperties);
461 pnCorrelationProperties.setLayout(pnCorrelationPropertiesLayout);
462 pnCorrelationPropertiesLayout.setHorizontalGroup(
463 pnCorrelationPropertiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
464 .addGroup(pnCorrelationPropertiesLayout.createSequentialGroup()
466 .addGroup(pnCorrelationPropertiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
467 .addGroup(pnCorrelationPropertiesLayout.createSequentialGroup()
468 .addComponent(bnManageTypes)
469 .addGap(0, 0, Short.MAX_VALUE))
470 .addComponent(correlationPropertiesScrollPane))
473 pnCorrelationPropertiesLayout.setVerticalGroup(
474 pnCorrelationPropertiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
475 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnCorrelationPropertiesLayout.createSequentialGroup()
476 .addComponent(correlationPropertiesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 24, Short.MAX_VALUE)
477 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
478 .addComponent(bnManageTypes)
482 organizationPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.organizationPanel.border.title")));
484 org.openide.awt.Mnemonics.setLocalizedText(manageOrganizationButton,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.manageOrganizationButton.text"));
485 manageOrganizationButton.addActionListener(
new java.awt.event.ActionListener() {
486 public void actionPerformed(java.awt.event.ActionEvent evt) {
487 manageOrganizationButtonActionPerformed(evt);
491 organizationScrollPane.setBorder(null);
493 organizationTextArea.setEditable(
false);
494 organizationTextArea.setBackground(
new java.awt.Color(240, 240, 240));
495 organizationTextArea.setColumns(20);
496 organizationTextArea.setLineWrap(
true);
497 organizationTextArea.setRows(2);
498 organizationTextArea.setText(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.organizationTextArea.text"));
499 organizationTextArea.setWrapStyleWord(
true);
500 organizationTextArea.setBorder(null);
501 organizationTextArea.setOpaque(
false);
502 organizationScrollPane.setViewportView(organizationTextArea);
504 javax.swing.GroupLayout organizationPanelLayout =
new javax.swing.GroupLayout(organizationPanel);
505 organizationPanel.setLayout(organizationPanelLayout);
506 organizationPanelLayout.setHorizontalGroup(
507 organizationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
508 .addGroup(organizationPanelLayout.createSequentialGroup()
510 .addGroup(organizationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
511 .addComponent(organizationScrollPane)
512 .addGroup(organizationPanelLayout.createSequentialGroup()
513 .addComponent(manageOrganizationButton)
514 .addGap(0, 0, Short.MAX_VALUE)))
517 organizationPanelLayout.setVerticalGroup(
518 organizationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
519 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, organizationPanelLayout.createSequentialGroup()
521 .addComponent(organizationScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
522 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
523 .addComponent(manageOrganizationButton)
527 casesPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.casesPanel.border.title")));
528 casesPanel.setName(
"Case Details");
530 org.openide.awt.Mnemonics.setLocalizedText(showCasesButton,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.showCasesButton.text"));
531 showCasesButton.addActionListener(
new java.awt.event.ActionListener() {
532 public void actionPerformed(java.awt.event.ActionEvent evt) {
533 showCasesButtonActionPerformed(evt);
537 casesScrollPane.setBorder(null);
539 casesTextArea.setEditable(
false);
540 casesTextArea.setBackground(
new java.awt.Color(240, 240, 240));
541 casesTextArea.setColumns(20);
542 casesTextArea.setLineWrap(
true);
543 casesTextArea.setRows(2);
544 casesTextArea.setText(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.casesTextArea.text"));
545 casesTextArea.setWrapStyleWord(
true);
546 casesTextArea.setBorder(null);
547 casesTextArea.setOpaque(
false);
548 casesScrollPane.setViewportView(casesTextArea);
550 javax.swing.GroupLayout casesPanelLayout =
new javax.swing.GroupLayout(casesPanel);
551 casesPanel.setLayout(casesPanelLayout);
552 casesPanelLayout.setHorizontalGroup(
553 casesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
554 .addGroup(casesPanelLayout.createSequentialGroup()
556 .addGroup(casesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
557 .addComponent(casesScrollPane)
558 .addGroup(casesPanelLayout.createSequentialGroup()
559 .addComponent(showCasesButton)
560 .addGap(0, 0, Short.MAX_VALUE)))
563 casesPanelLayout.setVerticalGroup(
564 casesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
565 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, casesPanelLayout.createSequentialGroup()
567 .addComponent(casesScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
568 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
569 .addComponent(showCasesButton)
573 tbOops.setEditable(
false);
574 tbOops.setFont(tbOops.getFont().deriveFont(tbOops.getFont().getStyle() | java.awt.Font.BOLD, tbOops.getFont().getSize()-1));
575 tbOops.setText(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.tbOops.text"));
576 tbOops.setBorder(null);
578 ingestRunningWarningLabel.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/modules/filetypeid/warning16.png")));
579 org.openide.awt.Mnemonics.setLocalizedText(ingestRunningWarningLabel,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.ingestRunningWarningLabel.text"));
581 javax.swing.GroupLayout jPanel1Layout =
new javax.swing.GroupLayout(jPanel1);
582 jPanel1.setLayout(jPanel1Layout);
583 jPanel1Layout.setHorizontalGroup(
584 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
585 .addComponent(lbCentralRepository, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
586 .addGroup(jPanel1Layout.createSequentialGroup()
587 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
588 .addComponent(pnDatabaseConfiguration, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
589 .addComponent(pnCorrelationProperties, javax.swing.GroupLayout.DEFAULT_SIZE, 1016, Short.MAX_VALUE)
590 .addComponent(organizationPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
591 .addComponent(casesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
592 .addGroup(jPanel1Layout.createSequentialGroup()
593 .addComponent(cbUseCentralRepo, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)
594 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
595 .addComponent(ingestRunningWarningLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
596 .addGroup(jPanel1Layout.createSequentialGroup()
598 .addComponent(tbOops, javax.swing.GroupLayout.PREFERRED_SIZE, 974, javax.swing.GroupLayout.PREFERRED_SIZE)))
601 jPanel1Layout.setVerticalGroup(
602 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
603 .addGroup(jPanel1Layout.createSequentialGroup()
604 .addComponent(lbCentralRepository)
605 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
606 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
607 .addComponent(cbUseCentralRepo)
608 .addComponent(ingestRunningWarningLabel))
609 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
610 .addComponent(pnDatabaseConfiguration, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
612 .addComponent(pnCorrelationProperties, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
614 .addComponent(organizationPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
616 .addComponent(casesPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
618 .addComponent(tbOops, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
622 casesPanel.getAccessibleContext().setAccessibleName(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.Case Details.AccessibleContext.accessibleName"));
624 jScrollPane1.setViewportView(jPanel1);
626 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
627 this.setLayout(layout);
628 layout.setHorizontalGroup(
629 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
630 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
632 layout.setVerticalGroup(
633 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
634 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 512, Short.MAX_VALUE)
640 ManageCorrelationPropertiesDialog manageCorrelationDialog =
new ManageCorrelationPropertiesDialog();
641 firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
646 boolean changed = invokeCrChoice(
this, null);
659 ManageCasesDialog.displayManageCasesDialog();
670 testCurrentConfiguration();
674 @Messages({
"GlobalSettingsPanel.validationerrMsg.mustConfigure=Configure the database to enable this module."})
677 enableButtonSubComponents(
false);
681 lbDbPlatformValue.setText(selectedChoice.
getTitle());
685 lbDbNameValue.setText(
"");
686 lbDbLocationValue.setText(
"");
687 tbOops.setText(Bundle.GlobalSettingsPanel_validationerrMsg_mustConfigure());
689 enableButtonSubComponents(cbUseCentralRepo.isSelected());
693 lbDbNameValue.setText(dbSettingsPg.
getDbName());
694 lbDbLocationValue.setText(dbSettingsPg.
getHost());
696 logger.log(Level.WARNING,
"Unable to load settings into global panel for postgres settings", e);
700 lbDbNameValue.setText(dbSettingsSqlite.
getDbName());
727 @SuppressWarnings(
"FinalizeDeclaration")
728 protected
void finalize() throws Throwable {
748 if (isLocalIngestJobEvent(event)) {
749 EventQueue.invokeLater(
new Runnable() {
770 if (((AutopsyEvent) event).getSourceType() == AutopsyEvent.SourceType.LOCAL) {
771 String eventType =
event.getPropertyName();
780 @Messages({
"GlobalSettingsPanel.validationErrMsg.ingestRunning=You cannot change settings while ingest is running."})
782 if (!SwingUtilities.isEventDispatchThread()) {
783 SwingUtilities.invokeLater(() -> {
784 ingestStateUpdated(caseIsOpen);
790 cbUseCentralRepo.setEnabled(!caseIsOpen);
792 tbOops.setText(Bundle.GlobalSettingsPanel_validationErrMsg_ingestRunning());
793 tbOops.setVisible(
true);
794 enableButtonSubComponents(cbUseCentralRepo.isSelected());
799 enableDatabaseConfigureButton(cbUseCentralRepo.isSelected() && !caseIsOpen);
813 ingestRunningWarningLabel.setVisible(ingestRunning);
815 pnDatabaseConfiguration.setEnabled(enable && !ingestRunning);
816 bnDbConfigure.setEnabled(enable && !ingestRunning);
817 bnTestConfigure.setEnabled(enable && !ingestRunning);
818 lbDbLocationLabel.setEnabled(enable && !ingestRunning);
819 lbDbLocationValue.setEnabled(enable && !ingestRunning);
820 lbDbNameLabel.setEnabled(enable && !ingestRunning);
821 lbDbNameValue.setEnabled(enable && !ingestRunning);
822 lbDbPlatformTypeLabel.setEnabled(enable && !ingestRunning);
823 lbDbPlatformValue.setEnabled(enable && !ingestRunning);
824 tbOops.setEnabled(enable && !ingestRunning);
837 pnCorrelationProperties.setEnabled(enable && !ingestRunning);
838 bnManageTypes.setEnabled(enable && !ingestRunning);
839 correlationPropertiesTextArea.setEnabled(enable && !ingestRunning);
840 organizationPanel.setEnabled(enable && !ingestRunning);
841 organizationTextArea.setEnabled(enable && !ingestRunning);
842 manageOrganizationButton.setEnabled(enable && !ingestRunning);
843 showCasesButton.setEnabled(enable && !ingestRunning);
844 casesPanel.setEnabled(enable && !ingestRunning);
845 casesTextArea.setEnabled(enable && !ingestRunning);
CentralRepoPlatforms getDbPlatform()
DatabaseTestResult testStatus()
final IngestJobEventPropertyChangeListener ingestJobEventListener
javax.swing.JLabel lbDbLocationValue
javax.swing.JButton bnManageTypes
static void removePropertyChangeListener(PropertyChangeListener listener)
static synchronized IngestManager getInstance()
void showCasesButtonActionPerformed(java.awt.event.ActionEvent evt)
static void checkStatusAndCreateDb(Component parent)
javax.swing.JScrollPane organizationScrollPane
void bnManageTypesActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JLabel ingestRunningWarningLabel
static void onMultiUserChange(Component parent, boolean muPreviouslySelected, boolean muCurrentlySelected)
boolean isIngestRunning()
static void setUseCentralRepo(boolean centralRepoCheckBoxIsSelected)
boolean showStatusFail(String message)
boolean isLocalIngestJobEvent(PropertyChangeEvent event)
void bnTestConfigureActionPerformed(java.awt.event.ActionEvent evt)
void customizeComponents()
void cbUseCentralRepoActionPerformed(java.awt.event.ActionEvent evt)
static CentralRepoDbChoice getSavedDbChoice()
javax.swing.JPanel pnDatabaseConfiguration
javax.swing.JPanel organizationPanel
static CentralRepoDbChoice saveDbChoice(CentralRepoDbChoice choice)
void removeIngestJobEventListener(final PropertyChangeListener listener)
javax.swing.JTextArea correlationPropertiesTextArea
boolean testCurrentConfiguration()
void setupSettingsChangeListeners()
javax.swing.JButton bnTestConfigure
javax.swing.JCheckBox cbUseCentralRepo
void enableDatabaseConfigureButton(Boolean enable)
javax.swing.JTextField tbOops
javax.swing.JTextArea casesTextArea
javax.swing.JButton bnDbConfigure
javax.swing.JScrollPane correlationPropertiesScrollPane
void addIngestJobEventListener(final PropertyChangeListener listener)
javax.swing.JTextArea organizationTextArea
boolean enableButtonSubComponents(Boolean enable)
javax.swing.JPanel jPanel1
javax.swing.JLabel lbDbPlatformTypeLabel
javax.swing.JButton manageOrganizationButton
javax.swing.JScrollPane jScrollPane1
javax.swing.JButton showCasesButton
javax.swing.JLabel testStatusLabel
javax.swing.JLabel lbDbNameValue
javax.swing.JLabel lbCentralRepository
void onSettingsChange(PropertyChangeEvent evt)
void ingestStateUpdated(boolean caseIsOpen)
static void askForCentralRepoDbChoice(Component parent)
static void addPropertyChangeListener(PropertyChangeListener listener)
javax.swing.JPanel casesPanel
static boolean promptCreateDatabase(CentralRepoDbManager manager, EamDbSettingsDialog dialog)
static boolean allowUseOfCentralRepository()
void propertyChange(PropertyChangeEvent event)
synchronized static Logger getLogger(String name)
static void addEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
javax.swing.JLabel lbDbPlatformValue
static final PropertyChangeSupport propertyChangeSupport
javax.swing.JLabel lbDbLocationLabel
void addIngestJobEventsListener()
static boolean testStatusAndCreate(Component parent, CentralRepoDbManager manager)
boolean setStatus(ImageIcon icon, String text)
static boolean invokeCrChoice(Component parent, CentralRepoDbChoice initialSelection)
void manageOrganizationButtonActionPerformed(java.awt.event.ActionEvent evt)
void bnDbConfigureActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JLabel lbDbNameLabel
boolean wasConfigurationChanged()
static boolean isCaseOpen()
javax.swing.JScrollPane casesScrollPane
javax.swing.JPanel pnCorrelationProperties