19 package org.sleuthkit.autopsy.filequery;
21 import com.google.common.eventbus.Subscribe;
22 import java.awt.Cursor;
23 import java.awt.event.ActionEvent;
24 import java.awt.event.ActionListener;
25 import java.util.ArrayList;
26 import java.util.Collections;
27 import java.util.List;
28 import java.util.logging.Level;
29 import java.util.stream.Collectors;
30 import javax.swing.DefaultListCellRenderer;
31 import javax.swing.DefaultListModel;
32 import javax.swing.JCheckBox;
33 import javax.swing.JList;
34 import javax.swing.SwingUtilities;
35 import javax.swing.event.ListSelectionEvent;
36 import javax.swing.event.ListSelectionListener;
37 import org.openide.util.NbBundle;
59 final class FileSearchPanel
extends javax.swing.JPanel implements ActionListener {
61 private static final long serialVersionUID = 1L;
62 private static final String[] DEFAULT_IGNORED_PATHS = {
"/Windows/",
"/Program Files/"};
63 private final static Logger logger = Logger.getLogger(FileSearchPanel.class.getName());
64 private FileType fileType = FileType.IMAGE;
65 private DefaultListModel<FileSearchFiltering.ParentSearchTerm> parentListModel;
66 private SearchWorker searchWorker = null;
71 @NbBundle.Messages({
"FileSearchPanel.dialogTitle.text=Test file search"})
74 for (GroupSortingAlgorithm groupSortAlgorithm : GroupSortingAlgorithm.values()) {
75 groupSortingComboBox.addItem(groupSortAlgorithm);
77 parentListModel = (DefaultListModel<FileSearchFiltering.ParentSearchTerm>) parentList.getModel();
78 for (String ignorePath : DEFAULT_IGNORED_PATHS) {
79 parentListModel.add(parentListModel.size(),
new ParentSearchTerm(ignorePath,
false,
false));
96 private void dataSourceFilterSettings(
boolean visible,
boolean enabled,
boolean selected,
int[] indicesSelected) {
97 dataSourceCheckbox.setVisible(visible);
98 dataSourceScrollPane.setVisible(visible);
99 dataSourceList.setVisible(visible);
100 dataSourceCheckbox.setEnabled(enabled);
101 dataSourceCheckbox.setSelected(selected);
102 if (dataSourceCheckbox.isEnabled() && dataSourceCheckbox.isSelected()) {
103 dataSourceScrollPane.setEnabled(
true);
104 dataSourceList.setEnabled(
true);
105 if (indicesSelected != null) {
106 dataSourceList.setSelectedIndices(indicesSelected);
109 dataSourceScrollPane.setEnabled(
false);
110 dataSourceList.setEnabled(
false);
127 private void sizeFilterSettings(
boolean visible,
boolean enabled,
boolean selected,
int[] indicesSelected) {
128 sizeCheckbox.setVisible(visible);
129 sizeScrollPane.setVisible(visible);
130 sizeList.setVisible(visible);
131 sizeCheckbox.setEnabled(enabled);
132 sizeCheckbox.setSelected(selected);
133 if (sizeCheckbox.isEnabled() && sizeCheckbox.isSelected()) {
134 sizeScrollPane.setEnabled(
true);
135 sizeList.setEnabled(
true);
136 if (indicesSelected != null) {
137 sizeList.setSelectedIndices(indicesSelected);
140 sizeScrollPane.setEnabled(
false);
141 sizeList.setEnabled(
false);
158 private void crFrequencyFilterSettings(
boolean visible,
boolean enabled,
boolean selected,
int[] indicesSelected) {
159 crFrequencyCheckbox.setVisible(visible);
160 crFrequencyScrollPane.setVisible(visible);
161 crFrequencyList.setVisible(visible);
162 crFrequencyCheckbox.setEnabled(enabled);
163 crFrequencyCheckbox.setSelected(selected);
164 if (crFrequencyCheckbox.isEnabled() && crFrequencyCheckbox.isSelected()) {
165 crFrequencyScrollPane.setEnabled(
true);
166 crFrequencyList.setEnabled(
true);
167 if (indicesSelected != null) {
168 crFrequencyList.setSelectedIndices(indicesSelected);
171 crFrequencyScrollPane.setEnabled(
false);
172 crFrequencyList.setEnabled(
false);
189 private void objectsFilterSettings(
boolean visible,
boolean enabled,
boolean selected,
int[] indicesSelected) {
190 objectsCheckbox.setVisible(visible);
191 objectsScrollPane.setVisible(visible);
192 objectsList.setVisible(visible);
193 boolean hasObjects = objectsList.getModel().getSize() > 0;
194 objectsCheckbox.setEnabled(enabled && hasObjects);
195 objectsCheckbox.setSelected(selected && hasObjects);
196 if (objectsCheckbox.isEnabled() && objectsCheckbox.isSelected()) {
197 objectsScrollPane.setEnabled(
true);
198 objectsList.setEnabled(
true);
199 if (indicesSelected != null) {
200 objectsList.setSelectedIndices(indicesSelected);
203 objectsScrollPane.setEnabled(
false);
204 objectsList.setEnabled(
false);
221 private void hashSetFilterSettings(
boolean visible,
boolean enabled,
boolean selected,
int[] indicesSelected) {
222 hashSetCheckbox.setVisible(visible);
223 hashSetScrollPane.setVisible(visible);
224 hashSetList.setVisible(visible);
225 boolean hasHashSets = hashSetList.getModel().getSize() > 0;
226 hashSetCheckbox.setEnabled(enabled && hasHashSets);
227 hashSetCheckbox.setSelected(selected && hasHashSets);
228 if (hashSetCheckbox.isEnabled() && hashSetCheckbox.isSelected()) {
229 hashSetScrollPane.setEnabled(
true);
230 hashSetList.setEnabled(
true);
231 if (indicesSelected != null) {
232 hashSetList.setSelectedIndices(indicesSelected);
235 hashSetScrollPane.setEnabled(
false);
236 hashSetList.setEnabled(
false);
253 private void interestingItemsFilterSettings(
boolean visible,
boolean enabled,
boolean selected,
int[] indicesSelected) {
254 interestingItemsCheckbox.setVisible(visible);
255 interestingItemsScrollPane.setVisible(visible);
256 interestingItemsList.setVisible(visible);
257 boolean hasInterestingItems = interestingItemsList.getModel().getSize() > 0;
258 interestingItemsCheckbox.setEnabled(enabled && hasInterestingItems);
259 interestingItemsCheckbox.setSelected(selected && hasInterestingItems);
260 if (interestingItemsCheckbox.isEnabled() && interestingItemsCheckbox.isSelected()) {
261 interestingItemsScrollPane.setEnabled(
true);
262 interestingItemsList.setEnabled(
true);
263 if (indicesSelected != null) {
264 interestingItemsList.setSelectedIndices(indicesSelected);
267 interestingItemsScrollPane.setEnabled(
false);
268 interestingItemsList.setEnabled(
false);
285 private void scoreFilterSettings(
boolean visible,
boolean enabled,
boolean selected,
int[] indicesSelected) {
286 scoreCheckbox.setVisible(visible);
287 scoreScrollPane.setVisible(visible);
288 scoreList.setVisible(visible);
289 scoreCheckbox.setEnabled(enabled);
290 scoreCheckbox.setSelected(selected);
291 if (scoreCheckbox.isEnabled() && scoreCheckbox.isSelected()) {
292 scoreScrollPane.setEnabled(
true);
293 scoreList.setEnabled(
true);
294 if (indicesSelected != null) {
295 scoreList.setSelectedIndices(indicesSelected);
298 scoreScrollPane.setEnabled(
false);
299 scoreList.setEnabled(
false);
316 private void parentFilterSettings(
boolean visible,
boolean enabled,
boolean selected,
int[] indicesSelected) {
317 parentCheckbox.setVisible(visible);
318 parentScrollPane.setVisible(visible);
319 parentList.setVisible(visible);
320 parentCheckbox.setEnabled(enabled);
321 parentCheckbox.setSelected(selected);
322 if (parentCheckbox.isEnabled() && parentCheckbox.isSelected()) {
323 parentScrollPane.setEnabled(
true);
324 includeRadioButton.setEnabled(
true);
325 excludeRadioButton.setEnabled(
true);
326 fullRadioButton.setEnabled(
true);
327 substringRadioButton.setEnabled(
true);
328 addButton.setEnabled(
true);
329 deleteButton.setEnabled(!parentListModel.isEmpty());
330 parentList.setEnabled(
true);
331 parentTextField.setEnabled(
true);
332 if (indicesSelected != null) {
333 parentList.setSelectedIndices(indicesSelected);
336 parentScrollPane.setEnabled(
false);
337 parentList.setEnabled(
false);
338 includeRadioButton.setEnabled(
false);
339 excludeRadioButton.setEnabled(
false);
340 fullRadioButton.setEnabled(
false);
341 substringRadioButton.setEnabled(
false);
342 addButton.setEnabled(
false);
343 deleteButton.setEnabled(
false);
344 parentTextField.setEnabled(
false);
361 private void tagsFilterSettings(
boolean visible,
boolean enabled,
boolean selected,
int[] indicesSelected) {
362 tagsCheckbox.setVisible(visible);
363 tagsScrollPane.setVisible(visible);
364 tagsList.setVisible(visible);
365 tagsCheckbox.setEnabled(enabled);
366 tagsCheckbox.setSelected(selected);
367 if (tagsCheckbox.isEnabled() && tagsCheckbox.isSelected()) {
368 tagsScrollPane.setEnabled(
true);
369 tagsList.setEnabled(
true);
370 if (indicesSelected != null) {
371 tagsList.setSelectedIndices(indicesSelected);
374 tagsScrollPane.setEnabled(
false);
375 tagsList.setEnabled(
false);
392 private void keywordFilterSettings(
boolean visible,
boolean enabled,
boolean selected,
int[] indicesSelected) {
393 keywordCheckbox.setVisible(visible);
394 keywordScrollPane.setVisible(visible);
395 keywordList.setVisible(visible);
396 keywordCheckbox.setEnabled(enabled);
397 keywordCheckbox.setSelected(selected);
398 if (keywordCheckbox.isEnabled() && keywordCheckbox.isSelected()) {
399 keywordScrollPane.setEnabled(
true);
400 keywordList.setEnabled(
true);
401 if (indicesSelected != null) {
402 keywordList.setSelectedIndices(indicesSelected);
405 keywordScrollPane.setEnabled(
false);
406 keywordList.setEnabled(
false);
417 private void exifFilterSettings(
boolean visible,
boolean enabled,
boolean selected) {
418 exifCheckbox.setVisible(visible);
419 exifCheckbox.setEnabled(enabled);
420 exifCheckbox.setSelected(selected);
430 private void knownFilesFilterSettings(
boolean visible,
boolean enabled,
boolean selected) {
431 knownFilesCheckbox.setVisible(visible);
432 knownFilesCheckbox.setEnabled(enabled);
433 knownFilesCheckbox.setSelected(selected);
443 private void notableFilterSettings(
boolean visible,
boolean enabled,
boolean selected) {
444 notableCheckbox.setVisible(visible);
445 notableCheckbox.setEnabled(enabled);
446 notableCheckbox.setSelected(selected);
459 private void imagesSelected(
boolean enabled,
boolean resetSelected) {
460 dataSourceFilterSettings(
true, enabled, !resetSelected && dataSourceCheckbox.isSelected(), null);
461 int[] selectedSizeIndices = {1, 2, 3, 4, 5};
462 sizeFilterSettings(
true, enabled, resetSelected || sizeCheckbox.isSelected(), resetSelected ==
true ? selectedSizeIndices : null);
463 int[] selectedFrequencyIndices;
464 if (!EamDb.isEnabled()) {
465 selectedFrequencyIndices =
new int[]{0};
467 selectedFrequencyIndices =
new int[]{1, 2, 3, 4, 5, 6, 7};
469 crFrequencyFilterSettings(
true, enabled, resetSelected || crFrequencyCheckbox.isSelected(), resetSelected ==
true ? selectedFrequencyIndices : null);
470 exifFilterSettings(
true, enabled, !resetSelected && exifCheckbox.isSelected());
471 objectsFilterSettings(
true, enabled, !resetSelected && objectsCheckbox.isSelected(), null);
472 hashSetFilterSettings(
true, enabled, !resetSelected && hashSetCheckbox.isSelected(), null);
473 interestingItemsFilterSettings(
true, enabled, !resetSelected && interestingItemsCheckbox.isSelected(), null);
474 parentFilterSettings(
true, enabled, !resetSelected && parentCheckbox.isSelected(), null);
475 scoreFilterSettings(
false,
false,
false, null);
476 tagsFilterSettings(
false,
false,
false, null);
477 keywordFilterSettings(
false,
false,
false, null);
478 knownFilesFilterSettings(
false,
false,
false);
479 notableFilterSettings(
false,
false,
false);
492 private void videosSelected(
boolean enabled,
boolean resetSelected) {
493 dataSourceFilterSettings(
true, enabled, !resetSelected && dataSourceCheckbox.isSelected(), null);
494 sizeFilterSettings(
true, enabled, !resetSelected && sizeCheckbox.isSelected(), null);
495 int[] selectedFrequencyIndices;
496 if (!EamDb.isEnabled()) {
497 selectedFrequencyIndices =
new int[]{0};
499 selectedFrequencyIndices =
new int[]{1, 2, 3, 4, 5, 6, 7};
501 crFrequencyFilterSettings(
true, enabled, resetSelected || crFrequencyCheckbox.isSelected(), resetSelected ==
true ? selectedFrequencyIndices : null);
502 exifFilterSettings(
true, enabled, !resetSelected && exifCheckbox.isSelected());
503 objectsFilterSettings(
true, enabled, !resetSelected && objectsCheckbox.isSelected(), null);
504 hashSetFilterSettings(
true, enabled, !resetSelected && hashSetCheckbox.isSelected(), null);
505 interestingItemsFilterSettings(
true, enabled, !resetSelected && interestingItemsCheckbox.isSelected(), null);
506 parentFilterSettings(
true, enabled, !resetSelected && parentCheckbox.isSelected(), null);
507 scoreFilterSettings(
false,
false,
false, null);
508 tagsFilterSettings(
false,
false,
false, null);
509 keywordFilterSettings(
false,
false,
false, null);
510 knownFilesFilterSettings(
false,
false,
false);
511 notableFilterSettings(
false,
false,
false);
519 void setSelectedType(FileType type) {
522 if (fileType == FileType.IMAGE) {
523 imagesSelected(
true,
true);
524 }
else if (fileType == FileType.VIDEO) {
525 videosSelected(
true,
true);
530 FileType getSelectedType() {
539 searchButton.setEnabled(
false);
542 setUpDataSourceFilter();
543 setUpFrequencyFilter();
546 setUpParentPathFilter();
548 setUpInterestingItemsFilter();
553 groupByCombobox.removeAllItems();
555 for (FileSearch.GroupingAttributeType type : FileSearch.GroupingAttributeType.getOptionsForGrouping()) {
556 if ((type != GroupingAttributeType.FREQUENCY || EamDb.isEnabled())
557 && (type != GroupingAttributeType.OBJECT_DETECTED || objectsList.getModel().getSize() > 0)
558 && (type != GroupingAttributeType.INTERESTING_ITEM_SET || interestingItemsList.getModel().getSize() > 0)
559 && (type != GroupingAttributeType.HASH_LIST_NAME || hashSetList.getModel().getSize() > 0)) {
560 groupByCombobox.addItem(type);
564 orderByCombobox.removeAllItems();
566 for (FileSorter.SortingMethod method : FileSorter.SortingMethod.getOptionsForOrdering()) {
567 if (method != SortingMethod.BY_FREQUENCY || EamDb.isEnabled()) {
568 orderByCombobox.addItem(method);
572 groupSortingComboBox.setSelectedIndex(0);
573 setSelectedType(FileType.IMAGE);
584 private void addListeners(JCheckBox checkBox, JList<?> list) {
585 if (checkBox != null) {
586 checkBox.addActionListener(
this);
589 list.addListSelectionListener(
new ListSelectionListener() {
591 public void valueChanged(ListSelectionEvent evt) {
592 if (!evt.getValueIsAdjusting()) {
603 private void setUpDataSourceFilter() {
606 DefaultListModel<DataSourceItem> dsListModel = (DefaultListModel<DataSourceItem>) dataSourceList.getModel();
607 dsListModel.removeAllElements();
608 for (DataSource ds : Case.getCurrentCase().getSleuthkitCase().getDataSources()) {
609 dsListModel.add(count,
new DataSourceItem(ds));
611 }
catch (TskCoreException ex) {
612 logger.log(Level.SEVERE,
"Error loading data sources", ex);
613 dataSourceCheckbox.setEnabled(
false);
614 dataSourceList.setEnabled(
false);
616 addListeners(dataSourceCheckbox, dataSourceList);
622 private void setUpFrequencyFilter() {
624 DefaultListModel<FileSearchData.Frequency> frequencyListModel = (DefaultListModel<FileSearchData.Frequency>) crFrequencyList.getModel();
625 frequencyListModel.removeAllElements();
626 if (!EamDb.isEnabled()) {
627 for (FileSearchData.Frequency freq : FileSearchData.Frequency.getOptionsForFilteringWithoutCr()) {
628 frequencyListModel.add(count, freq);
631 for (FileSearchData.Frequency freq : FileSearchData.Frequency.getOptionsForFilteringWithCr()) {
632 frequencyListModel.add(count, freq);
635 addListeners(crFrequencyCheckbox, crFrequencyList);
641 private void setUpSizeFilter() {
643 DefaultListModel<FileSearchData.FileSize> sizeListModel = (DefaultListModel<FileSearchData.FileSize>) sizeList.getModel();
644 sizeListModel.removeAllElements();
645 if (null == fileType) {
646 for (FileSearchData.FileSize size : FileSearchData.FileSize.values()) {
647 sizeListModel.add(count, size);
650 List<FileSearchData.FileSize> sizes;
653 sizes = FileSearchData.FileSize.getOptionsForVideos();
656 sizes = FileSearchData.FileSize.getOptionsForImages();
659 sizes =
new ArrayList<>();
662 for (FileSearchData.FileSize size : sizes) {
663 sizeListModel.add(count, size);
666 addListeners(sizeCheckbox, sizeList);
672 private void setUpKWFilter() {
675 DefaultListModel<String> kwListModel = (DefaultListModel<String>) keywordList.getModel();
676 kwListModel.removeAllElements();
677 List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT,
678 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME);
679 for (String name : setNames) {
680 kwListModel.add(count, name);
682 }
catch (TskCoreException ex) {
683 logger.log(Level.SEVERE,
"Error loading keyword list names", ex);
684 keywordCheckbox.setEnabled(
false);
685 keywordList.setEnabled(
false);
687 addListeners(keywordCheckbox, keywordList);
693 private void setUpHashFilter() {
696 DefaultListModel<String> hashListModel = (DefaultListModel<String>) hashSetList.getModel();
697 hashListModel.removeAllElements();
698 List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT,
699 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME);
700 for (String name : setNames) {
701 hashListModel.add(count, name);
704 }
catch (TskCoreException ex) {
705 logger.log(Level.SEVERE,
"Error loading hash set names", ex);
706 hashSetCheckbox.setEnabled(
false);
707 hashSetList.setEnabled(
false);
709 addListeners(hashSetCheckbox, hashSetList);
715 private void setUpInterestingItemsFilter() {
718 DefaultListModel<String> intListModel = (DefaultListModel<String>) interestingItemsList.getModel();
719 intListModel.removeAllElements();
720 List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT,
721 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME);
722 for (String name : setNames) {
723 intListModel.add(count, name);
726 }
catch (TskCoreException ex) {
727 logger.log(Level.SEVERE,
"Error loading interesting file set names", ex);
728 interestingItemsCheckbox.setEnabled(
false);
729 interestingItemsList.setEnabled(
false);
731 addListeners(interestingItemsCheckbox, interestingItemsList);
737 private void setUpTagsFilter() {
740 DefaultListModel<TagName> tagsListModel = (DefaultListModel<TagName>) tagsList.getModel();
741 tagsListModel.removeAllElements();
742 List<TagName> tagNames = Case.getCurrentCase().getSleuthkitCase().getTagNamesInUse();
743 for (TagName name : tagNames) {
744 tagsListModel.add(count, name);
747 tagsList.setCellRenderer(
new TagsListCellRenderer());
748 }
catch (TskCoreException ex) {
749 logger.log(Level.SEVERE,
"Error loading tag names", ex);
750 tagsCheckbox.setEnabled(
false);
751 tagsList.setEnabled(
false);
753 addListeners(tagsCheckbox, tagsList);
761 private static final long serialVersionUID = 1L;
769 boolean cellHasFocus) {
770 Object newValue = value;
771 if (value instanceof TagName) {
772 newValue = ((TagName) value).getDisplayName();
774 super.getListCellRendererComponent(list, newValue, index, isSelected, cellHasFocus);
782 private void setUpObjectFilter() {
785 DefaultListModel<String> objListModel = (DefaultListModel<String>) objectsList.getModel();
786 objListModel.removeAllElements();
787 List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_OBJECT_DETECTED, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DESCRIPTION);
788 for (String name : setNames) {
789 objListModel.add(count, name);
792 }
catch (TskCoreException ex) {
793 logger.log(Level.SEVERE,
"Error loading object detected set names", ex);
794 objectsCheckbox.setEnabled(
false);
795 objectsList.setEnabled(
false);
797 addListeners(objectsCheckbox, objectsList);
803 private void setUpScoreFilter() {
806 DefaultListModel<Score> scoreListModel = (DefaultListModel<Score>) scoreList.getModel();
807 scoreListModel.removeAllElements();
808 for (Score score : Score.getOptionsForFiltering()) {
809 scoreListModel.add(count, score);
811 addListeners(scoreCheckbox, scoreList);
826 private List<String> getSetNames(BlackboardArtifact.ARTIFACT_TYPE artifactType, BlackboardAttribute.ATTRIBUTE_TYPE setNameAttribute) throws TskCoreException {
827 List<BlackboardArtifact> arts = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifacts(artifactType);
828 List<String> setNames =
new ArrayList<>();
829 for (BlackboardArtifact art : arts) {
830 for (BlackboardAttribute attr : art.getAttributes()) {
831 if (attr.getAttributeType().getTypeID() == setNameAttribute.getTypeID()) {
832 String setName = attr.getValueString();
833 if (!setNames.contains(setName)) {
834 setNames.add(setName);
839 Collections.sort(setNames);
846 private void setUpParentPathFilter() {
847 fullRadioButton.setSelected(
true);
848 includeRadioButton.setSelected(
true);
849 parentListModel = (DefaultListModel<FileSearchFiltering.ParentSearchTerm>) parentList.getModel();
850 addListeners(parentCheckbox, parentList);
858 List<FileSearchFiltering.FileFilter> getFilters() {
859 List<FileSearchFiltering.FileFilter> filters =
new ArrayList<>();
860 filters.add(
new FileSearchFiltering.FileTypeFilter(fileType));
861 if (parentCheckbox.isSelected()) {
863 filters.add(
new FileSearchFiltering.ParentFilter(getParentPaths()));
866 if (dataSourceCheckbox.isSelected()) {
867 List<DataSource> dataSources = dataSourceList.getSelectedValuesList().stream().map(t -> t.getDataSource()).collect(Collectors.toList());
868 filters.add(
new FileSearchFiltering.DataSourceFilter(dataSources));
871 if (crFrequencyCheckbox.isSelected()) {
872 filters.add(
new FileSearchFiltering.FrequencyFilter(crFrequencyList.getSelectedValuesList()));
875 if (sizeCheckbox.isSelected()) {
876 filters.add(
new FileSearchFiltering.SizeFilter(sizeList.getSelectedValuesList()));
879 if (keywordCheckbox.isSelected()) {
880 filters.add(
new FileSearchFiltering.KeywordListFilter(keywordList.getSelectedValuesList()));
883 if (hashSetCheckbox.isSelected()) {
884 filters.add(
new FileSearchFiltering.HashSetFilter(hashSetList.getSelectedValuesList()));
887 if (interestingItemsCheckbox.isSelected()) {
888 filters.add(
new FileSearchFiltering.InterestingFileSetFilter(interestingItemsList.getSelectedValuesList()));
891 if (objectsCheckbox.isSelected()) {
892 filters.add(
new FileSearchFiltering.ObjectDetectionFilter(objectsList.getSelectedValuesList()));
895 if (tagsCheckbox.isSelected()) {
896 filters.add(
new FileSearchFiltering.TagsFilter(tagsList.getSelectedValuesList()));
899 if (exifCheckbox.isSelected()) {
900 filters.add(
new FileSearchFiltering.ExifFilter());
903 if (notableCheckbox.isSelected()) {
904 filters.add(
new FileSearchFiltering.NotableFilter());
907 if (knownFilesCheckbox.isSelected()) {
908 filters.add(
new FileSearchFiltering.KnownFilter());
911 if (scoreCheckbox.isSelected()) {
912 filters.add(
new FileSearchFiltering.ScoreFilter(scoreList.getSelectedValuesList()));
923 private List<FileSearchFiltering.ParentSearchTerm> getParentPaths() {
924 List<FileSearchFiltering.ParentSearchTerm> results =
new ArrayList<>();
925 for (
int i = 0; i < parentListModel.getSize(); i++) {
926 results.add(parentListModel.get(i));
936 FileSearch.AttributeType getGroupingAttribute() {
937 return groupByCombobox.getItemAt(groupByCombobox.getSelectedIndex()).getAttributeType();
945 FileGroup.GroupSortingAlgorithm getGroupSortingMethod() {
946 return groupSortingComboBox.getItemAt(groupSortingComboBox.getSelectedIndex());
955 FileSorter.SortingMethod getFileSortingMethod() {
956 return (FileSorter.SortingMethod) orderByCombobox.getSelectedItem();
960 public void actionPerformed(ActionEvent e) {
970 private final DataSource
ds;
976 DataSource getDataSource() {
982 return ds.getName() +
" (ID: " + ds.getId() +
")";
990 private void validateFields() {
992 if (fileType == null) {
993 setInvalid(
"At least one file type must be selected");
997 if (dataSourceCheckbox.isSelected() && dataSourceList.getSelectedValuesList().isEmpty()) {
998 setInvalid(
"At least one data source must be selected");
1001 if (crFrequencyCheckbox.isSelected() && crFrequencyList.getSelectedValuesList().isEmpty()) {
1002 setInvalid(
"At least one CR frequency must be selected");
1005 if (sizeCheckbox.isSelected() && sizeList.getSelectedValuesList().isEmpty()) {
1006 setInvalid(
"At least one size must be selected");
1009 if (keywordCheckbox.isSelected() && keywordList.getSelectedValuesList().isEmpty()) {
1010 setInvalid(
"At least one keyword list name must be selected");
1015 if (parentCheckbox.isSelected() && getParentPaths().isEmpty()) {
1016 setInvalid(
"At least one parent path must be entered");
1020 if (hashSetCheckbox.isSelected() && hashSetList.getSelectedValuesList().isEmpty()) {
1021 setInvalid(
"At least one hash set name must be selected");
1025 if (interestingItemsCheckbox.isSelected() && interestingItemsList.getSelectedValuesList().isEmpty()) {
1026 setInvalid(
"At least one interesting file set name must be selected");
1030 if (objectsCheckbox.isSelected() && objectsList.getSelectedValuesList().isEmpty()) {
1031 setInvalid(
"At least one object type name must be selected");
1035 if (tagsCheckbox.isSelected() && tagsList.getSelectedValuesList().isEmpty()) {
1036 setInvalid(
"At least one tag name must be selected");
1040 if (scoreCheckbox.isSelected() && scoreList.getSelectedValuesList().isEmpty()) {
1041 setInvalid(
"At least one score must be selected");
1050 private void setValid() {
1051 errorLabel.setText(
"");
1052 searchButton.setEnabled(
true);
1061 private void setInvalid(String error) {
1062 errorLabel.setText(error);
1063 searchButton.setEnabled(
false);
1071 @SuppressWarnings(
"unchecked")
1073 private
void initComponents() {
1074 java.awt.GridBagConstraints gridBagConstraints;
1076 javax.swing.ButtonGroup parentPathButtonGroup =
new javax.swing.ButtonGroup();
1077 javax.swing.ButtonGroup parentIncludeButtonGroup =
new javax.swing.ButtonGroup();
1078 javax.swing.JScrollPane filtersScrollPane =
new javax.swing.JScrollPane();
1079 javax.swing.JPanel filtersPanel =
new javax.swing.JPanel();
1080 sizeCheckbox =
new javax.swing.JCheckBox();
1081 dataSourceCheckbox =
new javax.swing.JCheckBox();
1082 crFrequencyCheckbox =
new javax.swing.JCheckBox();
1083 keywordCheckbox =
new javax.swing.JCheckBox();
1084 parentCheckbox =
new javax.swing.JCheckBox();
1085 dataSourceScrollPane =
new javax.swing.JScrollPane();
1086 dataSourceList =
new javax.swing.JList<>();
1087 substringRadioButton =
new javax.swing.JRadioButton();
1088 addButton =
new javax.swing.JButton();
1089 deleteButton =
new javax.swing.JButton();
1090 sizeScrollPane =
new javax.swing.JScrollPane();
1091 sizeList =
new javax.swing.JList<>();
1092 crFrequencyScrollPane =
new javax.swing.JScrollPane();
1093 crFrequencyList =
new javax.swing.JList<>();
1094 keywordScrollPane =
new javax.swing.JScrollPane();
1095 keywordList =
new javax.swing.JList<>();
1096 javax.swing.JLabel parentLabel =
new javax.swing.JLabel();
1097 parentScrollPane =
new javax.swing.JScrollPane();
1098 parentList =
new javax.swing.JList<>();
1099 hashSetCheckbox =
new javax.swing.JCheckBox();
1100 hashSetScrollPane =
new javax.swing.JScrollPane();
1101 hashSetList =
new javax.swing.JList<>();
1102 objectsCheckbox =
new javax.swing.JCheckBox();
1103 tagsCheckbox =
new javax.swing.JCheckBox();
1104 interestingItemsCheckbox =
new javax.swing.JCheckBox();
1105 scoreCheckbox =
new javax.swing.JCheckBox();
1106 exifCheckbox =
new javax.swing.JCheckBox();
1107 notableCheckbox =
new javax.swing.JCheckBox();
1108 objectsScrollPane =
new javax.swing.JScrollPane();
1109 objectsList =
new javax.swing.JList<>();
1110 tagsScrollPane =
new javax.swing.JScrollPane();
1111 tagsList =
new javax.swing.JList<>();
1112 interestingItemsScrollPane =
new javax.swing.JScrollPane();
1113 interestingItemsList =
new javax.swing.JList<>();
1114 scoreScrollPane =
new javax.swing.JScrollPane();
1115 scoreList =
new javax.swing.JList<>();
1116 excludeRadioButton =
new javax.swing.JRadioButton();
1117 knownFilesCheckbox =
new javax.swing.JCheckBox();
1118 javax.swing.JPanel fullRadioPanel =
new javax.swing.JPanel();
1119 fullRadioButton =
new javax.swing.JRadioButton();
1120 javax.swing.JPanel includeRadioPanel =
new javax.swing.JPanel();
1121 javax.swing.Box.Filler filler2 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 0),
new java.awt.Dimension(0, 0),
new java.awt.Dimension(32767, 32767));
1122 includeRadioButton =
new javax.swing.JRadioButton();
1123 javax.swing.JPanel parentTextPanel =
new javax.swing.JPanel();
1124 parentTextField =
new javax.swing.JTextField();
1125 searchButton =
new javax.swing.JButton();
1126 javax.swing.JPanel sortingPanel =
new javax.swing.JPanel();
1127 groupByCombobox =
new javax.swing.JComboBox<>();
1128 orderByCombobox =
new javax.swing.JComboBox<>();
1129 javax.swing.JLabel orderGroupsByLabel =
new javax.swing.JLabel();
1130 javax.swing.JLabel orderByLabel =
new javax.swing.JLabel();
1131 javax.swing.JLabel groupByLabel =
new javax.swing.JLabel();
1132 groupSortingComboBox =
new javax.swing.JComboBox<>();
1133 errorLabel =
new javax.swing.JLabel();
1134 cancelButton =
new javax.swing.JButton();
1135 javax.swing.JLabel stepTwoLabel =
new javax.swing.JLabel();
1136 javax.swing.JLabel stepThreeLabel =
new javax.swing.JLabel();
1138 setMinimumSize(
new java.awt.Dimension(10, 0));
1139 setPreferredSize(
new java.awt.Dimension(321, 400));
1141 filtersScrollPane.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.filtersScrollPane.border.title")));
1142 filtersScrollPane.setPreferredSize(
new java.awt.Dimension(309, 400));
1144 filtersPanel.setMinimumSize(
new java.awt.Dimension(280, 500));
1145 filtersPanel.setPreferredSize(
new java.awt.Dimension(280, 540));
1146 filtersPanel.setLayout(
new java.awt.GridBagLayout());
1148 org.openide.awt.Mnemonics.setLocalizedText(sizeCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.sizeCheckbox.text"));
1149 sizeCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1150 public void actionPerformed(java.awt.event.ActionEvent evt) {
1151 sizeCheckboxActionPerformed(evt);
1154 gridBagConstraints =
new java.awt.GridBagConstraints();
1155 gridBagConstraints.gridx = 0;
1156 gridBagConstraints.gridy = 0;
1157 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1158 gridBagConstraints.insets =
new java.awt.Insets(6, 6, 4, 0);
1159 filtersPanel.add(sizeCheckbox, gridBagConstraints);
1161 org.openide.awt.Mnemonics.setLocalizedText(dataSourceCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.dataSourceCheckbox.text"));
1162 dataSourceCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1163 public void actionPerformed(java.awt.event.ActionEvent evt) {
1164 dataSourceCheckboxActionPerformed(evt);
1167 gridBagConstraints =
new java.awt.GridBagConstraints();
1168 gridBagConstraints.gridx = 0;
1169 gridBagConstraints.gridy = 1;
1170 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1171 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1172 filtersPanel.add(dataSourceCheckbox, gridBagConstraints);
1174 org.openide.awt.Mnemonics.setLocalizedText(crFrequencyCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.crFrequencyCheckbox.text"));
1175 crFrequencyCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1176 public void actionPerformed(java.awt.event.ActionEvent evt) {
1177 crFrequencyCheckboxActionPerformed(evt);
1180 gridBagConstraints =
new java.awt.GridBagConstraints();
1181 gridBagConstraints.gridx = 0;
1182 gridBagConstraints.gridy = 2;
1183 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1184 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1185 filtersPanel.add(crFrequencyCheckbox, gridBagConstraints);
1187 org.openide.awt.Mnemonics.setLocalizedText(keywordCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.keywordCheckbox.text"));
1188 keywordCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1189 public void actionPerformed(java.awt.event.ActionEvent evt) {
1190 keywordCheckboxActionPerformed(evt);
1193 gridBagConstraints =
new java.awt.GridBagConstraints();
1194 gridBagConstraints.gridx = 0;
1195 gridBagConstraints.gridy = 12;
1196 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1197 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1198 filtersPanel.add(keywordCheckbox, gridBagConstraints);
1200 org.openide.awt.Mnemonics.setLocalizedText(parentCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.parentCheckbox.text"));
1201 parentCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1202 public void actionPerformed(java.awt.event.ActionEvent evt) {
1203 parentCheckboxActionPerformed(evt);
1206 gridBagConstraints =
new java.awt.GridBagConstraints();
1207 gridBagConstraints.gridx = 0;
1208 gridBagConstraints.gridy = 7;
1209 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1210 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1211 filtersPanel.add(parentCheckbox, gridBagConstraints);
1213 dataSourceList.setModel(
new DefaultListModel<DataSourceItem>());
1214 dataSourceList.setEnabled(
false);
1215 dataSourceList.setVisibleRowCount(5);
1216 dataSourceScrollPane.setViewportView(dataSourceList);
1218 gridBagConstraints =
new java.awt.GridBagConstraints();
1219 gridBagConstraints.gridx = 1;
1220 gridBagConstraints.gridy = 1;
1221 gridBagConstraints.gridwidth = 3;
1222 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1223 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1224 gridBagConstraints.weightx = 0.5;
1225 gridBagConstraints.weighty = 0.1;
1226 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1227 filtersPanel.add(dataSourceScrollPane, gridBagConstraints);
1229 parentPathButtonGroup.add(substringRadioButton);
1230 org.openide.awt.Mnemonics.setLocalizedText(substringRadioButton,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.substringRadioButton.text"));
1231 substringRadioButton.setEnabled(
false);
1232 gridBagConstraints =
new java.awt.GridBagConstraints();
1233 gridBagConstraints.gridx = 2;
1234 gridBagConstraints.gridy = 9;
1235 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1236 gridBagConstraints.weightx = 0.1;
1237 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 0);
1238 filtersPanel.add(substringRadioButton, gridBagConstraints);
1240 org.openide.awt.Mnemonics.setLocalizedText(addButton,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.addButton.text"));
1241 addButton.setEnabled(
false);
1242 addButton.setMaximumSize(
new java.awt.Dimension(70, 23));
1243 addButton.setMinimumSize(
new java.awt.Dimension(70, 23));
1244 addButton.setPreferredSize(
new java.awt.Dimension(70, 23));
1245 addButton.addActionListener(
new java.awt.event.ActionListener() {
1246 public void actionPerformed(java.awt.event.ActionEvent evt) {
1247 addButtonActionPerformed(evt);
1250 gridBagConstraints =
new java.awt.GridBagConstraints();
1251 gridBagConstraints.gridx = 3;
1252 gridBagConstraints.gridy = 11;
1253 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_END;
1254 gridBagConstraints.insets =
new java.awt.Insets(0, 10, 6, 6);
1255 filtersPanel.add(addButton, gridBagConstraints);
1257 org.openide.awt.Mnemonics.setLocalizedText(deleteButton,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.deleteButton.text"));
1258 deleteButton.setEnabled(
false);
1259 deleteButton.setMaximumSize(
new java.awt.Dimension(70, 23));
1260 deleteButton.setMinimumSize(
new java.awt.Dimension(70, 23));
1261 deleteButton.setPreferredSize(
new java.awt.Dimension(70, 23));
1262 deleteButton.addActionListener(
new java.awt.event.ActionListener() {
1263 public void actionPerformed(java.awt.event.ActionEvent evt) {
1264 deleteButtonActionPerformed(evt);
1267 gridBagConstraints =
new java.awt.GridBagConstraints();
1268 gridBagConstraints.gridx = 3;
1269 gridBagConstraints.gridy = 10;
1270 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_END;
1271 gridBagConstraints.insets =
new java.awt.Insets(0, 10, 4, 6);
1272 filtersPanel.add(deleteButton, gridBagConstraints);
1274 sizeList.setModel(
new DefaultListModel<FileSize>());
1275 sizeList.setEnabled(
false);
1276 sizeList.setVisibleRowCount(5);
1277 sizeScrollPane.setViewportView(sizeList);
1279 gridBagConstraints =
new java.awt.GridBagConstraints();
1280 gridBagConstraints.gridx = 1;
1281 gridBagConstraints.gridy = 0;
1282 gridBagConstraints.gridwidth = 3;
1283 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1284 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1285 gridBagConstraints.weightx = 0.5;
1286 gridBagConstraints.weighty = 0.1;
1287 gridBagConstraints.insets =
new java.awt.Insets(6, 4, 4, 6);
1288 filtersPanel.add(sizeScrollPane, gridBagConstraints);
1290 crFrequencyList.setModel(
new DefaultListModel<Frequency>());
1291 crFrequencyList.setEnabled(
false);
1292 crFrequencyList.setVisibleRowCount(5);
1293 crFrequencyScrollPane.setViewportView(crFrequencyList);
1295 gridBagConstraints =
new java.awt.GridBagConstraints();
1296 gridBagConstraints.gridx = 1;
1297 gridBagConstraints.gridy = 2;
1298 gridBagConstraints.gridwidth = 3;
1299 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1300 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1301 gridBagConstraints.weightx = 0.5;
1302 gridBagConstraints.weighty = 0.1;
1303 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1304 filtersPanel.add(crFrequencyScrollPane, gridBagConstraints);
1306 keywordList.setModel(
new DefaultListModel<String>());
1307 keywordList.setEnabled(
false);
1308 keywordList.setVisibleRowCount(3);
1309 keywordScrollPane.setViewportView(keywordList);
1311 gridBagConstraints =
new java.awt.GridBagConstraints();
1312 gridBagConstraints.gridx = 1;
1313 gridBagConstraints.gridy = 12;
1314 gridBagConstraints.gridwidth = 3;
1315 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1316 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1317 gridBagConstraints.weightx = 0.5;
1318 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1319 filtersPanel.add(keywordScrollPane, gridBagConstraints);
1321 org.openide.awt.Mnemonics.setLocalizedText(parentLabel,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.parentLabel.text"));
1322 gridBagConstraints =
new java.awt.GridBagConstraints();
1323 gridBagConstraints.gridx = 0;
1324 gridBagConstraints.gridy = 8;
1325 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1326 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1327 filtersPanel.add(parentLabel, gridBagConstraints);
1329 parentList.setModel(
new DefaultListModel<ParentSearchTerm>());
1330 parentList.setEnabled(
false);
1331 parentList.setMaximumSize(null);
1332 parentList.setMinimumSize(
new java.awt.Dimension(0, 30));
1333 parentList.setPreferredSize(
new java.awt.Dimension(0, 30));
1334 parentList.setVisibleRowCount(4);
1335 parentList.addListSelectionListener(
new javax.swing.event.ListSelectionListener() {
1336 public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
1337 parentListValueChanged(evt);
1340 parentScrollPane.setViewportView(parentList);
1342 gridBagConstraints =
new java.awt.GridBagConstraints();
1343 gridBagConstraints.gridx = 1;
1344 gridBagConstraints.gridy = 7;
1345 gridBagConstraints.gridwidth = 3;
1346 gridBagConstraints.gridheight = 2;
1347 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1348 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1349 gridBagConstraints.weightx = 0.5;
1350 gridBagConstraints.weighty = 0.05;
1351 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1352 filtersPanel.add(parentScrollPane, gridBagConstraints);
1354 org.openide.awt.Mnemonics.setLocalizedText(hashSetCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.hashSetCheckbox.text"));
1355 hashSetCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1356 public void actionPerformed(java.awt.event.ActionEvent evt) {
1357 hashSetCheckboxActionPerformed(evt);
1360 gridBagConstraints =
new java.awt.GridBagConstraints();
1361 gridBagConstraints.gridx = 0;
1362 gridBagConstraints.gridy = 4;
1363 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1364 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1365 filtersPanel.add(hashSetCheckbox, gridBagConstraints);
1367 hashSetList.setModel(
new DefaultListModel<String>());
1368 hashSetList.setEnabled(
false);
1369 hashSetList.setMinimumSize(
new java.awt.Dimension(0, 30));
1370 hashSetList.setPreferredSize(
new java.awt.Dimension(0, 30));
1371 hashSetList.setVisibleRowCount(3);
1372 hashSetScrollPane.setViewportView(hashSetList);
1374 gridBagConstraints =
new java.awt.GridBagConstraints();
1375 gridBagConstraints.gridx = 1;
1376 gridBagConstraints.gridy = 4;
1377 gridBagConstraints.gridwidth = 3;
1378 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1379 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1380 gridBagConstraints.weightx = 0.5;
1381 gridBagConstraints.weighty = 0.05;
1382 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1383 filtersPanel.add(hashSetScrollPane, gridBagConstraints);
1385 org.openide.awt.Mnemonics.setLocalizedText(objectsCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.objectsCheckbox.text"));
1386 objectsCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1387 public void actionPerformed(java.awt.event.ActionEvent evt) {
1388 objectsCheckboxActionPerformed(evt);
1391 gridBagConstraints =
new java.awt.GridBagConstraints();
1392 gridBagConstraints.gridx = 0;
1393 gridBagConstraints.gridy = 6;
1394 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1395 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1396 filtersPanel.add(objectsCheckbox, gridBagConstraints);
1398 org.openide.awt.Mnemonics.setLocalizedText(tagsCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.tagsCheckbox.text"));
1399 tagsCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1400 public void actionPerformed(java.awt.event.ActionEvent evt) {
1401 tagsCheckboxActionPerformed(evt);
1404 gridBagConstraints =
new java.awt.GridBagConstraints();
1405 gridBagConstraints.gridx = 0;
1406 gridBagConstraints.gridy = 13;
1407 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1408 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1409 filtersPanel.add(tagsCheckbox, gridBagConstraints);
1411 org.openide.awt.Mnemonics.setLocalizedText(interestingItemsCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.interestingItemsCheckbox.text"));
1412 interestingItemsCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1413 public void actionPerformed(java.awt.event.ActionEvent evt) {
1414 interestingItemsCheckboxActionPerformed(evt);
1417 gridBagConstraints =
new java.awt.GridBagConstraints();
1418 gridBagConstraints.gridx = 0;
1419 gridBagConstraints.gridy = 5;
1420 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1421 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1422 filtersPanel.add(interestingItemsCheckbox, gridBagConstraints);
1424 org.openide.awt.Mnemonics.setLocalizedText(scoreCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.scoreCheckbox.text"));
1425 scoreCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1426 public void actionPerformed(java.awt.event.ActionEvent evt) {
1427 scoreCheckboxActionPerformed(evt);
1430 gridBagConstraints =
new java.awt.GridBagConstraints();
1431 gridBagConstraints.gridx = 0;
1432 gridBagConstraints.gridy = 14;
1433 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1434 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1435 filtersPanel.add(scoreCheckbox, gridBagConstraints);
1437 org.openide.awt.Mnemonics.setLocalizedText(exifCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.exifCheckbox.text"));
1438 gridBagConstraints =
new java.awt.GridBagConstraints();
1439 gridBagConstraints.gridx = 0;
1440 gridBagConstraints.gridy = 3;
1441 gridBagConstraints.gridwidth = 4;
1442 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1443 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 6);
1444 filtersPanel.add(exifCheckbox, gridBagConstraints);
1446 org.openide.awt.Mnemonics.setLocalizedText(notableCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.notableCheckbox.text"));
1447 gridBagConstraints =
new java.awt.GridBagConstraints();
1448 gridBagConstraints.gridx = 0;
1449 gridBagConstraints.gridy = 15;
1450 gridBagConstraints.gridwidth = 4;
1451 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1452 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 6);
1453 filtersPanel.add(notableCheckbox, gridBagConstraints);
1455 objectsList.setModel(
new DefaultListModel<String>());
1456 objectsList.setEnabled(
false);
1457 objectsList.setMinimumSize(
new java.awt.Dimension(0, 30));
1458 objectsList.setPreferredSize(
new java.awt.Dimension(0, 30));
1459 objectsList.setVisibleRowCount(2);
1460 objectsScrollPane.setViewportView(objectsList);
1462 gridBagConstraints =
new java.awt.GridBagConstraints();
1463 gridBagConstraints.gridx = 1;
1464 gridBagConstraints.gridy = 6;
1465 gridBagConstraints.gridwidth = 3;
1466 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1467 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1468 gridBagConstraints.weightx = 0.5;
1469 gridBagConstraints.weighty = 0.05;
1470 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1471 filtersPanel.add(objectsScrollPane, gridBagConstraints);
1473 tagsList.setModel(
new DefaultListModel<TagName>());
1474 tagsList.setEnabled(
false);
1475 tagsList.setVisibleRowCount(3);
1476 tagsScrollPane.setViewportView(tagsList);
1478 gridBagConstraints =
new java.awt.GridBagConstraints();
1479 gridBagConstraints.gridx = 1;
1480 gridBagConstraints.gridy = 13;
1481 gridBagConstraints.gridwidth = 3;
1482 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1483 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1484 gridBagConstraints.weightx = 0.5;
1485 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1486 filtersPanel.add(tagsScrollPane, gridBagConstraints);
1488 interestingItemsList.setModel(
new DefaultListModel<String>());
1489 interestingItemsList.setEnabled(
false);
1490 interestingItemsList.setMinimumSize(
new java.awt.Dimension(0, 30));
1491 interestingItemsList.setPreferredSize(
new java.awt.Dimension(0, 30));
1492 interestingItemsList.setVisibleRowCount(2);
1493 interestingItemsScrollPane.setViewportView(interestingItemsList);
1495 gridBagConstraints =
new java.awt.GridBagConstraints();
1496 gridBagConstraints.gridx = 1;
1497 gridBagConstraints.gridy = 5;
1498 gridBagConstraints.gridwidth = 3;
1499 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1500 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1501 gridBagConstraints.weightx = 0.5;
1502 gridBagConstraints.weighty = 0.05;
1503 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1504 filtersPanel.add(interestingItemsScrollPane, gridBagConstraints);
1506 scoreList.setModel(
new DefaultListModel<Score>());
1507 scoreList.setEnabled(
false);
1508 scoreList.setVisibleRowCount(3);
1509 scoreScrollPane.setViewportView(scoreList);
1511 gridBagConstraints =
new java.awt.GridBagConstraints();
1512 gridBagConstraints.gridx = 1;
1513 gridBagConstraints.gridy = 14;
1514 gridBagConstraints.gridwidth = 3;
1515 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1516 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1517 gridBagConstraints.weightx = 0.5;
1518 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1519 filtersPanel.add(scoreScrollPane, gridBagConstraints);
1521 parentIncludeButtonGroup.add(excludeRadioButton);
1522 org.openide.awt.Mnemonics.setLocalizedText(excludeRadioButton,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.excludeRadioButton.text"));
1523 excludeRadioButton.setEnabled(
false);
1524 gridBagConstraints =
new java.awt.GridBagConstraints();
1525 gridBagConstraints.gridx = 2;
1526 gridBagConstraints.gridy = 10;
1527 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1528 gridBagConstraints.weightx = 0.1;
1529 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 0);
1530 filtersPanel.add(excludeRadioButton, gridBagConstraints);
1532 org.openide.awt.Mnemonics.setLocalizedText(knownFilesCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.knownFilesCheckbox.text"));
1533 knownFilesCheckbox.setToolTipText(
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.knownFilesCheckbox.toolTipText"));
1534 gridBagConstraints =
new java.awt.GridBagConstraints();
1535 gridBagConstraints.gridx = 0;
1536 gridBagConstraints.gridy = 16;
1537 gridBagConstraints.gridwidth = 4;
1538 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1539 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 6);
1540 filtersPanel.add(knownFilesCheckbox, gridBagConstraints);
1542 parentPathButtonGroup.add(fullRadioButton);
1543 fullRadioButton.setSelected(
true);
1544 org.openide.awt.Mnemonics.setLocalizedText(fullRadioButton,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.fullRadioButton.text"));
1545 fullRadioButton.setEnabled(
false);
1547 javax.swing.GroupLayout fullRadioPanelLayout =
new javax.swing.GroupLayout(fullRadioPanel);
1548 fullRadioPanel.setLayout(fullRadioPanelLayout);
1549 fullRadioPanelLayout.setHorizontalGroup(
1550 fullRadioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1551 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, fullRadioPanelLayout.createSequentialGroup()
1552 .addContainerGap(58, Short.MAX_VALUE)
1553 .addComponent(fullRadioButton)
1554 .addGap(20, 20, 20))
1556 fullRadioPanelLayout.setVerticalGroup(
1557 fullRadioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1558 .addGroup(fullRadioPanelLayout.createSequentialGroup()
1559 .addComponent(fullRadioButton)
1560 .addGap(0, 4, Short.MAX_VALUE))
1563 gridBagConstraints =
new java.awt.GridBagConstraints();
1564 gridBagConstraints.gridx = 0;
1565 gridBagConstraints.gridy = 9;
1566 gridBagConstraints.gridwidth = 2;
1567 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1568 gridBagConstraints.weightx = 1.0;
1569 filtersPanel.add(fullRadioPanel, gridBagConstraints);
1571 parentIncludeButtonGroup.add(includeRadioButton);
1572 includeRadioButton.setSelected(
true);
1573 org.openide.awt.Mnemonics.setLocalizedText(includeRadioButton,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.includeRadioButton.text"));
1574 includeRadioButton.setEnabled(
false);
1576 javax.swing.GroupLayout includeRadioPanelLayout =
new javax.swing.GroupLayout(includeRadioPanel);
1577 includeRadioPanel.setLayout(includeRadioPanelLayout);
1578 includeRadioPanelLayout.setHorizontalGroup(
1579 includeRadioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1580 .addGroup(includeRadioPanelLayout.createSequentialGroup()
1581 .addComponent(filler2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1582 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 58, Short.MAX_VALUE)
1583 .addComponent(includeRadioButton))
1585 includeRadioPanelLayout.setVerticalGroup(
1586 includeRadioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1587 .addComponent(filler2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1588 .addComponent(includeRadioButton)
1591 gridBagConstraints =
new java.awt.GridBagConstraints();
1592 gridBagConstraints.gridx = 0;
1593 gridBagConstraints.gridy = 10;
1594 gridBagConstraints.gridwidth = 2;
1595 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1596 gridBagConstraints.weightx = 1.0;
1597 filtersPanel.add(includeRadioPanel, gridBagConstraints);
1599 parentTextField.setEnabled(
false);
1601 javax.swing.GroupLayout parentTextPanelLayout =
new javax.swing.GroupLayout(parentTextPanel);
1602 parentTextPanel.setLayout(parentTextPanelLayout);
1603 parentTextPanelLayout.setHorizontalGroup(
1604 parentTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1605 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, parentTextPanelLayout.createSequentialGroup()
1607 .addComponent(parentTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 71, Short.MAX_VALUE))
1609 parentTextPanelLayout.setVerticalGroup(
1610 parentTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1611 .addComponent(parentTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1614 gridBagConstraints =
new java.awt.GridBagConstraints();
1615 gridBagConstraints.gridx = 1;
1616 gridBagConstraints.gridy = 11;
1617 gridBagConstraints.gridwidth = 2;
1618 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1619 gridBagConstraints.weightx = 1.5;
1620 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 0);
1621 filtersPanel.add(parentTextPanel, gridBagConstraints);
1623 filtersScrollPane.setViewportView(filtersPanel);
1625 org.openide.awt.Mnemonics.setLocalizedText(searchButton,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.searchButton.text"));
1626 searchButton.addActionListener(
new java.awt.event.ActionListener() {
1627 public void actionPerformed(java.awt.event.ActionEvent evt) {
1628 searchButtonActionPerformed(evt);
1632 sortingPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.sortingPanel.border.title")));
1633 sortingPanel.setPreferredSize(
new java.awt.Dimension(345, 112));
1635 org.openide.awt.Mnemonics.setLocalizedText(orderGroupsByLabel,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.orderGroupsByLabel.text"));
1637 org.openide.awt.Mnemonics.setLocalizedText(orderByLabel,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.orderByLabel.text"));
1639 org.openide.awt.Mnemonics.setLocalizedText(groupByLabel,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.groupByLabel.text"));
1641 javax.swing.GroupLayout sortingPanelLayout =
new javax.swing.GroupLayout(sortingPanel);
1642 sortingPanel.setLayout(sortingPanelLayout);
1643 sortingPanelLayout.setHorizontalGroup(
1644 sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1645 .addGroup(sortingPanelLayout.createSequentialGroup()
1647 .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1648 .addComponent(orderGroupsByLabel)
1649 .addGroup(sortingPanelLayout.createSequentialGroup()
1650 .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1651 .addComponent(groupByLabel)
1652 .addComponent(orderByLabel))
1653 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1654 .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
1655 .addComponent(groupSortingComboBox, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1656 .addComponent(orderByCombobox, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1657 .addComponent(groupByCombobox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
1660 sortingPanelLayout.setVerticalGroup(
1661 sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1662 .addGroup(sortingPanelLayout.createSequentialGroup()
1664 .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1665 .addComponent(groupByCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1666 .addComponent(groupByLabel))
1667 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1668 .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1669 .addComponent(groupSortingComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1670 .addComponent(orderGroupsByLabel))
1671 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1672 .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1673 .addComponent(orderByCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1674 .addComponent(orderByLabel))
1678 errorLabel.setForeground(
new java.awt.Color(255, 0, 0));
1680 org.openide.awt.Mnemonics.setLocalizedText(cancelButton,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.cancelButton.text"));
1681 cancelButton.setEnabled(
false);
1682 cancelButton.addActionListener(
new java.awt.event.ActionListener() {
1683 public void actionPerformed(java.awt.event.ActionEvent evt) {
1684 cancelButtonActionPerformed(evt);
1688 org.openide.awt.Mnemonics.setLocalizedText(stepTwoLabel,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.stepTwoLabel.text"));
1690 org.openide.awt.Mnemonics.setLocalizedText(stepThreeLabel,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.stepThreeLabel.text"));
1692 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
1693 this.setLayout(layout);
1694 layout.setHorizontalGroup(
1695 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1696 .addGroup(layout.createSequentialGroup()
1698 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1699 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
1700 .addComponent(stepTwoLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1702 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
1703 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
1704 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
1705 .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1706 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1707 .addComponent(cancelButton)
1708 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1709 .addComponent(searchButton))
1710 .addComponent(stepThreeLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1711 .addComponent(filtersScrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1712 .addComponent(sortingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE))
1716 layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {cancelButton, searchButton});
1718 layout.setVerticalGroup(
1719 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1720 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
1722 .addComponent(stepTwoLabel)
1723 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1724 .addComponent(filtersScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 201, Short.MAX_VALUE)
1725 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1726 .addComponent(stepThreeLabel)
1727 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1728 .addComponent(sortingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1729 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1730 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1731 .addComponent(errorLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
1732 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1733 .addComponent(cancelButton)
1734 .addComponent(searchButton)))
1739 private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {
1741 List<FileSearchFiltering.FileFilter> filters = getFilters();
1742 enableSearch(
false);
1743 DiscoveryEventUtils.getDiscoveryEventBus().post(
new DiscoveryEventUtils.SearchStartedEvent(fileType));
1746 FileSearch.AttributeType groupingAttr = getGroupingAttribute();
1747 FileGroup.GroupSortingAlgorithm groupSortAlgorithm = getGroupSortingMethod();
1750 FileSorter.SortingMethod fileSort = getFileSortingMethod();
1751 EamDb centralRepoDb = null;
1752 if (EamDb.isEnabled()) {
1754 centralRepoDb = EamDb.getInstance();
1755 }
catch (EamDbException ex) {
1756 centralRepoDb = null;
1757 logger.log(Level.SEVERE,
"Error loading central repository database, no central repository options will be available for File Discovery", ex);
1760 searchWorker =
new SearchWorker(centralRepoDb, filters, groupingAttr, groupSortAlgorithm, fileSort);
1761 searchWorker.execute();
1771 private void enableSearch(
boolean enabled) {
1773 DiscoveryTopComponent.getTopComponent().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
1775 DiscoveryTopComponent.getTopComponent().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
1777 if (fileType == FileType.IMAGE) {
1778 imagesSelected(enabled,
false);
1779 }
else if (fileType == FileType.VIDEO) {
1780 videosSelected(enabled,
false);
1782 searchButton.setEnabled(enabled);
1783 cancelButton.setEnabled(!enabled);
1784 orderByCombobox.setEnabled(enabled);
1785 groupByCombobox.setEnabled(enabled);
1786 groupSortingComboBox.setEnabled(enabled);
1795 void handleSearchCancelledEvent(DiscoveryEventUtils.SearchCancelledEvent searchCancelledEvent) {
1796 SwingUtilities.invokeLater(() -> {
1807 void handleSearchCompleteEvent(DiscoveryEventUtils.SearchCompleteEvent searchCompleteEvent) {
1808 SwingUtilities.invokeLater(() -> {
1813 private void parentCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1814 parentFilterSettings(
true,
true, parentCheckbox.isSelected(), null);
1817 private void keywordCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1818 keywordList.setEnabled(keywordCheckbox.isSelected());
1821 private void sizeCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1822 sizeList.setEnabled(sizeCheckbox.isSelected());
1825 private void crFrequencyCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1826 crFrequencyList.setEnabled(crFrequencyCheckbox.isSelected());
1829 private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {
1830 if (!parentTextField.getText().isEmpty()) {
1831 ParentSearchTerm searchTerm;
1832 searchTerm =
new ParentSearchTerm(parentTextField.getText(), fullRadioButton.isSelected(), includeRadioButton.isSelected());
1833 parentListModel.add(parentListModel.size(), searchTerm);
1835 parentTextField.setText(
"");
1842 void cancelSearch() {
1843 if (searchWorker != null) {
1844 searchWorker.cancel(
true);
1848 private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {
1849 int index = parentList.getSelectedIndex();
1851 parentListModel.remove(index);
1856 private void parentListValueChanged(javax.swing.event.ListSelectionEvent evt) {
1857 if (parentList.getSelectedValuesList().isEmpty()) {
1858 deleteButton.setEnabled(
false);
1860 deleteButton.setEnabled(
true);
1864 private void dataSourceCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1865 dataSourceList.setEnabled(dataSourceCheckbox.isSelected());
1868 private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {
1872 private void hashSetCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1873 hashSetList.setEnabled(hashSetCheckbox.isSelected());
1876 private void objectsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1877 objectsList.setEnabled(objectsCheckbox.isSelected());
1880 private void tagsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1881 tagsList.setEnabled(tagsCheckbox.isSelected());
1884 private void interestingItemsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1885 interestingItemsList.setEnabled(interestingItemsCheckbox.isSelected());
1888 private void scoreCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1889 scoreList.setEnabled(scoreCheckbox.isSelected());
1894 private javax.swing.JButton addButton;
1895 private javax.swing.JButton cancelButton;
1896 private javax.swing.JCheckBox crFrequencyCheckbox;
1897 private javax.swing.JList<Frequency> crFrequencyList;
1898 private javax.swing.JScrollPane crFrequencyScrollPane;
1899 private javax.swing.JCheckBox dataSourceCheckbox;
1900 private javax.swing.JList<DataSourceItem> dataSourceList;
1901 private javax.swing.JScrollPane dataSourceScrollPane;
1902 private javax.swing.JButton deleteButton;
1903 private javax.swing.JLabel errorLabel;
1904 private javax.swing.JRadioButton excludeRadioButton;
1905 private javax.swing.JCheckBox exifCheckbox;
1906 private javax.swing.JRadioButton fullRadioButton;
1907 private javax.swing.JComboBox<GroupingAttributeType> groupByCombobox;
1908 private javax.swing.JComboBox<GroupSortingAlgorithm> groupSortingComboBox;
1909 private javax.swing.JCheckBox hashSetCheckbox;
1910 private javax.swing.JList<String> hashSetList;
1911 private javax.swing.JScrollPane hashSetScrollPane;
1912 private javax.swing.JRadioButton includeRadioButton;
1913 private javax.swing.JCheckBox interestingItemsCheckbox;
1914 private javax.swing.JList<String> interestingItemsList;
1915 private javax.swing.JScrollPane interestingItemsScrollPane;
1916 private javax.swing.JCheckBox keywordCheckbox;
1917 private javax.swing.JList<String> keywordList;
1918 private javax.swing.JScrollPane keywordScrollPane;
1919 private javax.swing.JCheckBox knownFilesCheckbox;
1920 private javax.swing.JCheckBox notableCheckbox;
1921 private javax.swing.JCheckBox objectsCheckbox;
1922 private javax.swing.JList<String> objectsList;
1923 private javax.swing.JScrollPane objectsScrollPane;
1924 private javax.swing.JComboBox<SortingMethod> orderByCombobox;
1925 private javax.swing.JCheckBox parentCheckbox;
1926 private javax.swing.JList<ParentSearchTerm> parentList;
1927 private javax.swing.JScrollPane parentScrollPane;
1928 private javax.swing.JTextField parentTextField;
1929 private javax.swing.JCheckBox scoreCheckbox;
1930 private javax.swing.JList<Score> scoreList;
1931 private javax.swing.JScrollPane scoreScrollPane;
1932 private javax.swing.JButton searchButton;
1933 private javax.swing.JCheckBox sizeCheckbox;
1934 private javax.swing.JList<FileSize> sizeList;
1935 private javax.swing.JScrollPane sizeScrollPane;
1936 private javax.swing.JRadioButton substringRadioButton;
1937 private javax.swing.JCheckBox tagsCheckbox;
1938 private javax.swing.JList<TagName> tagsList;
1939 private javax.swing.JScrollPane tagsScrollPane;