mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
Updated use of PropertyChangeSupport in FileExtMismatchSettingsPanel, FileTypeIdGlobalSettingsPanel, HashLookupSettingsPanel
This commit is contained in:
parent
5c9145733e
commit
9cd3187017
@ -19,8 +19,6 @@
|
|||||||
package org.sleuthkit.autopsy.modules.fileextmismatch;
|
package org.sleuthkit.autopsy.modules.fileextmismatch;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.beans.PropertyChangeListener;
|
|
||||||
import java.beans.PropertyChangeSupport;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -57,7 +55,6 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
|
|||||||
private String selectedExt = "";
|
private String selectedExt = "";
|
||||||
ListSelectionModel lsm = null;
|
ListSelectionModel lsm = null;
|
||||||
private FileTypeDetector fileTypeDetector;
|
private FileTypeDetector fileTypeDetector;
|
||||||
private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
|
|
||||||
|
|
||||||
public FileExtMismatchSettingsPanel() {
|
public FileExtMismatchSettingsPanel() {
|
||||||
mimeTableModel = new MimeTableModel();
|
mimeTableModel = new MimeTableModel();
|
||||||
@ -136,16 +133,6 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
|
|||||||
addExtButton.setEnabled(false);
|
addExtButton.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
|
||||||
pcs.addPropertyChangeListener(l);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
|
||||||
pcs.removePropertyChangeListener(l);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void clearErrLabels() {
|
private void clearErrLabels() {
|
||||||
mimeErrLabel.setText(" ");
|
mimeErrLabel.setText(" ");
|
||||||
extErrorLabel.setText(" ");
|
extErrorLabel.setText(" ");
|
||||||
@ -394,7 +381,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
|
|||||||
updateExtList();
|
updateExtList();
|
||||||
extTableModel.resync();
|
extTableModel.resync();
|
||||||
this.userExtTextField.setText("");
|
this.userExtTextField.setText("");
|
||||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||||
}//GEN-LAST:event_addExtButtonActionPerformed
|
}//GEN-LAST:event_addExtButtonActionPerformed
|
||||||
|
|
||||||
private void addTypeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addTypeButtonActionPerformed
|
private void addTypeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addTypeButtonActionPerformed
|
||||||
@ -442,7 +429,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
|
|||||||
mimeTableModel.resync();
|
mimeTableModel.resync();
|
||||||
userTypeTextField.setText("");
|
userTypeTextField.setText("");
|
||||||
this.clearErrLabels();
|
this.clearErrLabels();
|
||||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||||
}//GEN-LAST:event_addTypeButtonActionPerformed
|
}//GEN-LAST:event_addTypeButtonActionPerformed
|
||||||
|
|
||||||
private void userExtTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_userExtTextFieldFocusGained
|
private void userExtTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_userExtTextFieldFocusGained
|
||||||
@ -467,7 +454,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
|
|||||||
// Refresh table
|
// Refresh table
|
||||||
updateMimeList();
|
updateMimeList();
|
||||||
mimeTableModel.resync();
|
mimeTableModel.resync();
|
||||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||||
}//GEN-LAST:event_removeTypeButtonActionPerformed
|
}//GEN-LAST:event_removeTypeButtonActionPerformed
|
||||||
|
|
||||||
private void removeExtButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeExtButtonActionPerformed
|
private void removeExtButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeExtButtonActionPerformed
|
||||||
@ -495,7 +482,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
|
|||||||
// Refresh tables
|
// Refresh tables
|
||||||
updateExtList();
|
updateExtList();
|
||||||
extTableModel.resync();
|
extTableModel.resync();
|
||||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||||
}//GEN-LAST:event_removeExtButtonActionPerformed
|
}//GEN-LAST:event_removeExtButtonActionPerformed
|
||||||
|
|
||||||
private void updateMimeList() {
|
private void updateMimeList() {
|
||||||
|
@ -21,7 +21,6 @@ package org.sleuthkit.autopsy.modules.filetypeid;
|
|||||||
import java.awt.EventQueue;
|
import java.awt.EventQueue;
|
||||||
import java.beans.PropertyChangeEvent;
|
import java.beans.PropertyChangeEvent;
|
||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import java.beans.PropertyChangeSupport;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@ -74,7 +73,6 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
|
|||||||
// modules obtained and shared a per data source ingest job snapshot of the
|
// modules obtained and shared a per data source ingest job snapshot of the
|
||||||
// file type definitions.
|
// file type definitions.
|
||||||
IngestJobEventPropertyChangeListener ingestJobEventsListener;
|
IngestJobEventPropertyChangeListener ingestJobEventsListener;
|
||||||
private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a panel to allow a user to make custom file type definitions.
|
* Creates a panel to allow a user to make custom file type definitions.
|
||||||
@ -100,16 +98,6 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
|
|||||||
populateTypeDetailsComponents();
|
populateTypeDetailsComponents();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
|
||||||
pcs.addPropertyChangeListener(l);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
|
||||||
pcs.removePropertyChangeListener(l);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the list model for the list of file types.
|
* Sets the list model for the list of file types.
|
||||||
*/
|
*/
|
||||||
@ -501,7 +489,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
|
|||||||
if (result == AddFileTypeDialog.BUTTON_PRESSED.OK) {
|
if (result == AddFileTypeDialog.BUTTON_PRESSED.OK) {
|
||||||
fileTypes.add(dialog.getFileType());
|
fileTypes.add(dialog.getFileType());
|
||||||
updateFileTypesListModel();
|
updateFileTypesListModel();
|
||||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}//GEN-LAST:event_newTypeButtonActionPerformed
|
}//GEN-LAST:event_newTypeButtonActionPerformed
|
||||||
@ -513,7 +501,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
|
|||||||
if (!typesListModel.isEmpty()) {
|
if (!typesListModel.isEmpty()) {
|
||||||
typesList.setSelectedIndex(0);
|
typesList.setSelectedIndex(0);
|
||||||
}
|
}
|
||||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||||
}//GEN-LAST:event_deleteTypeButtonActionPerformed
|
}//GEN-LAST:event_deleteTypeButtonActionPerformed
|
||||||
|
|
||||||
private void editTypeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editTypeButtonActionPerformed
|
private void editTypeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editTypeButtonActionPerformed
|
||||||
@ -524,7 +512,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
|
|||||||
this.fileTypes.remove(selected);
|
this.fileTypes.remove(selected);
|
||||||
this.fileTypes.add(selected, dialog.getFileType());
|
this.fileTypes.add(selected, dialog.getFileType());
|
||||||
updateFileTypesListModel();
|
updateFileTypesListModel();
|
||||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||||
}
|
}
|
||||||
}//GEN-LAST:event_editTypeButtonActionPerformed
|
}//GEN-LAST:event_editTypeButtonActionPerformed
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@ import java.awt.*;
|
|||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
import java.beans.PropertyChangeEvent;
|
import java.beans.PropertyChangeEvent;
|
||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import java.beans.PropertyChangeSupport;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -62,7 +61,6 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
.getMessage(HashLookupSettingsPanel.class, "HashDbConfigPanel.errorGettingIndexStatusText");
|
.getMessage(HashLookupSettingsPanel.class, "HashDbConfigPanel.errorGettingIndexStatusText");
|
||||||
private final HashDbManager hashSetManager = HashDbManager.getInstance();
|
private final HashDbManager hashSetManager = HashDbManager.getInstance();
|
||||||
private final HashSetTableModel hashSetTableModel = new HashSetTableModel();
|
private final HashSetTableModel hashSetTableModel = new HashSetTableModel();
|
||||||
private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
|
|
||||||
|
|
||||||
public HashLookupSettingsPanel() {
|
public HashLookupSettingsPanel() {
|
||||||
initComponents();
|
initComponents();
|
||||||
@ -104,16 +102,6 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
|
||||||
pcs.addPropertyChangeListener(l);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
|
||||||
pcs.removePropertyChangeListener(l);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateComponents() {
|
private void updateComponents() {
|
||||||
HashDb db = ((HashSetTable) hashSetTable).getSelection();
|
HashDb db = ((HashSetTable) hashSetTable).getSelection();
|
||||||
if (db != null) {
|
if (db != null) {
|
||||||
@ -844,7 +832,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
JOptionPane.showMessageDialog(null, Bundle.HashLookupSettingsPanel_removeDatabaseFailure_message(hashDb.getHashSetName()));
|
JOptionPane.showMessageDialog(null, Bundle.HashLookupSettingsPanel_removeDatabaseFailure_message(hashDb.getHashSetName()));
|
||||||
}
|
}
|
||||||
hashSetTableModel.refreshModel();
|
hashSetTableModel.refreshModel();
|
||||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}//GEN-LAST:event_deleteDatabaseButtonActionPerformed
|
}//GEN-LAST:event_deleteDatabaseButtonActionPerformed
|
||||||
@ -859,7 +847,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
JOptionPane.showMessageDialog(null, Bundle.HashLookupSettingsPanel_removeDatabaseFailure_message(hashDb.getHashSetName()));
|
JOptionPane.showMessageDialog(null, Bundle.HashLookupSettingsPanel_removeDatabaseFailure_message(hashDb.getHashSetName()));
|
||||||
}
|
}
|
||||||
hashSetTableModel.refreshModel();
|
hashSetTableModel.refreshModel();
|
||||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}//GEN-LAST:event_hashSetTableKeyPressed
|
}//GEN-LAST:event_hashSetTableKeyPressed
|
||||||
@ -868,7 +856,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
HashDb hashDb = ((HashSetTable) hashSetTable).getSelection();
|
HashDb hashDb = ((HashSetTable) hashSetTable).getSelection();
|
||||||
if (hashDb != null) {
|
if (hashDb != null) {
|
||||||
hashDb.setSendIngestMessages(sendIngestMessagesCheckBox.isSelected());
|
hashDb.setSendIngestMessages(sendIngestMessagesCheckBox.isSelected());
|
||||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||||
}
|
}
|
||||||
}//GEN-LAST:event_sendIngestMessagesCheckBoxActionPerformed
|
}//GEN-LAST:event_sendIngestMessagesCheckBoxActionPerformed
|
||||||
|
|
||||||
@ -877,7 +865,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
if (null != hashDb) {
|
if (null != hashDb) {
|
||||||
hashSetTableModel.refreshModel();
|
hashSetTableModel.refreshModel();
|
||||||
((HashSetTable) hashSetTable).selectRowByName(hashDb.getHashSetName());
|
((HashSetTable) hashSetTable).selectRowByName(hashDb.getHashSetName());
|
||||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||||
}
|
}
|
||||||
}//GEN-LAST:event_importDatabaseButtonActionPerformed
|
}//GEN-LAST:event_importDatabaseButtonActionPerformed
|
||||||
|
|
||||||
@ -886,7 +874,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
if (null != hashDb) {
|
if (null != hashDb) {
|
||||||
hashSetTableModel.refreshModel();
|
hashSetTableModel.refreshModel();
|
||||||
((HashSetTable) hashSetTable).selectRowByName(hashDb.getHashSetName());
|
((HashSetTable) hashSetTable).selectRowByName(hashDb.getHashSetName());
|
||||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||||
}
|
}
|
||||||
}//GEN-LAST:event_createDatabaseButtonActionPerformed
|
}//GEN-LAST:event_createDatabaseButtonActionPerformed
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user