19 package org.sleuthkit.autopsy.modules.yara.ui;
21 import java.beans.PropertyChangeEvent;
22 import java.beans.PropertyChangeListener;
23 import java.util.ArrayList;
24 import java.util.Enumeration;
25 import java.util.List;
26 import javax.swing.DefaultListModel;
43 private final DefaultListModel<RuleSetListItem>
listModel;
50 listModel =
new DefaultListModel<>();
65 checkboxList.setModel(listModel);
66 checkboxList.setOpaque(
false);
68 for (
RuleSet set : ruleSetList) {
70 item.
setChecked(setNames.contains(set.getName()));
71 listModel.addElement(item);
79 public void propertyChange(PropertyChangeEvent evt) {
80 switch (evt.getPropertyName()) {
94 List<RuleSet> selectedRules =
new ArrayList<>();
96 Enumeration<RuleSetListItem> enumeration = listModel.elements();
97 while (enumeration.hasMoreElements()) {
100 selectedRules.add(item.getRuleSet());
113 if (ruleSet == null) {
118 listModel.addElement(item);
127 Enumeration<RuleSetListItem> enumeration = listModel.elements();
128 while (enumeration.hasMoreElements()) {
131 listModel.removeElement(item);
173 @SuppressWarnings(
"unchecked")
176 java.awt.GridBagConstraints gridBagConstraints;
184 setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
YaraIngestSettingsPanel.class,
"YaraIngestSettingsPanel.border.title")));
185 setLayout(
new java.awt.GridBagLayout());
186 gridBagConstraints =
new java.awt.GridBagConstraints();
187 gridBagConstraints.gridx = 0;
188 gridBagConstraints.gridy = 0;
189 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
190 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
191 gridBagConstraints.weightx = 1.0;
192 gridBagConstraints.weighty = 1.0;
193 gridBagConstraints.insets =
new java.awt.Insets(0, 5, 5, 5);
196 buttonPanel.setLayout(
new java.awt.GridBagLayout());
201 gridBagConstraints =
new java.awt.GridBagConstraints();
202 gridBagConstraints.gridx = 0;
203 gridBagConstraints.gridy = 0;
204 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
210 gridBagConstraints =
new java.awt.GridBagConstraints();
211 gridBagConstraints.gridx = 1;
212 gridBagConstraints.gridy = 0;
213 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
216 gridBagConstraints =
new java.awt.GridBagConstraints();
217 gridBagConstraints.gridx = 0;
218 gridBagConstraints.gridy = 1;
219 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
220 gridBagConstraints.weightx = 1.0;
static synchronized RuleSetManager getInstance()
javax.swing.JPanel buttonPanel
boolean onlyExecutableFiles
javax.swing.JRadioButton executableFilesButton
final DefaultListModel< RuleSetListItem > listModel
javax.swing.JScrollPane scrollPane
javax.swing.ButtonGroup buttonGroup
static final String RULE_SET_ADDED
void setChecked(boolean checked)
static void addPropertyChangeListener(PropertyChangeListener listener)
YaraIngestSettingsPanel(YaraIngestJobSettings settings)
static final String RULE_SET_DELETED
static final long serialVersionUID
synchronized List< RuleSet > getRuleSetList()
final CheckBoxJList< RuleSetListItem > checkboxList
javax.swing.JRadioButton allFilesButton
void handleRuleSetAdded(RuleSet ruleSet)
void handleRuleSetDeleted(RuleSet ruleSet)
IngestModuleIngestJobSettings getSettings()
List< String > getSelectedRuleSetNames()