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;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.beans.PropertyChangeSupport;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@ -57,7 +55,6 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
|
||||
private String selectedExt = "";
|
||||
ListSelectionModel lsm = null;
|
||||
private FileTypeDetector fileTypeDetector;
|
||||
private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
|
||||
|
||||
public FileExtMismatchSettingsPanel() {
|
||||
mimeTableModel = new MimeTableModel();
|
||||
@ -136,16 +133,6 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
|
||||
addExtButton.setEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
pcs.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
pcs.removePropertyChangeListener(l);
|
||||
}
|
||||
|
||||
private void clearErrLabels() {
|
||||
mimeErrLabel.setText(" ");
|
||||
extErrorLabel.setText(" ");
|
||||
@ -394,7 +381,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
|
||||
updateExtList();
|
||||
extTableModel.resync();
|
||||
this.userExtTextField.setText("");
|
||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}//GEN-LAST:event_addExtButtonActionPerformed
|
||||
|
||||
private void addTypeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addTypeButtonActionPerformed
|
||||
@ -442,7 +429,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
|
||||
mimeTableModel.resync();
|
||||
userTypeTextField.setText("");
|
||||
this.clearErrLabels();
|
||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}//GEN-LAST:event_addTypeButtonActionPerformed
|
||||
|
||||
private void userExtTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_userExtTextFieldFocusGained
|
||||
@ -467,7 +454,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
|
||||
// Refresh table
|
||||
updateMimeList();
|
||||
mimeTableModel.resync();
|
||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}//GEN-LAST:event_removeTypeButtonActionPerformed
|
||||
|
||||
private void removeExtButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeExtButtonActionPerformed
|
||||
@ -495,7 +482,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
|
||||
// Refresh tables
|
||||
updateExtList();
|
||||
extTableModel.resync();
|
||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}//GEN-LAST:event_removeExtButtonActionPerformed
|
||||
|
||||
private void updateMimeList() {
|
||||
|
@ -21,7 +21,6 @@ package org.sleuthkit.autopsy.modules.filetypeid;
|
||||
import java.awt.EventQueue;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.beans.PropertyChangeSupport;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
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
|
||||
// file type definitions.
|
||||
IngestJobEventPropertyChangeListener ingestJobEventsListener;
|
||||
private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
|
||||
|
||||
/**
|
||||
* Creates a panel to allow a user to make custom file type definitions.
|
||||
@ -100,16 +98,6 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
|
||||
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.
|
||||
*/
|
||||
@ -501,7 +489,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
|
||||
if (result == AddFileTypeDialog.BUTTON_PRESSED.OK) {
|
||||
fileTypes.add(dialog.getFileType());
|
||||
updateFileTypesListModel();
|
||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}
|
||||
|
||||
}//GEN-LAST:event_newTypeButtonActionPerformed
|
||||
@ -513,7 +501,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
|
||||
if (!typesListModel.isEmpty()) {
|
||||
typesList.setSelectedIndex(0);
|
||||
}
|
||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}//GEN-LAST:event_deleteTypeButtonActionPerformed
|
||||
|
||||
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.add(selected, dialog.getFileType());
|
||||
updateFileTypesListModel();
|
||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}
|
||||
}//GEN-LAST:event_editTypeButtonActionPerformed
|
||||
|
||||
|
@ -22,7 +22,6 @@ import java.awt.*;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.beans.PropertyChangeSupport;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -62,7 +61,6 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
||||
.getMessage(HashLookupSettingsPanel.class, "HashDbConfigPanel.errorGettingIndexStatusText");
|
||||
private final HashDbManager hashSetManager = HashDbManager.getInstance();
|
||||
private final HashSetTableModel hashSetTableModel = new HashSetTableModel();
|
||||
private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
|
||||
|
||||
public HashLookupSettingsPanel() {
|
||||
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() {
|
||||
HashDb db = ((HashSetTable) hashSetTable).getSelection();
|
||||
if (db != null) {
|
||||
@ -844,7 +832,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
||||
JOptionPane.showMessageDialog(null, Bundle.HashLookupSettingsPanel_removeDatabaseFailure_message(hashDb.getHashSetName()));
|
||||
}
|
||||
hashSetTableModel.refreshModel();
|
||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}
|
||||
}
|
||||
}//GEN-LAST:event_deleteDatabaseButtonActionPerformed
|
||||
@ -859,7 +847,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
||||
JOptionPane.showMessageDialog(null, Bundle.HashLookupSettingsPanel_removeDatabaseFailure_message(hashDb.getHashSetName()));
|
||||
}
|
||||
hashSetTableModel.refreshModel();
|
||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}
|
||||
}
|
||||
}//GEN-LAST:event_hashSetTableKeyPressed
|
||||
@ -868,7 +856,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
||||
HashDb hashDb = ((HashSetTable) hashSetTable).getSelection();
|
||||
if (hashDb != null) {
|
||||
hashDb.setSendIngestMessages(sendIngestMessagesCheckBox.isSelected());
|
||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}
|
||||
}//GEN-LAST:event_sendIngestMessagesCheckBoxActionPerformed
|
||||
|
||||
@ -877,7 +865,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
||||
if (null != hashDb) {
|
||||
hashSetTableModel.refreshModel();
|
||||
((HashSetTable) hashSetTable).selectRowByName(hashDb.getHashSetName());
|
||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}
|
||||
}//GEN-LAST:event_importDatabaseButtonActionPerformed
|
||||
|
||||
@ -886,7 +874,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
||||
if (null != hashDb) {
|
||||
hashSetTableModel.refreshModel();
|
||||
((HashSetTable) hashSetTable).selectRowByName(hashDb.getHashSetName());
|
||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}
|
||||
}//GEN-LAST:event_createDatabaseButtonActionPerformed
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user