mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
better state management for all the radios and check boxes
This commit is contained in:
parent
18db15c727
commit
c5bc291217
@ -212,6 +212,9 @@
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commonfilesearch/Bundle.properties" key="CommonFilesPanel.pictureVideoCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="pictureVideoCheckboxActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="documentsCheckbox">
|
||||
<Properties>
|
||||
@ -220,6 +223,9 @@
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commonfilesearch/Bundle.properties" key="CommonFilesPanel.documentsCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="documentsCheckboxActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="dataSourceLabel">
|
||||
<Properties>
|
||||
|
@ -408,9 +408,19 @@ public final class CommonFilesPanel extends javax.swing.JPanel {
|
||||
|
||||
pictureVideoCheckbox.setSelected(true);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(pictureVideoCheckbox, org.openide.util.NbBundle.getMessage(CommonFilesPanel.class, "CommonFilesPanel.pictureVideoCheckbox.text")); // NOI18N
|
||||
pictureVideoCheckbox.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
pictureVideoCheckboxActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
documentsCheckbox.setSelected(true);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(documentsCheckbox, org.openide.util.NbBundle.getMessage(CommonFilesPanel.class, "CommonFilesPanel.documentsCheckbox.text")); // NOI18N
|
||||
documentsCheckbox.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
documentsCheckboxActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
dataSourceLabel.setFont(new java.awt.Font("Dialog", 2, 12)); // NOI18N
|
||||
org.openide.awt.Mnemonics.setLocalizedText(dataSourceLabel, org.openide.util.NbBundle.getMessage(CommonFilesPanel.class, "CommonFilesPanel.text")); // NOI18N
|
||||
@ -511,6 +521,40 @@ public final class CommonFilesPanel extends javax.swing.JPanel {
|
||||
}//GEN-LAST:event_cancelButtonActionPerformed
|
||||
|
||||
private void allFileCategoriesRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_allFileCategoriesRadioButtonActionPerformed
|
||||
this.manageCheckBoxState();
|
||||
}//GEN-LAST:event_allFileCategoriesRadioButtonActionPerformed
|
||||
|
||||
private void selectedFileCategoriesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectedFileCategoriesButtonActionPerformed
|
||||
this.manageCheckBoxState();
|
||||
}//GEN-LAST:event_selectedFileCategoriesButtonActionPerformed
|
||||
|
||||
private void pictureVideoCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pictureVideoCheckboxActionPerformed
|
||||
this.disableCheckBoxesForEmptySelection();
|
||||
}//GEN-LAST:event_pictureVideoCheckboxActionPerformed
|
||||
|
||||
private void documentsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_documentsCheckboxActionPerformed
|
||||
this.disableCheckBoxesForEmptySelection();
|
||||
}//GEN-LAST:event_documentsCheckboxActionPerformed
|
||||
|
||||
public void disableCheckBoxesForEmptySelection() {
|
||||
if (!this.pictureVideoCheckbox.isSelected() && !this.documentsCheckbox.isSelected()) {
|
||||
this.allFileCategoriesRadioButton.setSelected(true);
|
||||
|
||||
this.pictureVideoCheckbox.setEnabled(false);
|
||||
this.documentsCheckbox.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void withinDataSourceSelected(boolean selected) {
|
||||
selectDataSourceComboBox.setEnabled(selected);
|
||||
if (selectDataSourceComboBox.isEnabled()) {
|
||||
selectDataSourceComboBox.setSelectedIndex(0);
|
||||
singleDataSource = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void manageCheckBoxState() {
|
||||
|
||||
if (this.allFileCategoriesRadioButton.isSelected()) {
|
||||
|
||||
this.pictureViewCheckboxState = this.pictureVideoCheckbox.isSelected();
|
||||
@ -519,9 +563,7 @@ public final class CommonFilesPanel extends javax.swing.JPanel {
|
||||
this.pictureVideoCheckbox.setEnabled(false);
|
||||
this.documentsCheckbox.setEnabled(false);
|
||||
}
|
||||
}//GEN-LAST:event_allFileCategoriesRadioButtonActionPerformed
|
||||
|
||||
private void selectedFileCategoriesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectedFileCategoriesButtonActionPerformed
|
||||
if (this.selectedFileCategoriesButton.isSelected()) {
|
||||
|
||||
this.pictureVideoCheckbox.setSelected(this.pictureViewCheckboxState);
|
||||
@ -530,14 +572,6 @@ public final class CommonFilesPanel extends javax.swing.JPanel {
|
||||
this.pictureVideoCheckbox.setEnabled(true);
|
||||
this.documentsCheckbox.setEnabled(true);
|
||||
}
|
||||
}//GEN-LAST:event_selectedFileCategoriesButtonActionPerformed
|
||||
|
||||
private void withinDataSourceSelected(boolean selected) {
|
||||
selectDataSourceComboBox.setEnabled(selected);
|
||||
if (selectDataSourceComboBox.isEnabled()) {
|
||||
selectDataSourceComboBox.setSelectedIndex(0);
|
||||
singleDataSource = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
|
Loading…
x
Reference in New Issue
Block a user