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;
57 @SuppressWarnings(
"PMD.SingularField")
60 private static final long serialVersionUID = 1L;
65 private static final PropertyChangeSupport propertyChangeSupport =
new PropertyChangeSupport(
GlobalSettingsPanel.class);
68 private static PropertyChangeListener lastRegistered = null;
72 private final ImageIcon goodIcon =
new ImageIcon(ImageUtilities.loadImage(
"org/sleuthkit/autopsy/images/good.png",
false));
73 private final ImageIcon badIcon =
new ImageIcon(ImageUtilities.loadImage(
"org/sleuthkit/autopsy/images/bad.png",
false));
82 customizeComponents();
83 setupSettingsChangeListeners();
84 addIngestJobEventsListener();
87 ingestStateUpdated(evt.getNewValue() != null);
97 if (lastRegistered != null) {
102 lastRegistered = this::onSettingsChange;
115 setName(NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.pnCorrelationProperties.border.title"));
155 "GlobalSettingsPanel.onMultiUserChange.enable.title=Central Repository",
156 "# {0} - server name",
157 "GlobalSettingsPanel.onMultiUserChange.enable.description=Do you want to update the Central Repository to use the PostgreSQL server on {0}?",
158 "GlobalSettingsPanel.onMultiUserChange.enable.description2=Any data in an existing SQLite Central Repository will not be transferred to the new database."
160 public static void onMultiUserChange(Component parent,
boolean muPreviouslySelected,
boolean muCurrentlySelected) {
164 if (!muPreviouslySelected && muCurrentlySelected) {
165 SwingUtilities.invokeLater(() -> {
168 if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(parent,
170 +
"<div style='width: 400px;'>"
171 +
"<p>" + Bundle.GlobalSettingsPanel_onMultiUserChange_enable_description(multiUserSettings.
getHost()) +
"</p>"
172 +
"<p style='margin-top: 10px'>" + Bundle.GlobalSettingsPanel_onMultiUserChange_enable_description2() +
"</p>"
175 Bundle.GlobalSettingsPanel_onMultiUserChange_enable_title(),
176 JOptionPane.YES_NO_OPTION)) {
181 checkStatusAndCreateDb(parent);
185 else if (muPreviouslySelected && !muCurrentlySelected && crEnabled && crMultiUser) {
186 SwingUtilities.invokeLater(() -> {
187 askForCentralRepoDbChoice(parent);
191 else if (muPreviouslySelected && muCurrentlySelected && crEnabled && crMultiUser) {
193 checkStatusAndCreateDb(parent);
204 SwingUtilities.invokeLater(() -> {
217 "GlobalSettingsPanel.onMultiUserChange.disabledMu.title=Central Repository Change Necessary",
218 "GlobalSettingsPanel.onMultiUserChange.disabledMu.description=The Central Repository will be reconfigured to use a local SQLite database.",
219 "GlobalSettingsPanel.onMultiUserChange.disabledMu.description2=Press Configure PostgreSQL to change to a PostgreSQL database.",
220 "GlobalSettingsPanel.askForCentralRepoDbChoice.sqliteChoice.text=Use SQLite",
221 "GlobalSettingsPanel.askForCentralRepoDbChoice.customPostgrestChoice.text=Configure PostgreSQL",
222 "GlobalSettingsPanel.askForCentralRepoDbChoice.disableChoice.text=Disable Central Repository"
226 Bundle.GlobalSettingsPanel_askForCentralRepoDbChoice_sqliteChoice_text(),
227 Bundle.GlobalSettingsPanel_askForCentralRepoDbChoice_customPostgrestChoice_text(),
228 Bundle.GlobalSettingsPanel_askForCentralRepoDbChoice_disableChoice_text()
231 int result = JOptionPane.showOptionDialog(
234 +
"<div style='width: 400px;'>"
235 +
"<p>" + Bundle.GlobalSettingsPanel_onMultiUserChange_disabledMu_description() +
"</p>"
236 +
"<p style='margin-top: 10px'>" + Bundle.GlobalSettingsPanel_onMultiUserChange_disabledMu_description2() +
"</p>"
239 Bundle.GlobalSettingsPanel_onMultiUserChange_disabledMu_title(),
240 JOptionPane.YES_NO_CANCEL_OPTION,
241 JOptionPane.PLAIN_MESSAGE,
247 if (JOptionPane.YES_OPTION == result) {
249 }
else if (JOptionPane.NO_OPTION == result) {
255 "GlobalSettingsPanel.testCurrentConfiguration.dbDoesNotExist.message=Database does not exist.",
274 switch (testResult) {
275 case TESTED_OK:
return showStatusOkay();
276 case DB_DOES_NOT_EXIST:
return showStatusFail(Bundle.GlobalSettingsPanel_testCurrentConfiguration_dbDoesNotExist_message());
277 case SCHEMA_INVALID:
return showStatusFail(Bundle.EamDbSettingsDialog_okButton_corruptDatabaseExists_message());
278 case CONNECTION_FAILED:
280 return showStatusFail(Bundle.EamDbSettingsDialog_okButton_databaseConnectionFailed_message());
285 return setStatus(goodIcon,
" ");
289 return setStatus(badIcon, message);
293 setStatus(null,
" ");
296 private boolean setStatus(ImageIcon icon, String text) {
297 synchronized (testStatusLabel) {
298 testStatusLabel.setIcon(icon);
299 testStatusLabel.setText(text);
309 @SuppressWarnings(
"unchecked")
311 private
void initComponents() {
313 jScrollPane1 =
new javax.swing.JScrollPane();
314 jPanel1 =
new javax.swing.JPanel();
315 lbCentralRepository =
new javax.swing.JLabel();
316 cbUseCentralRepo =
new javax.swing.JCheckBox();
317 pnDatabaseConfiguration =
new javax.swing.JPanel();
318 lbDbPlatformTypeLabel =
new javax.swing.JLabel();
319 lbDbNameLabel =
new javax.swing.JLabel();
320 lbDbLocationLabel =
new javax.swing.JLabel();
321 bnDbConfigure =
new javax.swing.JButton();
322 lbDbPlatformValue =
new javax.swing.JLabel();
323 lbDbNameValue =
new javax.swing.JLabel();
324 lbDbLocationValue =
new javax.swing.JLabel();
325 bnTestConfigure =
new javax.swing.JButton();
326 testStatusLabel =
new javax.swing.JLabel();
327 pnCorrelationProperties =
new javax.swing.JPanel();
328 bnManageTypes =
new javax.swing.JButton();
329 correlationPropertiesScrollPane =
new javax.swing.JScrollPane();
330 correlationPropertiesTextArea =
new javax.swing.JTextArea();
331 organizationPanel =
new javax.swing.JPanel();
332 manageOrganizationButton =
new javax.swing.JButton();
333 organizationScrollPane =
new javax.swing.JScrollPane();
334 organizationTextArea =
new javax.swing.JTextArea();
335 casesPanel =
new javax.swing.JPanel();
336 showCasesButton =
new javax.swing.JButton();
337 casesScrollPane =
new javax.swing.JScrollPane();
338 casesTextArea =
new javax.swing.JTextArea();
339 tbOops =
new javax.swing.JTextField();
340 ingestRunningWarningLabel =
new javax.swing.JLabel();
343 setPreferredSize(
new java.awt.Dimension(1022, 488));
345 jScrollPane1.setBorder(null);
346 jScrollPane1.setPreferredSize(
new java.awt.Dimension(1022, 407));
348 jPanel1.setMinimumSize(
new java.awt.Dimension(0, 0));
349 jPanel1.setPreferredSize(
new java.awt.Dimension(1020, 407));
351 org.openide.awt.Mnemonics.setLocalizedText(lbCentralRepository,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.lbCentralRepository.text"));
353 org.openide.awt.Mnemonics.setLocalizedText(cbUseCentralRepo,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.cbUseCentralRepo.text"));
354 cbUseCentralRepo.addActionListener(
new java.awt.event.ActionListener() {
355 public void actionPerformed(java.awt.event.ActionEvent evt) {
356 cbUseCentralRepoActionPerformed(evt);
360 pnDatabaseConfiguration.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.pnDatabaseConfiguration.title")));
362 org.openide.awt.Mnemonics.setLocalizedText(lbDbPlatformTypeLabel,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.lbDbPlatformTypeLabel.text"));
364 org.openide.awt.Mnemonics.setLocalizedText(lbDbNameLabel,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.lbDbNameLabel.text"));
366 org.openide.awt.Mnemonics.setLocalizedText(lbDbLocationLabel,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.lbDbLocationLabel.text"));
368 org.openide.awt.Mnemonics.setLocalizedText(bnDbConfigure,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.bnDbConfigure.text"));
369 bnDbConfigure.addActionListener(
new java.awt.event.ActionListener() {
370 public void actionPerformed(java.awt.event.ActionEvent evt) {
371 bnDbConfigureActionPerformed(evt);
375 org.openide.awt.Mnemonics.setLocalizedText(bnTestConfigure,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.bnTestConfigure.text"));
376 bnTestConfigure.addActionListener(
new java.awt.event.ActionListener() {
377 public void actionPerformed(java.awt.event.ActionEvent evt) {
378 bnTestConfigureActionPerformed(evt);
382 testStatusLabel.setFont(testStatusLabel.getFont().deriveFont(testStatusLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
383 testStatusLabel.setForeground(
new java.awt.Color(255, 0, 0));
384 org.openide.awt.Mnemonics.setLocalizedText(testStatusLabel,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.testStatusLabel.text"));
385 testStatusLabel.setToolTipText(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.testStatusLabel.toolTipText"));
386 testStatusLabel.setMaximumSize(
new java.awt.Dimension(387, 16));
387 testStatusLabel.setPreferredSize(
new java.awt.Dimension(387, 16));
389 javax.swing.GroupLayout pnDatabaseConfigurationLayout =
new javax.swing.GroupLayout(pnDatabaseConfiguration);
390 pnDatabaseConfiguration.setLayout(pnDatabaseConfigurationLayout);
391 pnDatabaseConfigurationLayout.setHorizontalGroup(
392 pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
393 .addGroup(pnDatabaseConfigurationLayout.createSequentialGroup()
395 .addGroup(pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
396 .addGroup(pnDatabaseConfigurationLayout.createSequentialGroup()
397 .addGroup(pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
398 .addComponent(lbDbPlatformTypeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
399 .addComponent(lbDbNameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
400 .addComponent(lbDbLocationLabel))
401 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
402 .addGroup(pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
403 .addComponent(lbDbNameValue, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
404 .addComponent(lbDbPlatformValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
405 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, pnDatabaseConfigurationLayout.createSequentialGroup()
406 .addComponent(lbDbLocationValue, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
407 .addGap(681, 681, 681))))
408 .addGroup(pnDatabaseConfigurationLayout.createSequentialGroup()
409 .addComponent(bnDbConfigure)
411 .addComponent(bnTestConfigure)
412 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
413 .addComponent(testStatusLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 675, javax.swing.GroupLayout.PREFERRED_SIZE)
414 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
416 pnDatabaseConfigurationLayout.setVerticalGroup(
417 pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
418 .addGroup(pnDatabaseConfigurationLayout.createSequentialGroup()
420 .addGroup(pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
421 .addComponent(lbDbPlatformTypeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
422 .addComponent(lbDbPlatformValue, 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(lbDbNameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
426 .addComponent(lbDbNameValue, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
427 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
428 .addGroup(pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
429 .addComponent(lbDbLocationLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
430 .addComponent(lbDbLocationValue, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
431 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
432 .addGroup(pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
433 .addComponent(testStatusLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
434 .addGroup(pnDatabaseConfigurationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
435 .addComponent(bnDbConfigure)
436 .addComponent(bnTestConfigure)))
440 pnCorrelationProperties.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.pnCorrelationProperties.border.title")));
441 pnCorrelationProperties.setPreferredSize(
new java.awt.Dimension(674, 93));
443 org.openide.awt.Mnemonics.setLocalizedText(bnManageTypes,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.bnManageProperties.text"));
444 bnManageTypes.addActionListener(
new java.awt.event.ActionListener() {
445 public void actionPerformed(java.awt.event.ActionEvent evt) {
446 bnManageTypesActionPerformed(evt);
450 correlationPropertiesScrollPane.setBorder(null);
452 correlationPropertiesTextArea.setEditable(
false);
453 correlationPropertiesTextArea.setBackground(
new java.awt.Color(240, 240, 240));
454 correlationPropertiesTextArea.setColumns(20);
455 correlationPropertiesTextArea.setLineWrap(
true);
456 correlationPropertiesTextArea.setRows(1);
457 correlationPropertiesTextArea.setText(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.correlationPropertiesTextArea.text"));
458 correlationPropertiesTextArea.setToolTipText(
"");
459 correlationPropertiesTextArea.setWrapStyleWord(
true);
460 correlationPropertiesTextArea.setBorder(null);
461 correlationPropertiesTextArea.setOpaque(
false);
462 correlationPropertiesScrollPane.setViewportView(correlationPropertiesTextArea);
464 javax.swing.GroupLayout pnCorrelationPropertiesLayout =
new javax.swing.GroupLayout(pnCorrelationProperties);
465 pnCorrelationProperties.setLayout(pnCorrelationPropertiesLayout);
466 pnCorrelationPropertiesLayout.setHorizontalGroup(
467 pnCorrelationPropertiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
468 .addGroup(pnCorrelationPropertiesLayout.createSequentialGroup()
470 .addGroup(pnCorrelationPropertiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
471 .addGroup(pnCorrelationPropertiesLayout.createSequentialGroup()
472 .addComponent(bnManageTypes)
473 .addGap(0, 0, Short.MAX_VALUE))
474 .addComponent(correlationPropertiesScrollPane))
477 pnCorrelationPropertiesLayout.setVerticalGroup(
478 pnCorrelationPropertiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
479 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnCorrelationPropertiesLayout.createSequentialGroup()
480 .addComponent(correlationPropertiesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 24, Short.MAX_VALUE)
481 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
482 .addComponent(bnManageTypes)
486 organizationPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.organizationPanel.border.title")));
488 org.openide.awt.Mnemonics.setLocalizedText(manageOrganizationButton,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.manageOrganizationButton.text"));
489 manageOrganizationButton.addActionListener(
new java.awt.event.ActionListener() {
490 public void actionPerformed(java.awt.event.ActionEvent evt) {
491 manageOrganizationButtonActionPerformed(evt);
495 organizationScrollPane.setBorder(null);
497 organizationTextArea.setEditable(
false);
498 organizationTextArea.setBackground(
new java.awt.Color(240, 240, 240));
499 organizationTextArea.setColumns(20);
500 organizationTextArea.setLineWrap(
true);
501 organizationTextArea.setRows(2);
502 organizationTextArea.setText(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.organizationTextArea.text"));
503 organizationTextArea.setWrapStyleWord(
true);
504 organizationTextArea.setBorder(null);
505 organizationTextArea.setOpaque(
false);
506 organizationScrollPane.setViewportView(organizationTextArea);
508 javax.swing.GroupLayout organizationPanelLayout =
new javax.swing.GroupLayout(organizationPanel);
509 organizationPanel.setLayout(organizationPanelLayout);
510 organizationPanelLayout.setHorizontalGroup(
511 organizationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
512 .addGroup(organizationPanelLayout.createSequentialGroup()
514 .addGroup(organizationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
515 .addComponent(organizationScrollPane)
516 .addGroup(organizationPanelLayout.createSequentialGroup()
517 .addComponent(manageOrganizationButton)
518 .addGap(0, 0, Short.MAX_VALUE)))
521 organizationPanelLayout.setVerticalGroup(
522 organizationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
523 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, organizationPanelLayout.createSequentialGroup()
525 .addComponent(organizationScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
526 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
527 .addComponent(manageOrganizationButton)
531 casesPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.casesPanel.border.title")));
532 casesPanel.setName(
"Case Details");
534 org.openide.awt.Mnemonics.setLocalizedText(showCasesButton,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.showCasesButton.text"));
535 showCasesButton.addActionListener(
new java.awt.event.ActionListener() {
536 public void actionPerformed(java.awt.event.ActionEvent evt) {
537 showCasesButtonActionPerformed(evt);
541 casesScrollPane.setBorder(null);
543 casesTextArea.setEditable(
false);
544 casesTextArea.setBackground(
new java.awt.Color(240, 240, 240));
545 casesTextArea.setColumns(20);
546 casesTextArea.setLineWrap(
true);
547 casesTextArea.setRows(2);
548 casesTextArea.setText(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.casesTextArea.text"));
549 casesTextArea.setWrapStyleWord(
true);
550 casesTextArea.setBorder(null);
551 casesTextArea.setOpaque(
false);
552 casesScrollPane.setViewportView(casesTextArea);
554 javax.swing.GroupLayout casesPanelLayout =
new javax.swing.GroupLayout(casesPanel);
555 casesPanel.setLayout(casesPanelLayout);
556 casesPanelLayout.setHorizontalGroup(
557 casesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
558 .addGroup(casesPanelLayout.createSequentialGroup()
560 .addGroup(casesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
561 .addComponent(casesScrollPane)
562 .addGroup(casesPanelLayout.createSequentialGroup()
563 .addComponent(showCasesButton)
564 .addGap(0, 0, Short.MAX_VALUE)))
567 casesPanelLayout.setVerticalGroup(
568 casesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
569 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, casesPanelLayout.createSequentialGroup()
571 .addComponent(casesScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
572 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
573 .addComponent(showCasesButton)
577 tbOops.setEditable(
false);
578 tbOops.setFont(tbOops.getFont().deriveFont(tbOops.getFont().getStyle() | java.awt.Font.BOLD, tbOops.getFont().getSize()-1));
579 tbOops.setText(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.tbOops.text"));
580 tbOops.setBorder(null);
582 ingestRunningWarningLabel.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/modules/filetypeid/warning16.png")));
583 org.openide.awt.Mnemonics.setLocalizedText(ingestRunningWarningLabel,
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.ingestRunningWarningLabel.text"));
585 javax.swing.GroupLayout jPanel1Layout =
new javax.swing.GroupLayout(jPanel1);
586 jPanel1.setLayout(jPanel1Layout);
587 jPanel1Layout.setHorizontalGroup(
588 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
589 .addComponent(lbCentralRepository, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
590 .addGroup(jPanel1Layout.createSequentialGroup()
591 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
592 .addComponent(pnDatabaseConfiguration, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
593 .addComponent(pnCorrelationProperties, javax.swing.GroupLayout.DEFAULT_SIZE, 1016, Short.MAX_VALUE)
594 .addComponent(organizationPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
595 .addComponent(casesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
596 .addGroup(jPanel1Layout.createSequentialGroup()
597 .addComponent(cbUseCentralRepo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
598 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
599 .addComponent(ingestRunningWarningLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 840, Short.MAX_VALUE))
600 .addGroup(jPanel1Layout.createSequentialGroup()
602 .addComponent(tbOops, javax.swing.GroupLayout.PREFERRED_SIZE, 974, javax.swing.GroupLayout.PREFERRED_SIZE)))
605 jPanel1Layout.setVerticalGroup(
606 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
607 .addGroup(jPanel1Layout.createSequentialGroup()
608 .addComponent(lbCentralRepository)
609 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
610 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
611 .addComponent(cbUseCentralRepo)
612 .addComponent(ingestRunningWarningLabel))
613 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
614 .addComponent(pnDatabaseConfiguration, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
616 .addComponent(pnCorrelationProperties, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
618 .addComponent(organizationPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
620 .addComponent(casesPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
622 .addComponent(tbOops, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
626 casesPanel.getAccessibleContext().setAccessibleName(
org.openide.util.NbBundle.getMessage(
GlobalSettingsPanel.class,
"GlobalSettingsPanel.Case Details.AccessibleContext.accessibleName"));
628 jScrollPane1.setViewportView(jPanel1);
630 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
631 this.setLayout(layout);
632 layout.setHorizontalGroup(
633 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
634 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
636 layout.setVerticalGroup(
637 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
638 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 512, Short.MAX_VALUE)
644 ManageCorrelationPropertiesDialog manageCorrelationDialog =
new ManageCorrelationPropertiesDialog();
645 firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
650 boolean changed = invokeCrChoice(
this, null);
663 ManageCasesDialog.displayManageCasesDialog();
674 testCurrentConfiguration();
678 @Messages({
"GlobalSettingsPanel.validationerrMsg.mustConfigure=Configure the database to enable this module."})
681 enableButtonSubComponents(
false);
685 lbDbPlatformValue.setText(selectedChoice.
getTitle());
689 lbDbNameValue.setText(
"");
690 lbDbLocationValue.setText(
"");
691 tbOops.setText(Bundle.GlobalSettingsPanel_validationerrMsg_mustConfigure());
693 enableButtonSubComponents(cbUseCentralRepo.isSelected());
697 lbDbNameValue.setText(dbSettingsPg.
getDbName());
698 lbDbLocationValue.setText(dbSettingsPg.
getHost());
700 logger.log(Level.WARNING,
"Unable to load settings into global panel for postgres settings", e);
704 lbDbNameValue.setText(dbSettingsSqlite.
getDbName());
731 @SuppressWarnings(
"FinalizeDeclaration")
732 protected
void finalize() throws Throwable {
752 if (isLocalIngestJobEvent(event)) {
753 EventQueue.invokeLater(
new Runnable() {
774 if (((AutopsyEvent) event).getSourceType() == AutopsyEvent.SourceType.LOCAL) {
775 String eventType =
event.getPropertyName();
784 @Messages({
"GlobalSettingsPanel.validationErrMsg.ingestRunning=You cannot change settings while ingest is running."})
786 if (!SwingUtilities.isEventDispatchThread()) {
787 SwingUtilities.invokeLater(() -> {
788 ingestStateUpdated(caseIsOpen);
794 cbUseCentralRepo.setEnabled(!caseIsOpen);
796 tbOops.setText(Bundle.GlobalSettingsPanel_validationErrMsg_ingestRunning());
797 tbOops.setVisible(
true);
798 enableButtonSubComponents(cbUseCentralRepo.isSelected());
803 enableDatabaseConfigureButton(cbUseCentralRepo.isSelected() && !caseIsOpen);
817 ingestRunningWarningLabel.setVisible(ingestRunning);
819 pnDatabaseConfiguration.setEnabled(enable && !ingestRunning);
820 bnDbConfigure.setEnabled(enable && !ingestRunning);
821 bnTestConfigure.setEnabled(enable && !ingestRunning);
822 lbDbLocationLabel.setEnabled(enable && !ingestRunning);
823 lbDbLocationValue.setEnabled(enable && !ingestRunning);
824 lbDbNameLabel.setEnabled(enable && !ingestRunning);
825 lbDbNameValue.setEnabled(enable && !ingestRunning);
826 lbDbPlatformTypeLabel.setEnabled(enable && !ingestRunning);
827 lbDbPlatformValue.setEnabled(enable && !ingestRunning);
828 tbOops.setEnabled(enable && !ingestRunning);
841 pnCorrelationProperties.setEnabled(enable && !ingestRunning);
842 bnManageTypes.setEnabled(enable && !ingestRunning);
843 correlationPropertiesTextArea.setEnabled(enable && !ingestRunning);
844 organizationPanel.setEnabled(enable && !ingestRunning);
845 organizationTextArea.setEnabled(enable && !ingestRunning);
846 manageOrganizationButton.setEnabled(enable && !ingestRunning);
847 showCasesButton.setEnabled(enable && !ingestRunning);
848 casesPanel.setEnabled(enable && !ingestRunning);
849 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
PostgresSettingsLoader MULTIUSER_SETTINGS_LOADER
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