Autopsy  4.17.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
FilesSetRulePanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2014-2018 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.modules.interestingitems;
20 
21 import java.awt.Color;
22 import java.awt.event.ActionEvent;
23 import java.util.Arrays;
24 import java.util.List;
25 import java.util.SortedSet;
26 import java.util.logging.Level;
27 import java.util.regex.Pattern;
28 import java.util.regex.PatternSyntaxException;
29 import javax.swing.JButton;
30 import javax.swing.JComponent;
31 import javax.swing.JOptionPane;
32 import org.openide.DialogDisplayer;
33 import org.openide.NotifyDescriptor;
34 import org.openide.util.NbBundle;
35 import org.openide.util.NbBundle.Messages;
40 
44 @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
45 final class FilesSetRulePanel extends javax.swing.JPanel {
46 
47  @Messages({
48  "FilesSetRulePanel.bytes=Bytes",
49  "FilesSetRulePanel.kiloBytes=Kilobytes",
50  "FilesSetRulePanel.megaBytes=Megabytes",
51  "FilesSetRulePanel.gigaBytes=Gigabytes",
52  "FilesSetRulePanel.nameTextField.fullNameExample=Example: \"file.exe\"",
53  "FilesSetRulePanel.nameTextField.extensionExample=Examples: \"jpg\" or \"jpg,jpeg,gif\"",
54  "FilesSetRulePanel.NoConditionError=Must have at least one condition to make a rule.",
55  "FilesSetRulePanel.NoMimeTypeError=Please select a valid MIME type.",
56  "FilesSetRulePanel.NoNameError=Name cannot be empty",
57  "FilesSetRulePanel.NoPathError=Path cannot be empty",
58  "FilesSetRulePanel.DaysIncludedEmptyError=Number of days included cannot be empty.",
59  "FilesSetRulePanel.DaysIncludedInvalidError=Number of days included must be a positive integer.",
60  "FilesSetRulePanel.ZeroFileSizeError=File size condition value must not be 0 (Unless = is selected).",
61  "# {0} - regex",
62  "FilesSetRulePanel.CommaInRegexWarning=Warning: Comma(s) in the file extension field will be interpreted as part of a regex and will not split the entry into multiple extensions (Entered: \"{0}\")",
63  })
64 
65  private static final long serialVersionUID = 1L;
66  private static final Logger logger = Logger.getLogger(FilesSetRulePanel.class.getName());
67  private static final String SLEUTHKIT_PATH_SEPARATOR = "/"; // NON-NLS
68  private static final List<String> ILLEGAL_FILE_NAME_CHARS = FilesSetsManager.getIllegalFileNameChars();
69  private static final List<String> ILLEGAL_FILE_PATH_CHARS = FilesSetsManager.getIllegalFilePathChars();
70  private JButton okButton;
71  private JButton cancelButton;
72  private TextPrompt nameTextFieldPrompt;
73 
77  FilesSetRulePanel(JButton okButton, JButton cancelButton, PANEL_TYPE panelType) {
78  initComponents();
79  if (panelType == FilesSetDefsPanel.PANEL_TYPE.FILE_INGEST_FILTERS) { //Hide the mimetype settings when this is displaying a FileSet rule instead of a interesting item rule
80  mimeTypeComboBox.setVisible(false);
81  mimeCheck.setVisible(false);
82  fileSizeComboBox.setVisible(false);
83  fileSizeCheck.setVisible(false);
84  equalitySymbolComboBox.setVisible(false);
85  fileSizeSpinner.setVisible(false);
86  jLabel1.setVisible(false);
87  filesRadioButton.setVisible(false);
88  dirsRadioButton.setVisible(false);
89  allRadioButton.setVisible(false);
90  org.openide.awt.Mnemonics.setLocalizedText(jLabel5, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.ingest.jLabel5.text")); // NOI18N
91 
92  } else {
93  populateMimeTypesComboBox();
94  }
95  this.dateCheckActionPerformed(null);
96  populateComponentsWithDefaultValues();
97  this.setButtons(okButton, cancelButton);
98 
99  updateNameTextFieldPrompt();
100  }
101 
107  FilesSetRulePanel(FilesSet.Rule rule, JButton okButton, JButton cancelButton, PANEL_TYPE panelType) {
108  initComponents();
109  if (panelType == FilesSetDefsPanel.PANEL_TYPE.FILE_INGEST_FILTERS) { //Hide the mimetype settings when this is displaying a FileSet rule instead of a interesting item rule
110  mimeTypeComboBox.setVisible(false);
111  mimeCheck.setVisible(false);
112  fileSizeComboBox.setVisible(false);
113  fileSizeCheck.setVisible(false);
114  equalitySymbolComboBox.setVisible(false);
115  fileSizeSpinner.setVisible(false);
116  jLabel1.setVisible(false);
117  filesRadioButton.setVisible(false);
118  dirsRadioButton.setVisible(false);
119  allRadioButton.setVisible(false);
120  } else {
121  populateMimeTypesComboBox();
122  populateMimeConditionComponents(rule);
123  populateSizeConditionComponents(rule);
124 
125  }
126  populateMimeTypesComboBox();
127  populateRuleNameComponent(rule);
128  populateTypeConditionComponents(rule);
129  populateNameConditionComponents(rule);
130  populatePathConditionComponents(rule);
131  populateDateConditionComponents(rule);
132  this.setButtons(okButton, cancelButton);
133 
134  updateNameTextFieldPrompt();
135  setComponentsForSearchType();
136  }
137 
142  private void updateNameTextFieldPrompt() {
146  String text;
147  if (fullNameRadioButton.isSelected()) {
148  text = Bundle.FilesSetRulePanel_nameTextField_fullNameExample();
149  } else {
150  text = Bundle.FilesSetRulePanel_nameTextField_extensionExample();
151  }
152  nameTextFieldPrompt = new TextPrompt(text, nameTextField);
153 
157  nameTextFieldPrompt.setForeground(Color.LIGHT_GRAY);
158  nameTextFieldPrompt.changeAlpha(0.9f); // Mostly opaque
159 
160  validate();
161  repaint();
162  }
163 
167  private void populateComponentsWithDefaultValues() {
168  this.filesRadioButton.setSelected(true);
169  this.fullNameRadioButton.setSelected(true);
170  this.equalitySymbolComboBox.setSelectedItem(FilesSet.Rule.FileSizeCondition.COMPARATOR.GREATER_THAN_EQUAL.getSymbol());
171  this.fileSizeComboBox.setSelectedItem(FilesSet.Rule.FileSizeCondition.SIZE_UNIT.KILOBYTE.getName());
172  this.mimeTypeComboBox.setSelectedIndex(0);
173  }
174 
175  private void populateMimeTypesComboBox() {
176  try {
177  SortedSet<String> detectableMimeTypes = FileTypeDetector.getDetectedTypes();
178  detectableMimeTypes.forEach((type) -> {
179  mimeTypeComboBox.addItem(type);
180  });
181  } catch (FileTypeDetector.FileTypeDetectorInitException ex) {
182  logger.log(Level.SEVERE, "Unable to get detectable file types", ex);
183  }
184  this.setOkButton();
185  }
186 
192  private void populateRuleNameComponent(FilesSet.Rule rule) {
193  this.ruleNameTextField.setText(rule.getName());
194  }
195 
196  private void populateMimeConditionComponents(FilesSet.Rule rule) {
197  FilesSet.Rule.MimeTypeCondition mimeTypeCondition = rule.getMimeTypeCondition();
198  if (mimeTypeCondition != null) {
199  this.mimeCheck.setSelected(true);
200  this.mimeCheckActionPerformed(null);
201  this.mimeTypeComboBox.setSelectedItem(mimeTypeCondition.getMimeType());
202  }
203  }
204 
205  private void populateSizeConditionComponents(FilesSet.Rule rule) {
206  FilesSet.Rule.FileSizeCondition fileSizeCondition = rule.getFileSizeCondition();
207  if (fileSizeCondition != null) {
208  this.fileSizeCheck.setSelected(true);
209  this.fileSizeCheckActionPerformed(null);
210  this.fileSizeSpinner.setValue(fileSizeCondition.getSizeValue());
211  this.fileSizeComboBox.setSelectedItem(fileSizeCondition.getUnit().getName());
212  this.equalitySymbolComboBox.setSelectedItem(fileSizeCondition.getComparator().getSymbol());
213  }
214  }
215 
220  private void setOkButton() {
221  if (this.okButton != null) {
222  this.okButton.setEnabled(this.fileSizeCheck.isSelected() || this.mimeCheck.isSelected()
223  || this.nameCheck.isSelected() || this.pathCheck.isSelected() || this.dateCheck.isSelected());
224  }
225  }
226 
234  private JOptionPane getOptionPane(JComponent parent) {
235  JOptionPane pane;
236  if (!(parent instanceof JOptionPane)) {
237  pane = getOptionPane((JComponent) parent.getParent());
238  } else {
239  pane = (JOptionPane) parent;
240  }
241  return pane;
242  }
243 
250  private void setButtons(JButton ok, JButton cancel) {
251  this.okButton = ok;
252  this.cancelButton = cancel;
253  okButton.addActionListener((ActionEvent e) -> {
254  JOptionPane pane = getOptionPane(okButton);
255  pane.setValue(okButton);
256  });
257  cancelButton.addActionListener((ActionEvent e) -> {
258  JOptionPane pane = getOptionPane(cancelButton);
259  pane.setValue(cancelButton);
260  });
261  this.setOkButton();
262  }
263 
270  private void populateTypeConditionComponents(FilesSet.Rule rule) {
271  FilesSet.Rule.MetaTypeCondition typeCondition = rule.getMetaTypeCondition();
272  switch (typeCondition.getMetaType()) {
273  case FILES:
274  this.filesRadioButton.setSelected(true);
275  break;
276  case DIRECTORIES:
277  this.dirsRadioButton.setSelected(true);
278  break;
279  case ALL:
280  this.allRadioButton.setSelected(true);
281  break;
282  }
283  }
284 
290  private void populateNameConditionComponents(FilesSet.Rule rule) {
291  FilesSet.Rule.FileNameCondition nameCondition = rule.getFileNameCondition();
292  if (nameCondition != null) {
293  this.nameCheck.setSelected(true);
294  this.nameCheckActionPerformed(null);
295  this.nameTextField.setText(nameCondition.getTextToMatch());
296  this.nameRegexCheckbox.setSelected(nameCondition.isRegex());
297  if (nameCondition instanceof FilesSet.Rule.FullNameCondition) {
298  this.fullNameRadioButton.setSelected(true);
299  } else {
300  this.extensionRadioButton.setSelected(true);
301  }
302  }
303  }
304 
311  private void populatePathConditionComponents(FilesSet.Rule rule) {
312  FilesSet.Rule.ParentPathCondition pathCondition = rule.getPathCondition();
313  if (pathCondition != null) {
314  this.pathCheck.setSelected(true);
315  this.pathCheckActionPerformed(null);
316  this.pathTextField.setText(pathCondition.getTextToMatch());
317  this.pathRegexCheckBox.setSelected(pathCondition.isRegex());
318  }
319  }
320 
327  private void populateDateConditionComponents(FilesSet.Rule rule) {
328  FilesSet.Rule.DateCondition dateCondition = rule.getDateCondition();
329  if (dateCondition != null) {
330  this.dateCheck.setSelected(true);
331  this.dateCheckActionPerformed(null);
332  this.daysIncludedTextField.setText(Integer.toString(dateCondition.getDaysIncluded()));
333  }
334  }
335 
343  boolean isValidRuleDefinition() {
344 
345  if (!(this.mimeCheck.isSelected() || this.fileSizeCheck.isSelected() || this.pathCheck.isSelected() || this.nameCheck.isSelected() || this.dateCheck.isSelected())) {
346  NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
347  Bundle.FilesSetRulePanel_NoConditionError(),
348  NotifyDescriptor.WARNING_MESSAGE);
349  DialogDisplayer.getDefault().notify(notifyDesc);
350  return false;
351  }
352 
353  if (this.nameCheck.isSelected()) {
354  // The name condition must either be a regular expression that compiles or
355  // a string without illegal file name chars.
356  if (this.nameTextField.getText().isEmpty()) {
357  NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
358  Bundle.FilesSetRulePanel_NoNameError(),
359  NotifyDescriptor.WARNING_MESSAGE);
360  DialogDisplayer.getDefault().notify(notifyDesc);
361  return false;
362  }
363  if (this.nameRegexCheckbox.isSelected()) {
364 
365  // If extension is also selected and the regex contains a comma, display a warning
366  // since it is unclear whether the comma is part of a regex or is separating extensions.
367  if (this.extensionRadioButton.isSelected() && this.nameTextField.getText().contains(",")) {
368  NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
369  Bundle.FilesSetRulePanel_CommaInRegexWarning(this.nameTextField.getText()),
370  NotifyDescriptor.WARNING_MESSAGE);
371  DialogDisplayer.getDefault().notify(notifyDesc);
372  }
373 
374  try {
375  Pattern.compile(this.nameTextField.getText());
376  } catch (PatternSyntaxException ex) {
377  NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
378  NbBundle.getMessage(FilesSetPanel.class, "FilesSetRulePanel.messages.invalidNameRegex", ex.getLocalizedMessage()),
379  NotifyDescriptor.WARNING_MESSAGE);
380  DialogDisplayer.getDefault().notify(notifyDesc);
381  return false;
382  }
383  } else if (this.nameTextField.getText().isEmpty() || !FilesSetRulePanel.containsOnlyLegalChars(this.nameTextField.getText(), FilesSetRulePanel.ILLEGAL_FILE_NAME_CHARS)) {
384  NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
385  NbBundle.getMessage(FilesSetPanel.class, "FilesSetRulePanel.messages.invalidCharInName"),
386  NotifyDescriptor.WARNING_MESSAGE);
387  DialogDisplayer.getDefault().notify(notifyDesc);
388  return false;
389  }
390  }
391 
392  // The path condition, if specified, must either be a regular expression
393  // that compiles or a string without illegal file path chars.
394  if (this.pathCheck.isSelected()) {
395  if (this.pathTextField.getText().isEmpty()) {
396  NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
397  Bundle.FilesSetRulePanel_NoPathError(),
398  NotifyDescriptor.WARNING_MESSAGE);
399  DialogDisplayer.getDefault().notify(notifyDesc);
400  return false;
401  }
402  if (this.pathRegexCheckBox.isSelected()) {
403  try {
404  Pattern.compile(this.pathTextField.getText());
405  } catch (PatternSyntaxException ex) {
406  NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
407  NbBundle.getMessage(FilesSetPanel.class, "FilesSetRulePanel.messages.invalidPathRegex", ex.getLocalizedMessage()),
408  NotifyDescriptor.WARNING_MESSAGE);
409  DialogDisplayer.getDefault().notify(notifyDesc);
410  return false;
411  }
412  } else if (this.pathTextField.getText().isEmpty() || !FilesSetRulePanel.containsOnlyLegalChars(this.pathTextField.getText(), FilesSetRulePanel.ILLEGAL_FILE_PATH_CHARS)) {
413  NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
414  NbBundle.getMessage(FilesSetPanel.class, "FilesSetRulePanel.messages.invalidCharInPath"),
415  NotifyDescriptor.WARNING_MESSAGE);
416  DialogDisplayer.getDefault().notify(notifyDesc);
417  return false;
418  }
419  }
420  if (this.mimeCheck.isSelected()) {
421  if (this.mimeTypeComboBox.getSelectedIndex() == 0) {
422  NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
423  Bundle.FilesSetRulePanel_NoMimeTypeError(),
424  NotifyDescriptor.WARNING_MESSAGE);
425  DialogDisplayer.getDefault().notify(notifyDesc);
426  return false;
427  }
428  }
429  if (this.fileSizeCheck.isSelected()) {
430  if ((Integer) this.fileSizeSpinner.getValue() == 0 && !((String) this.equalitySymbolComboBox.getSelectedItem()).equals("=")) {
431  NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
432  Bundle.FilesSetRulePanel_ZeroFileSizeError(),
433  NotifyDescriptor.WARNING_MESSAGE);
434  DialogDisplayer.getDefault().notify(notifyDesc);
435  return false;
436  }
437  }
438 
439  if (this.dateCheck.isSelected()) {
440  if (this.daysIncludedTextField.getText().isEmpty()) {
441  NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
442  Bundle.FilesSetRulePanel_DaysIncludedEmptyError(),
443  NotifyDescriptor.WARNING_MESSAGE);
444  DialogDisplayer.getDefault().notify(notifyDesc);
445  return false;
446  }
447  try {
448  int value = Integer.parseInt(daysIncludedTextField.getText());
449  if (value < 0) {
450  throw new NumberFormatException("Negative numbers are not allowed for the within N days condition");
451  }
452  } catch (NumberFormatException e) {
453  //field did not contain an integer
454  NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
455  Bundle.FilesSetRulePanel_DaysIncludedInvalidError(),
456  NotifyDescriptor.WARNING_MESSAGE);
457  DialogDisplayer.getDefault().notify(notifyDesc);
458  return false;
459  }
460  }
461  return true;
462  }
463 
469  String getRuleName() {
470  return this.ruleNameTextField.getText();
471  }
472 
482  FilesSet.Rule.FileNameCondition getFileNameCondition() throws IllegalStateException {
483  FilesSet.Rule.FileNameCondition condition = null;
484  if (!this.nameTextField.getText().isEmpty()) {
485  if (this.nameRegexCheckbox.isSelected()) {
486  try {
487  Pattern pattern = Pattern.compile(this.nameTextField.getText(), Pattern.CASE_INSENSITIVE);
488  if (this.fullNameRadioButton.isSelected()) {
489  condition = new FilesSet.Rule.FullNameCondition(pattern);
490  } else {
491  condition = new FilesSet.Rule.ExtensionCondition(pattern);
492  }
493  } catch (PatternSyntaxException ex) {
494  logger.log(Level.SEVERE, "Attempt to get regex name condition that does not compile", ex); // NON-NLS
495  throw new IllegalStateException("The files set rule panel name condition is not in a valid state"); // NON-NLS
496  }
497  } else if (FilesSetRulePanel.containsOnlyLegalChars(this.nameTextField.getText(), FilesSetRulePanel.ILLEGAL_FILE_NAME_CHARS)) {
498  if (this.fullNameRadioButton.isSelected()) {
499  condition = new FilesSet.Rule.FullNameCondition(this.nameTextField.getText());
500  } else {
501  List<String> extensions = Arrays.asList(this.nameTextField.getText().split(","));
502  for (int i=0; i < extensions.size(); i++) {
503  // Remove leading and trailing whitespace.
504  extensions.set(i, extensions.get(i).trim());
505  }
506  condition = new FilesSet.Rule.ExtensionCondition(extensions);
507  }
508  } else {
509  logger.log(Level.SEVERE, "Attempt to get name condition with illegal chars"); // NON-NLS
510  throw new IllegalStateException("The files set rule panel name condition is not in a valid state"); // NON-NLS
511  }
512  }
513  return condition;
514  }
515 
521  FilesSet.Rule.MimeTypeCondition getMimeTypeCondition() {
522  FilesSet.Rule.MimeTypeCondition condition = null;
523  if (!this.mimeTypeComboBox.getSelectedItem().equals("")) {
524  condition = new FilesSet.Rule.MimeTypeCondition((String) this.mimeTypeComboBox.getSelectedItem());
525  }
526  return condition;
527  }
528 
534  FilesSet.Rule.FileSizeCondition getFileSizeCondition() {
535  FilesSet.Rule.FileSizeCondition condition = null;
536  if (this.fileSizeCheck.isSelected()) {
537  if ((Integer) this.fileSizeSpinner.getValue() != 0 || ((String) this.equalitySymbolComboBox.getSelectedItem()).equals("=")) {
538  FilesSet.Rule.FileSizeCondition.COMPARATOR comparator = FilesSet.Rule.FileSizeCondition.COMPARATOR.fromSymbol((String) this.equalitySymbolComboBox.getSelectedItem());
539  FilesSet.Rule.FileSizeCondition.SIZE_UNIT unit = FilesSet.Rule.FileSizeCondition.SIZE_UNIT.fromName((String) this.fileSizeComboBox.getSelectedItem());
540  int fileSizeValue = (Integer) this.fileSizeSpinner.getValue();
541  condition = new FilesSet.Rule.FileSizeCondition(comparator, unit, fileSizeValue);
542  }
543  }
544  return condition;
545  }
546 
553  FilesSet.Rule.MetaTypeCondition getMetaTypeCondition() {
554  if (this.filesRadioButton.isSelected()) {
555  return new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.FILES);
556  } else if (this.dirsRadioButton.isSelected()) {
557  return new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.DIRECTORIES);
558  } else {
559  return new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.ALL);
560  }
561  }
562 
572  FilesSet.Rule.ParentPathCondition getPathCondition() throws IllegalStateException {
573  FilesSet.Rule.ParentPathCondition condition = null;
574  if (!this.pathTextField.getText().isEmpty()) {
575  if (this.pathRegexCheckBox.isSelected()) {
576  try {
577  condition = new FilesSet.Rule.ParentPathCondition(Pattern.compile(this.pathTextField.getText(), Pattern.CASE_INSENSITIVE));
578  } catch (PatternSyntaxException ex) {
579  logger.log(Level.SEVERE, "Attempt to get malformed path condition", ex); // NON-NLS
580  throw new IllegalStateException("The files set rule panel path condition is not in a valid state"); // NON-NLS
581  }
582  } else {
583  String path = this.pathTextField.getText();
584  if (FilesSetRulePanel.containsOnlyLegalChars(path, FilesSetRulePanel.ILLEGAL_FILE_PATH_CHARS)) {
585  // Add a leading path separator if omitted.
586  if (!path.startsWith(FilesSetRulePanel.SLEUTHKIT_PATH_SEPARATOR)) {
587  path = FilesSetRulePanel.SLEUTHKIT_PATH_SEPARATOR + path;
588  }
589  // Add a trailing path separator if omitted.
590  if (!path.endsWith(FilesSetRulePanel.SLEUTHKIT_PATH_SEPARATOR)) {
591  path += FilesSetRulePanel.SLEUTHKIT_PATH_SEPARATOR;
592  }
593  condition = new FilesSet.Rule.ParentPathCondition(path);
594  } else {
595  logger.log(Level.SEVERE, "Attempt to get path condition with illegal chars"); // NON-NLS
596  throw new IllegalStateException("The files set rule panel path condition is not in a valid state"); // NON-NLS
597  }
598  }
599  }
600  return condition;
601  }
602 
612  FilesSet.Rule.DateCondition getDateCondition() {
613  FilesSet.Rule.DateCondition dateCondition = null;
614  if (!daysIncludedTextField.getText().isEmpty()) {
615  dateCondition = new FilesSet.Rule.DateCondition(Integer.parseInt(daysIncludedTextField.getText()));
616  }
617  return dateCondition;
618  }
619 
629  private static boolean containsOnlyLegalChars(String toBeChecked, List<String> illegalChars) {
630  for (String illegalChar : illegalChars) {
631  if (toBeChecked.contains(illegalChar)) {
632  return false;
633  }
634  }
635  return true;
636  }
637 
642  private void setComponentsForSearchType() {
643  if (!this.filesRadioButton.isSelected()) {
644  this.fullNameRadioButton.setSelected(true);
645  this.extensionRadioButton.setEnabled(false);
646  this.mimeTypeComboBox.setEnabled(false);
647  this.mimeTypeComboBox.setSelectedIndex(0);
648  this.equalitySymbolComboBox.setEnabled(false);
649  this.fileSizeComboBox.setEnabled(false);
650  this.fileSizeSpinner.setEnabled(false);
651  this.fileSizeSpinner.setValue(0);
652  this.fileSizeCheck.setEnabled(false);
653  this.fileSizeCheck.setSelected(false);
654  this.mimeCheck.setEnabled(false);
655  this.mimeCheck.setSelected(false);
656  } else {
657  if (this.nameCheck.isSelected()) {
658  this.extensionRadioButton.setEnabled(true);
659  }
660  this.fileSizeCheck.setEnabled(true);
661  this.mimeCheck.setEnabled(true);
662  }
663  }
664 
670  @SuppressWarnings("unchecked")
671  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
672  private void initComponents() {
673 
674  nameButtonGroup = new javax.swing.ButtonGroup();
675  typeButtonGroup = new javax.swing.ButtonGroup();
676  ruleNameLabel = new javax.swing.JLabel();
677  ruleNameTextField = new javax.swing.JTextField();
678  jLabel1 = new javax.swing.JLabel();
679  nameTextField = new javax.swing.JTextField();
680  fullNameRadioButton = new javax.swing.JRadioButton();
681  extensionRadioButton = new javax.swing.JRadioButton();
682  nameRegexCheckbox = new javax.swing.JCheckBox();
683  pathTextField = new javax.swing.JTextField();
684  pathRegexCheckBox = new javax.swing.JCheckBox();
685  pathSeparatorInfoLabel = new javax.swing.JLabel();
686  jLabel5 = new javax.swing.JLabel();
687  mimeTypeComboBox = new javax.swing.JComboBox<String>();
688  equalitySymbolComboBox = new javax.swing.JComboBox<String>();
689  fileSizeComboBox = new javax.swing.JComboBox<String>();
690  fileSizeSpinner = new javax.swing.JSpinner();
691  nameCheck = new javax.swing.JCheckBox();
692  pathCheck = new javax.swing.JCheckBox();
693  mimeCheck = new javax.swing.JCheckBox();
694  fileSizeCheck = new javax.swing.JCheckBox();
695  filesRadioButton = new javax.swing.JRadioButton();
696  dirsRadioButton = new javax.swing.JRadioButton();
697  allRadioButton = new javax.swing.JRadioButton();
698  daysIncludedTextField = new javax.swing.JTextField();
699  daysIncludedLabel = new javax.swing.JLabel();
700  dateCheck = new javax.swing.JCheckBox();
701 
702  org.openide.awt.Mnemonics.setLocalizedText(ruleNameLabel, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.ruleNameLabel.text")); // NOI18N
703 
704  ruleNameTextField.setText(org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.ruleNameTextField.text")); // NOI18N
705 
706  org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.jLabel1.text")); // NOI18N
707 
708  nameTextField.setText(org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.nameTextField.text")); // NOI18N
709  nameTextField.setEnabled(false);
710 
711  nameButtonGroup.add(fullNameRadioButton);
712  org.openide.awt.Mnemonics.setLocalizedText(fullNameRadioButton, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.fullNameRadioButton.text")); // NOI18N
713  fullNameRadioButton.setEnabled(false);
714  fullNameRadioButton.addActionListener(new java.awt.event.ActionListener() {
715  public void actionPerformed(java.awt.event.ActionEvent evt) {
716  fullNameRadioButtonActionPerformed(evt);
717  }
718  });
719 
720  nameButtonGroup.add(extensionRadioButton);
721  org.openide.awt.Mnemonics.setLocalizedText(extensionRadioButton, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.extensionRadioButton.text")); // NOI18N
722  extensionRadioButton.setEnabled(false);
723  extensionRadioButton.addActionListener(new java.awt.event.ActionListener() {
724  public void actionPerformed(java.awt.event.ActionEvent evt) {
725  extensionRadioButtonActionPerformed(evt);
726  }
727  });
728 
729  org.openide.awt.Mnemonics.setLocalizedText(nameRegexCheckbox, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.nameRegexCheckbox.text")); // NOI18N
730  nameRegexCheckbox.setEnabled(false);
731 
732  pathTextField.setText(org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.pathTextField.text")); // NOI18N
733  pathTextField.setEnabled(false);
734 
735  org.openide.awt.Mnemonics.setLocalizedText(pathRegexCheckBox, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.pathRegexCheckBox.text")); // NOI18N
736  pathRegexCheckBox.setEnabled(false);
737 
738  pathSeparatorInfoLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/info-icon-16.png"))); // NOI18N
739  org.openide.awt.Mnemonics.setLocalizedText(pathSeparatorInfoLabel, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.pathSeparatorInfoLabel.text")); // NOI18N
740  pathSeparatorInfoLabel.setEnabled(false);
741 
742  org.openide.awt.Mnemonics.setLocalizedText(jLabel5, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.interesting.jLabel5.text")); // NOI18N
743 
744  mimeTypeComboBox.setEditable(true);
745  mimeTypeComboBox.setModel(new javax.swing.DefaultComboBoxModel<String>(new String[] {""}));
746  mimeTypeComboBox.setEnabled(false);
747 
748  equalitySymbolComboBox.setModel(new javax.swing.DefaultComboBoxModel<String>(new String[] { "=", ">", "≥", "<", "≤" }));
749  equalitySymbolComboBox.setEnabled(false);
750 
751  fileSizeComboBox.setModel(new javax.swing.DefaultComboBoxModel<String>(new String[] { Bundle.FilesSetRulePanel_bytes(), Bundle.FilesSetRulePanel_kiloBytes(), Bundle.FilesSetRulePanel_megaBytes(), Bundle.FilesSetRulePanel_gigaBytes() }));
752  fileSizeComboBox.setEnabled(false);
753 
754  fileSizeSpinner.setModel(new javax.swing.SpinnerNumberModel(0, 0, null, 1));
755  fileSizeSpinner.setEnabled(false);
756 
757  org.openide.awt.Mnemonics.setLocalizedText(nameCheck, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.nameCheck.text")); // NOI18N
758  nameCheck.addActionListener(new java.awt.event.ActionListener() {
759  public void actionPerformed(java.awt.event.ActionEvent evt) {
760  nameCheckActionPerformed(evt);
761  }
762  });
763 
764  org.openide.awt.Mnemonics.setLocalizedText(pathCheck, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.pathCheck.text")); // NOI18N
765  pathCheck.addActionListener(new java.awt.event.ActionListener() {
766  public void actionPerformed(java.awt.event.ActionEvent evt) {
767  pathCheckActionPerformed(evt);
768  }
769  });
770 
771  org.openide.awt.Mnemonics.setLocalizedText(mimeCheck, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.mimeCheck.text")); // NOI18N
772  mimeCheck.addActionListener(new java.awt.event.ActionListener() {
773  public void actionPerformed(java.awt.event.ActionEvent evt) {
774  mimeCheckActionPerformed(evt);
775  }
776  });
777 
778  org.openide.awt.Mnemonics.setLocalizedText(fileSizeCheck, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.fileSizeCheck.text")); // NOI18N
779  fileSizeCheck.addActionListener(new java.awt.event.ActionListener() {
780  public void actionPerformed(java.awt.event.ActionEvent evt) {
781  fileSizeCheckActionPerformed(evt);
782  }
783  });
784 
785  typeButtonGroup.add(filesRadioButton);
786  org.openide.awt.Mnemonics.setLocalizedText(filesRadioButton, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.filesRadioButton.text")); // NOI18N
787  filesRadioButton.addActionListener(new java.awt.event.ActionListener() {
788  public void actionPerformed(java.awt.event.ActionEvent evt) {
789  filesRadioButtonActionPerformed(evt);
790  }
791  });
792 
793  typeButtonGroup.add(dirsRadioButton);
794  org.openide.awt.Mnemonics.setLocalizedText(dirsRadioButton, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.dirsRadioButton.text")); // NOI18N
795  dirsRadioButton.addActionListener(new java.awt.event.ActionListener() {
796  public void actionPerformed(java.awt.event.ActionEvent evt) {
797  dirsRadioButtonActionPerformed(evt);
798  }
799  });
800 
801  typeButtonGroup.add(allRadioButton);
802  org.openide.awt.Mnemonics.setLocalizedText(allRadioButton, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.allRadioButton.text")); // NOI18N
803  allRadioButton.addActionListener(new java.awt.event.ActionListener() {
804  public void actionPerformed(java.awt.event.ActionEvent evt) {
805  allRadioButtonActionPerformed(evt);
806  }
807  });
808 
809  daysIncludedTextField.setEnabled(false);
810  daysIncludedTextField.setMinimumSize(new java.awt.Dimension(60, 20));
811  daysIncludedTextField.setPreferredSize(new java.awt.Dimension(60, 20));
812 
813  org.openide.awt.Mnemonics.setLocalizedText(daysIncludedLabel, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.daysIncludedLabel.text")); // NOI18N
814 
815  org.openide.awt.Mnemonics.setLocalizedText(dateCheck, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.dateCheck.text")); // NOI18N
816  dateCheck.addActionListener(new java.awt.event.ActionListener() {
817  public void actionPerformed(java.awt.event.ActionEvent evt) {
818  dateCheckActionPerformed(evt);
819  }
820  });
821 
822  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
823  this.setLayout(layout);
824  layout.setHorizontalGroup(
825  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
826  .addGroup(layout.createSequentialGroup()
827  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
828  .addGroup(layout.createSequentialGroup()
829  .addGap(8, 8, 8)
830  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
831  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
832  .addComponent(ruleNameLabel)
833  .addGap(5, 5, 5)
834  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
835  .addComponent(mimeTypeComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
836  .addComponent(pathTextField)
837  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
838  .addComponent(equalitySymbolComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
839  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
840  .addComponent(fileSizeSpinner)
841  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
842  .addComponent(fileSizeComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
843  .addGroup(layout.createSequentialGroup()
844  .addComponent(pathRegexCheckBox)
845  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
846  .addComponent(pathSeparatorInfoLabel))
847  .addGroup(layout.createSequentialGroup()
848  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
849  .addComponent(ruleNameTextField)
850  .addGroup(layout.createSequentialGroup()
851  .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
852  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
853  .addComponent(daysIncludedLabel)
854  .addGap(0, 0, Short.MAX_VALUE)))
855  .addGap(1, 1, 1))
856  .addGroup(layout.createSequentialGroup()
857  .addComponent(fullNameRadioButton)
858  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
859  .addComponent(extensionRadioButton)
860  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
861  .addComponent(nameRegexCheckbox))))
862  .addComponent(jLabel5)
863  .addGroup(layout.createSequentialGroup()
864  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
865  .addComponent(nameCheck, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
866  .addComponent(jLabel1))
867  .addGap(16, 16, 16)
868  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
869  .addGroup(layout.createSequentialGroup()
870  .addComponent(filesRadioButton)
871  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
872  .addComponent(dirsRadioButton)
873  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
874  .addComponent(allRadioButton))
875  .addComponent(nameTextField)))))
876  .addGroup(layout.createSequentialGroup()
877  .addContainerGap()
878  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
879  .addComponent(pathCheck)
880  .addComponent(mimeCheck)
881  .addComponent(fileSizeCheck)
882  .addComponent(dateCheck))
883  .addGap(0, 0, Short.MAX_VALUE)))
884  .addContainerGap())
885  );
886  layout.setVerticalGroup(
887  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
888  .addGroup(layout.createSequentialGroup()
889  .addComponent(jLabel5)
890  .addGap(3, 3, 3)
891  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
892  .addGroup(layout.createSequentialGroup()
893  .addComponent(jLabel1)
894  .addGap(10, 10, 10)
895  .addComponent(nameCheck))
896  .addGroup(layout.createSequentialGroup()
897  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
898  .addComponent(filesRadioButton)
899  .addComponent(dirsRadioButton)
900  .addComponent(allRadioButton))
901  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
902  .addComponent(nameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)))
903  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
904  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
905  .addComponent(fullNameRadioButton)
906  .addComponent(extensionRadioButton)
907  .addComponent(nameRegexCheckbox))
908  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
909  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
910  .addComponent(pathTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
911  .addComponent(pathCheck))
912  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
913  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
914  .addComponent(pathRegexCheckBox)
915  .addComponent(pathSeparatorInfoLabel))
916  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
917  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
918  .addComponent(mimeTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
919  .addComponent(mimeCheck))
920  .addGap(11, 11, 11)
921  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
922  .addComponent(equalitySymbolComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
923  .addComponent(fileSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
924  .addComponent(fileSizeSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
925  .addComponent(fileSizeCheck))
926  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
927  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
928  .addComponent(daysIncludedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
929  .addComponent(daysIncludedLabel)
930  .addComponent(dateCheck))
931  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
932  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
933  .addComponent(ruleNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
934  .addComponent(ruleNameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
935  .addContainerGap())
936  );
937  }// </editor-fold>//GEN-END:initComponents
938 
939  private void nameCheckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nameCheckActionPerformed
940  if (!this.nameCheck.isSelected()) {
941  this.nameTextField.setEnabled(false);
942  this.nameTextField.setText("");
943  this.fullNameRadioButton.setEnabled(false);
944  this.extensionRadioButton.setEnabled(false);
945  this.nameRegexCheckbox.setEnabled(false);
946  } else {
947  this.nameTextField.setEnabled(true);
948  this.fullNameRadioButton.setEnabled(true);
949  if (this.filesRadioButton.isSelected()) {
950  this.extensionRadioButton.setEnabled(true);
951  }
952  this.nameRegexCheckbox.setEnabled(true);
953  }
954  this.setOkButton();
955  }//GEN-LAST:event_nameCheckActionPerformed
956 
957  private void pathCheckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pathCheckActionPerformed
958  if (!this.pathCheck.isSelected()) {
959  this.pathTextField.setEnabled(false);
960  this.pathTextField.setText("");
961  this.pathRegexCheckBox.setEnabled(false);
962  this.pathSeparatorInfoLabel.setEnabled(false);
963  } else {
964  this.pathTextField.setEnabled(true);
965  this.pathRegexCheckBox.setEnabled(true);
966  this.pathSeparatorInfoLabel.setEnabled(true);
967  }
968  this.setOkButton();
969  }//GEN-LAST:event_pathCheckActionPerformed
970 
971  private void filesRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_filesRadioButtonActionPerformed
972 
973  this.setComponentsForSearchType();
974  }//GEN-LAST:event_filesRadioButtonActionPerformed
975 
976  private void dirsRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dirsRadioButtonActionPerformed
977  this.setComponentsForSearchType();
978  }//GEN-LAST:event_dirsRadioButtonActionPerformed
979 
980  private void allRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_allRadioButtonActionPerformed
981  this.setComponentsForSearchType();
982  }//GEN-LAST:event_allRadioButtonActionPerformed
983 
984  private void dateCheckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dateCheckActionPerformed
985  if (!this.dateCheck.isSelected()) {
986  this.daysIncludedTextField.setEnabled(false);
987  this.daysIncludedLabel.setEnabled(false);
988  this.daysIncludedTextField.setText("");
989  } else {
990  this.daysIncludedTextField.setEnabled(true);
991  this.daysIncludedLabel.setEnabled(true);
992  }
993  this.setOkButton();
994  }//GEN-LAST:event_dateCheckActionPerformed
995 
996  private void fileSizeCheckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fileSizeCheckActionPerformed
997  if (!this.fileSizeCheck.isSelected()) {
998  this.fileSizeComboBox.setEnabled(false);
999  this.fileSizeSpinner.setEnabled(false);
1000  this.fileSizeSpinner.setValue(0);
1001  this.equalitySymbolComboBox.setEnabled(false);
1002  } else {
1003  this.fileSizeComboBox.setEnabled(true);
1004  this.fileSizeSpinner.setEnabled(true);
1005  this.equalitySymbolComboBox.setEnabled(true);
1006  }
1007  this.setOkButton();
1008  }//GEN-LAST:event_fileSizeCheckActionPerformed
1009 
1010  private void mimeCheckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mimeCheckActionPerformed
1011  if (!this.mimeCheck.isSelected()) {
1012  this.mimeTypeComboBox.setEnabled(false);
1013  this.mimeTypeComboBox.setSelectedIndex(0);
1014  } else {
1015  this.mimeTypeComboBox.setEnabled(true);
1016  }
1017  this.setOkButton();
1018  }//GEN-LAST:event_mimeCheckActionPerformed
1019 
1020  private void extensionRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_extensionRadioButtonActionPerformed
1021  updateNameTextFieldPrompt();
1022  }//GEN-LAST:event_extensionRadioButtonActionPerformed
1023 
1024  private void fullNameRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fullNameRadioButtonActionPerformed
1025  updateNameTextFieldPrompt();
1026  }//GEN-LAST:event_fullNameRadioButtonActionPerformed
1027 
1028  // Variables declaration - do not modify//GEN-BEGIN:variables
1029  private javax.swing.JRadioButton allRadioButton;
1030  private javax.swing.JCheckBox dateCheck;
1031  private javax.swing.JLabel daysIncludedLabel;
1032  private javax.swing.JTextField daysIncludedTextField;
1033  private javax.swing.JRadioButton dirsRadioButton;
1034  private javax.swing.JComboBox<String> equalitySymbolComboBox;
1035  private javax.swing.JRadioButton extensionRadioButton;
1036  private javax.swing.JCheckBox fileSizeCheck;
1037  private javax.swing.JComboBox<String> fileSizeComboBox;
1038  private javax.swing.JSpinner fileSizeSpinner;
1039  private javax.swing.JRadioButton filesRadioButton;
1040  private javax.swing.JRadioButton fullNameRadioButton;
1041  private javax.swing.JLabel jLabel1;
1042  private javax.swing.JLabel jLabel5;
1043  private javax.swing.JCheckBox mimeCheck;
1044  private javax.swing.JComboBox<String> mimeTypeComboBox;
1045  private javax.swing.ButtonGroup nameButtonGroup;
1046  private javax.swing.JCheckBox nameCheck;
1047  private javax.swing.JCheckBox nameRegexCheckbox;
1048  private javax.swing.JTextField nameTextField;
1049  private javax.swing.JCheckBox pathCheck;
1050  private javax.swing.JCheckBox pathRegexCheckBox;
1051  private javax.swing.JLabel pathSeparatorInfoLabel;
1052  private javax.swing.JTextField pathTextField;
1053  private javax.swing.JLabel ruleNameLabel;
1054  private javax.swing.JTextField ruleNameTextField;
1055  private javax.swing.ButtonGroup typeButtonGroup;
1056  // End of variables declaration//GEN-END:variables
1057 }

Copyright © 2012-2021 Basis Technology. Generated on: Tue Jan 19 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.