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 userCreatedFilterSettings(
boolean visible,
boolean enabled,
boolean selected) {
418 userCreatedCheckbox.setVisible(visible);
419 userCreatedCheckbox.setEnabled(enabled);
420 userCreatedCheckbox.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 @NbBundle.Messages({
"FileSearchPanel.steptwo.images=Step 2: Filter which images to show"})
460 private void imagesSelected(
boolean enabled,
boolean resetSelected) {
461 stepTwoLabel.setText(Bundle.FileSearchPanel_steptwo_images());
462 dataSourceFilterSettings(
true, enabled, !resetSelected && dataSourceCheckbox.isSelected(), null);
463 int[] selectedSizeIndices = {1, 2, 3, 4, 5};
464 sizeFilterSettings(
true, enabled, resetSelected || sizeCheckbox.isSelected(), resetSelected ==
true ? selectedSizeIndices : null);
465 int[] selectedFrequencyIndices;
466 if (!CentralRepository.isEnabled()) {
467 selectedFrequencyIndices =
new int[]{0};
469 selectedFrequencyIndices =
new int[]{1, 2, 3, 4, 5, 6, 7};
471 crFrequencyFilterSettings(
true, enabled, resetSelected || crFrequencyCheckbox.isSelected(), resetSelected ==
true ? selectedFrequencyIndices : null);
472 userCreatedFilterSettings(
true, enabled, !resetSelected && userCreatedCheckbox.isSelected());
473 objectsFilterSettings(
true, enabled, !resetSelected && objectsCheckbox.isSelected(), null);
474 hashSetFilterSettings(
true, enabled, !resetSelected && hashSetCheckbox.isSelected(), null);
475 interestingItemsFilterSettings(
true, enabled, !resetSelected && interestingItemsCheckbox.isSelected(), null);
476 parentFilterSettings(
true, enabled, !resetSelected && parentCheckbox.isSelected(), null);
477 scoreFilterSettings(
false,
false,
false, null);
478 tagsFilterSettings(
false,
false,
false, null);
479 keywordFilterSettings(
false,
false,
false, null);
480 knownFilesFilterSettings(
false,
false,
false);
481 notableFilterSettings(
false,
false,
false);
494 @NbBundle.Messages({
"FileSearchPanel.steptwo.videos=Step 2: Filter which videos to show"})
495 private void videosSelected(
boolean enabled,
boolean resetSelected) {
496 stepTwoLabel.setText(Bundle.FileSearchPanel_steptwo_videos());
497 dataSourceFilterSettings(
true, enabled, !resetSelected && dataSourceCheckbox.isSelected(), null);
498 sizeFilterSettings(
true, enabled, !resetSelected && sizeCheckbox.isSelected(), null);
499 int[] selectedFrequencyIndices;
500 if (!CentralRepository.isEnabled()) {
501 selectedFrequencyIndices =
new int[]{0};
503 selectedFrequencyIndices =
new int[]{1, 2, 3, 4, 5, 6, 7};
505 crFrequencyFilterSettings(
true, enabled, resetSelected || crFrequencyCheckbox.isSelected(), resetSelected ==
true ? selectedFrequencyIndices : null);
506 userCreatedFilterSettings(
true, enabled, !resetSelected && userCreatedCheckbox.isSelected());
507 objectsFilterSettings(
true, enabled, !resetSelected && objectsCheckbox.isSelected(), null);
508 hashSetFilterSettings(
true, enabled, !resetSelected && hashSetCheckbox.isSelected(), null);
509 interestingItemsFilterSettings(
true, enabled, !resetSelected && interestingItemsCheckbox.isSelected(), null);
510 parentFilterSettings(
true, enabled, !resetSelected && parentCheckbox.isSelected(), null);
511 scoreFilterSettings(
false,
false,
false, null);
512 tagsFilterSettings(
false,
false,
false, null);
513 keywordFilterSettings(
false,
false,
false, null);
514 knownFilesFilterSettings(
false,
false,
false);
515 notableFilterSettings(
false,
false,
false);
528 @NbBundle.Messages({
"FileSearchPanel.steptwo.documents=Step 2: Filter which documents to show"})
529 private void documentsSelected(
boolean enabled,
boolean resetSelected) {
530 stepTwoLabel.setText(Bundle.FileSearchPanel_steptwo_documents());
531 dataSourceFilterSettings(
true, enabled, !resetSelected && dataSourceCheckbox.isSelected(), null);
532 sizeFilterSettings(
true, enabled, !resetSelected && sizeCheckbox.isSelected(), null);
533 int[] selectedFrequencyIndices;
534 if (!CentralRepository.isEnabled()) {
535 selectedFrequencyIndices =
new int[]{0};
537 selectedFrequencyIndices =
new int[]{1, 2, 3, 4, 5, 6, 7};
539 crFrequencyFilterSettings(
true, enabled, resetSelected || crFrequencyCheckbox.isSelected(), resetSelected ==
true ? selectedFrequencyIndices : null);
540 userCreatedFilterSettings(
false,
false,
false);
541 objectsFilterSettings(
false,
false,
false, null);
542 hashSetFilterSettings(
true, enabled, !resetSelected && hashSetCheckbox.isSelected(), null);
543 interestingItemsFilterSettings(
true, enabled, !resetSelected && interestingItemsCheckbox.isSelected(), null);
544 parentFilterSettings(
true, enabled, !resetSelected && parentCheckbox.isSelected(), null);
545 scoreFilterSettings(
false,
false,
false, null);
546 tagsFilterSettings(
false,
false,
false, null);
547 keywordFilterSettings(
false,
false,
false, null);
548 knownFilesFilterSettings(
false,
false,
false);
549 notableFilterSettings(
false,
false,
false);
557 void setSelectedType(FileType type) {
560 if (null != fileType) {
563 imagesSelected(
true,
true);
566 videosSelected(
true,
true);
569 documentsSelected(
true,
true);
578 FileType getSelectedType() {
587 searchButton.setEnabled(
false);
590 setUpDataSourceFilter();
591 setUpFrequencyFilter();
594 setUpParentPathFilter();
596 setUpInterestingItemsFilter();
601 groupByCombobox.removeAllItems();
603 for (FileSearch.GroupingAttributeType type : FileSearch.GroupingAttributeType.getOptionsForGrouping()) {
604 if ((type != GroupingAttributeType.FREQUENCY || CentralRepository.isEnabled())
605 && (type != GroupingAttributeType.OBJECT_DETECTED || objectsList.getModel().getSize() > 0)
606 && (type != GroupingAttributeType.INTERESTING_ITEM_SET || interestingItemsList.getModel().getSize() > 0)
607 && (type != GroupingAttributeType.HASH_LIST_NAME || hashSetList.getModel().getSize() > 0)) {
608 groupByCombobox.addItem(type);
612 orderByCombobox.removeAllItems();
614 for (FileSorter.SortingMethod method : FileSorter.SortingMethod.getOptionsForOrdering()) {
615 if (method != SortingMethod.BY_FREQUENCY || CentralRepository.isEnabled()) {
616 orderByCombobox.addItem(method);
620 groupSortingComboBox.setSelectedIndex(0);
621 setSelectedType(FileType.IMAGE);
632 private void addListeners(JCheckBox checkBox, JList<?> list) {
633 if (checkBox != null) {
634 checkBox.addActionListener(
this);
637 list.addListSelectionListener(
new ListSelectionListener() {
639 public void valueChanged(ListSelectionEvent evt) {
640 if (!evt.getValueIsAdjusting()) {
651 private void setUpDataSourceFilter() {
654 DefaultListModel<DataSourceItem> dsListModel = (DefaultListModel<DataSourceItem>) dataSourceList.getModel();
655 dsListModel.removeAllElements();
656 for (DataSource ds : Case.getCurrentCase().getSleuthkitCase().getDataSources()) {
657 dsListModel.add(count,
new DataSourceItem(ds));
659 }
catch (TskCoreException ex) {
660 logger.log(Level.SEVERE,
"Error loading data sources", ex);
661 dataSourceCheckbox.setEnabled(
false);
662 dataSourceList.setEnabled(
false);
664 addListeners(dataSourceCheckbox, dataSourceList);
670 private void setUpFrequencyFilter() {
672 DefaultListModel<FileSearchData.Frequency> frequencyListModel = (DefaultListModel<FileSearchData.Frequency>) crFrequencyList.getModel();
673 frequencyListModel.removeAllElements();
674 if (!CentralRepository.isEnabled()) {
675 for (FileSearchData.Frequency freq : FileSearchData.Frequency.getOptionsForFilteringWithoutCr()) {
676 frequencyListModel.add(count, freq);
679 for (FileSearchData.Frequency freq : FileSearchData.Frequency.getOptionsForFilteringWithCr()) {
680 frequencyListModel.add(count, freq);
683 addListeners(crFrequencyCheckbox, crFrequencyList);
689 private void setUpSizeFilter() {
691 DefaultListModel<FileSearchData.FileSize> sizeListModel = (DefaultListModel<FileSearchData.FileSize>) sizeList.getModel();
692 sizeListModel.removeAllElements();
693 if (null == fileType) {
694 for (FileSearchData.FileSize size : FileSearchData.FileSize.values()) {
695 sizeListModel.add(count, size);
698 List<FileSearchData.FileSize> sizes;
701 sizes = FileSearchData.FileSize.getOptionsForVideos();
704 sizes = FileSearchData.FileSize.getOptionsForImages();
707 sizes = FileSearchData.FileSize.getOptionsForImages();
710 sizes =
new ArrayList<>();
713 for (FileSearchData.FileSize size : sizes) {
714 sizeListModel.add(count, size);
717 addListeners(sizeCheckbox, sizeList);
723 private void setUpKWFilter() {
726 DefaultListModel<String> kwListModel = (DefaultListModel<String>) keywordList.getModel();
727 kwListModel.removeAllElements();
728 List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT,
729 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME);
730 for (String name : setNames) {
731 kwListModel.add(count, name);
733 }
catch (TskCoreException ex) {
734 logger.log(Level.SEVERE,
"Error loading keyword list names", ex);
735 keywordCheckbox.setEnabled(
false);
736 keywordList.setEnabled(
false);
738 addListeners(keywordCheckbox, keywordList);
744 private void setUpHashFilter() {
747 DefaultListModel<String> hashListModel = (DefaultListModel<String>) hashSetList.getModel();
748 hashListModel.removeAllElements();
749 List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT,
750 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME);
751 for (String name : setNames) {
752 hashListModel.add(count, name);
755 }
catch (TskCoreException ex) {
756 logger.log(Level.SEVERE,
"Error loading hash set names", ex);
757 hashSetCheckbox.setEnabled(
false);
758 hashSetList.setEnabled(
false);
760 addListeners(hashSetCheckbox, hashSetList);
766 private void setUpInterestingItemsFilter() {
769 DefaultListModel<String> intListModel = (DefaultListModel<String>) interestingItemsList.getModel();
770 intListModel.removeAllElements();
771 List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT,
772 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME);
773 for (String name : setNames) {
774 intListModel.add(count, name);
777 }
catch (TskCoreException ex) {
778 logger.log(Level.SEVERE,
"Error loading interesting file set names", ex);
779 interestingItemsCheckbox.setEnabled(
false);
780 interestingItemsList.setEnabled(
false);
782 addListeners(interestingItemsCheckbox, interestingItemsList);
788 private void setUpTagsFilter() {
791 DefaultListModel<TagName> tagsListModel = (DefaultListModel<TagName>) tagsList.getModel();
792 tagsListModel.removeAllElements();
793 List<TagName> tagNames = Case.getCurrentCase().getSleuthkitCase().getTagNamesInUse();
794 for (TagName name : tagNames) {
795 tagsListModel.add(count, name);
798 tagsList.setCellRenderer(
new TagsListCellRenderer());
799 }
catch (TskCoreException ex) {
800 logger.log(Level.SEVERE,
"Error loading tag names", ex);
801 tagsCheckbox.setEnabled(
false);
802 tagsList.setEnabled(
false);
804 addListeners(tagsCheckbox, tagsList);
812 private static final long serialVersionUID = 1L;
820 boolean cellHasFocus) {
821 Object newValue = value;
822 if (value instanceof TagName) {
823 newValue = ((TagName) value).getDisplayName();
825 super.getListCellRendererComponent(list, newValue, index, isSelected, cellHasFocus);
833 private void setUpObjectFilter() {
836 DefaultListModel<String> objListModel = (DefaultListModel<String>) objectsList.getModel();
837 objListModel.removeAllElements();
838 List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_OBJECT_DETECTED, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DESCRIPTION);
839 for (String name : setNames) {
840 objListModel.add(count, name);
843 }
catch (TskCoreException ex) {
844 logger.log(Level.SEVERE,
"Error loading object detected set names", ex);
845 objectsCheckbox.setEnabled(
false);
846 objectsList.setEnabled(
false);
848 addListeners(objectsCheckbox, objectsList);
854 private void setUpScoreFilter() {
857 DefaultListModel<Score> scoreListModel = (DefaultListModel<Score>) scoreList.getModel();
858 scoreListModel.removeAllElements();
859 for (Score score : Score.getOptionsForFiltering()) {
860 scoreListModel.add(count, score);
862 addListeners(scoreCheckbox, scoreList);
877 private List<String> getSetNames(BlackboardArtifact.ARTIFACT_TYPE artifactType, BlackboardAttribute.ATTRIBUTE_TYPE setNameAttribute) throws TskCoreException {
878 List<BlackboardArtifact> arts = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifacts(artifactType);
879 List<String> setNames =
new ArrayList<>();
880 for (BlackboardArtifact art : arts) {
881 for (BlackboardAttribute attr : art.getAttributes()) {
882 if (attr.getAttributeType().getTypeID() == setNameAttribute.getTypeID()) {
883 String setName = attr.getValueString();
884 if (!setNames.contains(setName)) {
885 setNames.add(setName);
890 Collections.sort(setNames);
897 private void setUpParentPathFilter() {
898 fullRadioButton.setSelected(
true);
899 includeRadioButton.setSelected(
true);
900 parentListModel = (DefaultListModel<FileSearchFiltering.ParentSearchTerm>) parentList.getModel();
901 addListeners(parentCheckbox, parentList);
909 List<FileSearchFiltering.FileFilter> getFilters() {
910 List<FileSearchFiltering.FileFilter> filters =
new ArrayList<>();
911 filters.add(
new FileSearchFiltering.FileTypeFilter(fileType));
912 if (parentCheckbox.isSelected()) {
914 filters.add(
new FileSearchFiltering.ParentFilter(getParentPaths()));
917 if (dataSourceCheckbox.isSelected()) {
918 List<DataSource> dataSources = dataSourceList.getSelectedValuesList().stream().map(t -> t.getDataSource()).collect(Collectors.toList());
919 filters.add(
new FileSearchFiltering.DataSourceFilter(dataSources));
922 if (crFrequencyCheckbox.isSelected()) {
923 filters.add(
new FileSearchFiltering.FrequencyFilter(crFrequencyList.getSelectedValuesList()));
926 if (sizeCheckbox.isSelected()) {
927 filters.add(
new FileSearchFiltering.SizeFilter(sizeList.getSelectedValuesList()));
930 if (keywordCheckbox.isSelected()) {
931 filters.add(
new FileSearchFiltering.KeywordListFilter(keywordList.getSelectedValuesList()));
934 if (hashSetCheckbox.isSelected()) {
935 filters.add(
new FileSearchFiltering.HashSetFilter(hashSetList.getSelectedValuesList()));
938 if (interestingItemsCheckbox.isSelected()) {
939 filters.add(
new FileSearchFiltering.InterestingFileSetFilter(interestingItemsList.getSelectedValuesList()));
942 if (objectsCheckbox.isSelected()) {
943 filters.add(
new FileSearchFiltering.ObjectDetectionFilter(objectsList.getSelectedValuesList()));
946 if (tagsCheckbox.isSelected()) {
947 filters.add(
new FileSearchFiltering.TagsFilter(tagsList.getSelectedValuesList()));
950 if (userCreatedCheckbox.isSelected()) {
951 filters.add(
new FileSearchFiltering.UserCreatedFilter());
954 if (notableCheckbox.isSelected()) {
955 filters.add(
new FileSearchFiltering.NotableFilter());
958 if (knownFilesCheckbox.isSelected()) {
959 filters.add(
new FileSearchFiltering.KnownFilter());
962 if (scoreCheckbox.isSelected()) {
963 filters.add(
new FileSearchFiltering.ScoreFilter(scoreList.getSelectedValuesList()));
974 private List<FileSearchFiltering.ParentSearchTerm> getParentPaths() {
975 List<FileSearchFiltering.ParentSearchTerm> results =
new ArrayList<>();
976 for (
int i = 0; i < parentListModel.getSize(); i++) {
977 results.add(parentListModel.get(i));
987 FileSearch.AttributeType getGroupingAttribute() {
988 return groupByCombobox.getItemAt(groupByCombobox.getSelectedIndex()).getAttributeType();
996 FileGroup.GroupSortingAlgorithm getGroupSortingMethod() {
997 return groupSortingComboBox.getItemAt(groupSortingComboBox.getSelectedIndex());
1006 FileSorter.SortingMethod getFileSortingMethod() {
1007 return (FileSorter.SortingMethod) orderByCombobox.getSelectedItem();
1011 public void actionPerformed(ActionEvent e) {
1021 private final DataSource
ds;
1027 DataSource getDataSource() {
1033 return ds.getName() +
" (ID: " + ds.getId() +
")";
1041 private void validateFields() {
1043 if (fileType == null) {
1044 setInvalid(
"At least one file type must be selected");
1048 if (dataSourceCheckbox.isSelected() && dataSourceList.getSelectedValuesList().isEmpty()) {
1049 setInvalid(
"At least one data source must be selected");
1052 if (crFrequencyCheckbox.isSelected() && crFrequencyList.getSelectedValuesList().isEmpty()) {
1053 setInvalid(
"At least one CR frequency must be selected");
1056 if (sizeCheckbox.isSelected() && sizeList.getSelectedValuesList().isEmpty()) {
1057 setInvalid(
"At least one size must be selected");
1060 if (keywordCheckbox.isSelected() && keywordList.getSelectedValuesList().isEmpty()) {
1061 setInvalid(
"At least one keyword list name must be selected");
1066 if (parentCheckbox.isSelected() && getParentPaths().isEmpty()) {
1067 setInvalid(
"At least one parent path must be entered");
1071 if (hashSetCheckbox.isSelected() && hashSetList.getSelectedValuesList().isEmpty()) {
1072 setInvalid(
"At least one hash set name must be selected");
1076 if (interestingItemsCheckbox.isSelected() && interestingItemsList.getSelectedValuesList().isEmpty()) {
1077 setInvalid(
"At least one interesting file set name must be selected");
1081 if (objectsCheckbox.isSelected() && objectsList.getSelectedValuesList().isEmpty()) {
1082 setInvalid(
"At least one object type name must be selected");
1086 if (tagsCheckbox.isSelected() && tagsList.getSelectedValuesList().isEmpty()) {
1087 setInvalid(
"At least one tag name must be selected");
1091 if (scoreCheckbox.isSelected() && scoreList.getSelectedValuesList().isEmpty()) {
1092 setInvalid(
"At least one score must be selected");
1101 private void setValid() {
1102 errorLabel.setText(
"");
1103 searchButton.setEnabled(
true);
1112 private void setInvalid(String error) {
1113 errorLabel.setText(error);
1114 searchButton.setEnabled(
false);
1122 @SuppressWarnings(
"unchecked")
1124 private
void initComponents() {
1125 java.awt.GridBagConstraints gridBagConstraints;
1127 javax.swing.ButtonGroup parentPathButtonGroup =
new javax.swing.ButtonGroup();
1128 javax.swing.ButtonGroup parentIncludeButtonGroup =
new javax.swing.ButtonGroup();
1129 javax.swing.JScrollPane filtersScrollPane =
new javax.swing.JScrollPane();
1130 javax.swing.JPanel filtersPanel =
new javax.swing.JPanel();
1131 sizeCheckbox =
new javax.swing.JCheckBox();
1132 dataSourceCheckbox =
new javax.swing.JCheckBox();
1133 crFrequencyCheckbox =
new javax.swing.JCheckBox();
1134 keywordCheckbox =
new javax.swing.JCheckBox();
1135 parentCheckbox =
new javax.swing.JCheckBox();
1136 dataSourceScrollPane =
new javax.swing.JScrollPane();
1137 dataSourceList =
new javax.swing.JList<>();
1138 substringRadioButton =
new javax.swing.JRadioButton();
1139 addButton =
new javax.swing.JButton();
1140 deleteButton =
new javax.swing.JButton();
1141 sizeScrollPane =
new javax.swing.JScrollPane();
1142 sizeList =
new javax.swing.JList<>();
1143 crFrequencyScrollPane =
new javax.swing.JScrollPane();
1144 crFrequencyList =
new javax.swing.JList<>();
1145 keywordScrollPane =
new javax.swing.JScrollPane();
1146 keywordList =
new javax.swing.JList<>();
1147 javax.swing.JLabel parentLabel =
new javax.swing.JLabel();
1148 parentScrollPane =
new javax.swing.JScrollPane();
1149 parentList =
new javax.swing.JList<>();
1150 hashSetCheckbox =
new javax.swing.JCheckBox();
1151 hashSetScrollPane =
new javax.swing.JScrollPane();
1152 hashSetList =
new javax.swing.JList<>();
1153 objectsCheckbox =
new javax.swing.JCheckBox();
1154 tagsCheckbox =
new javax.swing.JCheckBox();
1155 interestingItemsCheckbox =
new javax.swing.JCheckBox();
1156 scoreCheckbox =
new javax.swing.JCheckBox();
1157 userCreatedCheckbox =
new javax.swing.JCheckBox();
1158 notableCheckbox =
new javax.swing.JCheckBox();
1159 objectsScrollPane =
new javax.swing.JScrollPane();
1160 objectsList =
new javax.swing.JList<>();
1161 tagsScrollPane =
new javax.swing.JScrollPane();
1162 tagsList =
new javax.swing.JList<>();
1163 interestingItemsScrollPane =
new javax.swing.JScrollPane();
1164 interestingItemsList =
new javax.swing.JList<>();
1165 scoreScrollPane =
new javax.swing.JScrollPane();
1166 scoreList =
new javax.swing.JList<>();
1167 excludeRadioButton =
new javax.swing.JRadioButton();
1168 knownFilesCheckbox =
new javax.swing.JCheckBox();
1169 javax.swing.JPanel fullRadioPanel =
new javax.swing.JPanel();
1170 fullRadioButton =
new javax.swing.JRadioButton();
1171 javax.swing.JPanel includeRadioPanel =
new javax.swing.JPanel();
1172 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));
1173 includeRadioButton =
new javax.swing.JRadioButton();
1174 javax.swing.JPanel parentTextPanel =
new javax.swing.JPanel();
1175 parentTextField =
new javax.swing.JTextField();
1176 searchButton =
new javax.swing.JButton();
1177 javax.swing.JPanel sortingPanel =
new javax.swing.JPanel();
1178 groupByCombobox =
new javax.swing.JComboBox<>();
1179 orderByCombobox =
new javax.swing.JComboBox<>();
1180 javax.swing.JLabel orderGroupsByLabel =
new javax.swing.JLabel();
1181 javax.swing.JLabel orderByLabel =
new javax.swing.JLabel();
1182 javax.swing.JLabel groupByLabel =
new javax.swing.JLabel();
1183 groupSortingComboBox =
new javax.swing.JComboBox<>();
1184 errorLabel =
new javax.swing.JLabel();
1185 cancelButton =
new javax.swing.JButton();
1186 stepTwoLabel =
new javax.swing.JLabel();
1187 javax.swing.JLabel stepThreeLabel =
new javax.swing.JLabel();
1189 setMinimumSize(
new java.awt.Dimension(10, 0));
1190 setPreferredSize(
new java.awt.Dimension(321, 400));
1192 filtersScrollPane.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.filtersScrollPane.border.title")));
1193 filtersScrollPane.setPreferredSize(
new java.awt.Dimension(309, 400));
1195 filtersPanel.setMinimumSize(
new java.awt.Dimension(280, 500));
1196 filtersPanel.setPreferredSize(
new java.awt.Dimension(280, 540));
1197 filtersPanel.setLayout(
new java.awt.GridBagLayout());
1199 org.openide.awt.Mnemonics.setLocalizedText(sizeCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.sizeCheckbox.text"));
1200 sizeCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1201 public void actionPerformed(java.awt.event.ActionEvent evt) {
1202 sizeCheckboxActionPerformed(evt);
1205 gridBagConstraints =
new java.awt.GridBagConstraints();
1206 gridBagConstraints.gridx = 0;
1207 gridBagConstraints.gridy = 0;
1208 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1209 gridBagConstraints.insets =
new java.awt.Insets(6, 6, 4, 0);
1210 filtersPanel.add(sizeCheckbox, gridBagConstraints);
1212 org.openide.awt.Mnemonics.setLocalizedText(dataSourceCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.dataSourceCheckbox.text"));
1213 dataSourceCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1214 public void actionPerformed(java.awt.event.ActionEvent evt) {
1215 dataSourceCheckboxActionPerformed(evt);
1218 gridBagConstraints =
new java.awt.GridBagConstraints();
1219 gridBagConstraints.gridx = 0;
1220 gridBagConstraints.gridy = 1;
1221 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1222 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1223 filtersPanel.add(dataSourceCheckbox, gridBagConstraints);
1225 org.openide.awt.Mnemonics.setLocalizedText(crFrequencyCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.crFrequencyCheckbox.text"));
1226 crFrequencyCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1227 public void actionPerformed(java.awt.event.ActionEvent evt) {
1228 crFrequencyCheckboxActionPerformed(evt);
1231 gridBagConstraints =
new java.awt.GridBagConstraints();
1232 gridBagConstraints.gridx = 0;
1233 gridBagConstraints.gridy = 2;
1234 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1235 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1236 filtersPanel.add(crFrequencyCheckbox, gridBagConstraints);
1238 org.openide.awt.Mnemonics.setLocalizedText(keywordCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.keywordCheckbox.text"));
1239 keywordCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1240 public void actionPerformed(java.awt.event.ActionEvent evt) {
1241 keywordCheckboxActionPerformed(evt);
1244 gridBagConstraints =
new java.awt.GridBagConstraints();
1245 gridBagConstraints.gridx = 0;
1246 gridBagConstraints.gridy = 12;
1247 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1248 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1249 filtersPanel.add(keywordCheckbox, gridBagConstraints);
1251 org.openide.awt.Mnemonics.setLocalizedText(parentCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.parentCheckbox.text"));
1252 parentCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1253 public void actionPerformed(java.awt.event.ActionEvent evt) {
1254 parentCheckboxActionPerformed(evt);
1257 gridBagConstraints =
new java.awt.GridBagConstraints();
1258 gridBagConstraints.gridx = 0;
1259 gridBagConstraints.gridy = 7;
1260 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1261 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1262 filtersPanel.add(parentCheckbox, gridBagConstraints);
1264 dataSourceList.setModel(
new DefaultListModel<DataSourceItem>());
1265 dataSourceList.setEnabled(
false);
1266 dataSourceList.setVisibleRowCount(5);
1267 dataSourceScrollPane.setViewportView(dataSourceList);
1269 gridBagConstraints =
new java.awt.GridBagConstraints();
1270 gridBagConstraints.gridx = 1;
1271 gridBagConstraints.gridy = 1;
1272 gridBagConstraints.gridwidth = 3;
1273 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1274 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1275 gridBagConstraints.weightx = 0.5;
1276 gridBagConstraints.weighty = 0.1;
1277 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1278 filtersPanel.add(dataSourceScrollPane, gridBagConstraints);
1280 parentPathButtonGroup.add(substringRadioButton);
1281 org.openide.awt.Mnemonics.setLocalizedText(substringRadioButton,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.substringRadioButton.text"));
1282 substringRadioButton.setEnabled(
false);
1283 gridBagConstraints =
new java.awt.GridBagConstraints();
1284 gridBagConstraints.gridx = 2;
1285 gridBagConstraints.gridy = 9;
1286 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1287 gridBagConstraints.weightx = 0.1;
1288 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 0);
1289 filtersPanel.add(substringRadioButton, gridBagConstraints);
1291 org.openide.awt.Mnemonics.setLocalizedText(addButton,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.addButton.text"));
1292 addButton.setEnabled(
false);
1293 addButton.setMaximumSize(
new java.awt.Dimension(70, 23));
1294 addButton.setMinimumSize(
new java.awt.Dimension(70, 23));
1295 addButton.setPreferredSize(
new java.awt.Dimension(70, 23));
1296 addButton.addActionListener(
new java.awt.event.ActionListener() {
1297 public void actionPerformed(java.awt.event.ActionEvent evt) {
1298 addButtonActionPerformed(evt);
1301 gridBagConstraints =
new java.awt.GridBagConstraints();
1302 gridBagConstraints.gridx = 3;
1303 gridBagConstraints.gridy = 11;
1304 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_END;
1305 gridBagConstraints.insets =
new java.awt.Insets(0, 10, 6, 6);
1306 filtersPanel.add(addButton, gridBagConstraints);
1308 org.openide.awt.Mnemonics.setLocalizedText(deleteButton,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.deleteButton.text"));
1309 deleteButton.setEnabled(
false);
1310 deleteButton.setMaximumSize(
new java.awt.Dimension(70, 23));
1311 deleteButton.setMinimumSize(
new java.awt.Dimension(70, 23));
1312 deleteButton.setPreferredSize(
new java.awt.Dimension(70, 23));
1313 deleteButton.addActionListener(
new java.awt.event.ActionListener() {
1314 public void actionPerformed(java.awt.event.ActionEvent evt) {
1315 deleteButtonActionPerformed(evt);
1318 gridBagConstraints =
new java.awt.GridBagConstraints();
1319 gridBagConstraints.gridx = 3;
1320 gridBagConstraints.gridy = 10;
1321 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_END;
1322 gridBagConstraints.insets =
new java.awt.Insets(0, 10, 4, 6);
1323 filtersPanel.add(deleteButton, gridBagConstraints);
1325 sizeList.setModel(
new DefaultListModel<FileSize>());
1326 sizeList.setEnabled(
false);
1327 sizeList.setVisibleRowCount(5);
1328 sizeScrollPane.setViewportView(sizeList);
1330 gridBagConstraints =
new java.awt.GridBagConstraints();
1331 gridBagConstraints.gridx = 1;
1332 gridBagConstraints.gridy = 0;
1333 gridBagConstraints.gridwidth = 3;
1334 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1335 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1336 gridBagConstraints.weightx = 0.5;
1337 gridBagConstraints.weighty = 0.1;
1338 gridBagConstraints.insets =
new java.awt.Insets(6, 4, 4, 6);
1339 filtersPanel.add(sizeScrollPane, gridBagConstraints);
1341 crFrequencyList.setModel(
new DefaultListModel<Frequency>());
1342 crFrequencyList.setEnabled(
false);
1343 crFrequencyList.setVisibleRowCount(5);
1344 crFrequencyScrollPane.setViewportView(crFrequencyList);
1346 gridBagConstraints =
new java.awt.GridBagConstraints();
1347 gridBagConstraints.gridx = 1;
1348 gridBagConstraints.gridy = 2;
1349 gridBagConstraints.gridwidth = 3;
1350 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1351 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1352 gridBagConstraints.weightx = 0.5;
1353 gridBagConstraints.weighty = 0.1;
1354 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1355 filtersPanel.add(crFrequencyScrollPane, gridBagConstraints);
1357 keywordList.setModel(
new DefaultListModel<String>());
1358 keywordList.setEnabled(
false);
1359 keywordList.setVisibleRowCount(3);
1360 keywordScrollPane.setViewportView(keywordList);
1362 gridBagConstraints =
new java.awt.GridBagConstraints();
1363 gridBagConstraints.gridx = 1;
1364 gridBagConstraints.gridy = 12;
1365 gridBagConstraints.gridwidth = 3;
1366 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1367 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1368 gridBagConstraints.weightx = 0.5;
1369 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1370 filtersPanel.add(keywordScrollPane, gridBagConstraints);
1372 org.openide.awt.Mnemonics.setLocalizedText(parentLabel,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.parentLabel.text"));
1373 gridBagConstraints =
new java.awt.GridBagConstraints();
1374 gridBagConstraints.gridx = 0;
1375 gridBagConstraints.gridy = 8;
1376 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1377 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1378 filtersPanel.add(parentLabel, gridBagConstraints);
1380 parentList.setModel(
new DefaultListModel<ParentSearchTerm>());
1381 parentList.setEnabled(
false);
1382 parentList.setVisibleRowCount(4);
1383 parentList.addListSelectionListener(
new javax.swing.event.ListSelectionListener() {
1384 public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
1385 parentListValueChanged(evt);
1388 parentScrollPane.setViewportView(parentList);
1390 gridBagConstraints =
new java.awt.GridBagConstraints();
1391 gridBagConstraints.gridx = 1;
1392 gridBagConstraints.gridy = 7;
1393 gridBagConstraints.gridwidth = 3;
1394 gridBagConstraints.gridheight = 2;
1395 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1396 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1397 gridBagConstraints.weightx = 0.5;
1398 gridBagConstraints.weighty = 0.05;
1399 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1400 filtersPanel.add(parentScrollPane, gridBagConstraints);
1402 org.openide.awt.Mnemonics.setLocalizedText(hashSetCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.hashSetCheckbox.text"));
1403 hashSetCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1404 public void actionPerformed(java.awt.event.ActionEvent evt) {
1405 hashSetCheckboxActionPerformed(evt);
1408 gridBagConstraints =
new java.awt.GridBagConstraints();
1409 gridBagConstraints.gridx = 0;
1410 gridBagConstraints.gridy = 4;
1411 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1412 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1413 filtersPanel.add(hashSetCheckbox, gridBagConstraints);
1415 hashSetList.setModel(
new DefaultListModel<String>());
1416 hashSetList.setEnabled(
false);
1417 hashSetList.setVisibleRowCount(3);
1418 hashSetScrollPane.setViewportView(hashSetList);
1420 gridBagConstraints =
new java.awt.GridBagConstraints();
1421 gridBagConstraints.gridx = 1;
1422 gridBagConstraints.gridy = 4;
1423 gridBagConstraints.gridwidth = 3;
1424 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1425 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1426 gridBagConstraints.weightx = 0.5;
1427 gridBagConstraints.weighty = 0.05;
1428 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1429 filtersPanel.add(hashSetScrollPane, gridBagConstraints);
1431 org.openide.awt.Mnemonics.setLocalizedText(objectsCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.objectsCheckbox.text"));
1432 objectsCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1433 public void actionPerformed(java.awt.event.ActionEvent evt) {
1434 objectsCheckboxActionPerformed(evt);
1437 gridBagConstraints =
new java.awt.GridBagConstraints();
1438 gridBagConstraints.gridx = 0;
1439 gridBagConstraints.gridy = 6;
1440 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1441 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1442 filtersPanel.add(objectsCheckbox, gridBagConstraints);
1444 org.openide.awt.Mnemonics.setLocalizedText(tagsCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.tagsCheckbox.text"));
1445 tagsCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1446 public void actionPerformed(java.awt.event.ActionEvent evt) {
1447 tagsCheckboxActionPerformed(evt);
1450 gridBagConstraints =
new java.awt.GridBagConstraints();
1451 gridBagConstraints.gridx = 0;
1452 gridBagConstraints.gridy = 13;
1453 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1454 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1455 filtersPanel.add(tagsCheckbox, gridBagConstraints);
1457 org.openide.awt.Mnemonics.setLocalizedText(interestingItemsCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.interestingItemsCheckbox.text"));
1458 interestingItemsCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1459 public void actionPerformed(java.awt.event.ActionEvent evt) {
1460 interestingItemsCheckboxActionPerformed(evt);
1463 gridBagConstraints =
new java.awt.GridBagConstraints();
1464 gridBagConstraints.gridx = 0;
1465 gridBagConstraints.gridy = 5;
1466 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1467 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1468 filtersPanel.add(interestingItemsCheckbox, gridBagConstraints);
1470 org.openide.awt.Mnemonics.setLocalizedText(scoreCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.scoreCheckbox.text"));
1471 scoreCheckbox.addActionListener(
new java.awt.event.ActionListener() {
1472 public void actionPerformed(java.awt.event.ActionEvent evt) {
1473 scoreCheckboxActionPerformed(evt);
1476 gridBagConstraints =
new java.awt.GridBagConstraints();
1477 gridBagConstraints.gridx = 0;
1478 gridBagConstraints.gridy = 14;
1479 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1480 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 0);
1481 filtersPanel.add(scoreCheckbox, gridBagConstraints);
1483 org.openide.awt.Mnemonics.setLocalizedText(userCreatedCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.userCreatedCheckbox.text"));
1484 gridBagConstraints =
new java.awt.GridBagConstraints();
1485 gridBagConstraints.gridx = 0;
1486 gridBagConstraints.gridy = 3;
1487 gridBagConstraints.gridwidth = 4;
1488 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1489 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 6);
1490 filtersPanel.add(userCreatedCheckbox, gridBagConstraints);
1492 org.openide.awt.Mnemonics.setLocalizedText(notableCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.notableCheckbox.text"));
1493 gridBagConstraints =
new java.awt.GridBagConstraints();
1494 gridBagConstraints.gridx = 0;
1495 gridBagConstraints.gridy = 15;
1496 gridBagConstraints.gridwidth = 4;
1497 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1498 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 6);
1499 filtersPanel.add(notableCheckbox, gridBagConstraints);
1501 objectsList.setModel(
new DefaultListModel<String>());
1502 objectsList.setEnabled(
false);
1503 objectsList.setVisibleRowCount(2);
1504 objectsScrollPane.setViewportView(objectsList);
1506 gridBagConstraints =
new java.awt.GridBagConstraints();
1507 gridBagConstraints.gridx = 1;
1508 gridBagConstraints.gridy = 6;
1509 gridBagConstraints.gridwidth = 3;
1510 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1511 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1512 gridBagConstraints.weightx = 0.5;
1513 gridBagConstraints.weighty = 0.05;
1514 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1515 filtersPanel.add(objectsScrollPane, gridBagConstraints);
1517 tagsList.setModel(
new DefaultListModel<TagName>());
1518 tagsList.setEnabled(
false);
1519 tagsList.setVisibleRowCount(3);
1520 tagsScrollPane.setViewportView(tagsList);
1522 gridBagConstraints =
new java.awt.GridBagConstraints();
1523 gridBagConstraints.gridx = 1;
1524 gridBagConstraints.gridy = 13;
1525 gridBagConstraints.gridwidth = 3;
1526 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1527 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1528 gridBagConstraints.weightx = 0.5;
1529 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1530 filtersPanel.add(tagsScrollPane, gridBagConstraints);
1532 interestingItemsList.setModel(
new DefaultListModel<String>());
1533 interestingItemsList.setEnabled(
false);
1534 interestingItemsList.setVisibleRowCount(2);
1535 interestingItemsScrollPane.setViewportView(interestingItemsList);
1537 gridBagConstraints =
new java.awt.GridBagConstraints();
1538 gridBagConstraints.gridx = 1;
1539 gridBagConstraints.gridy = 5;
1540 gridBagConstraints.gridwidth = 3;
1541 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1542 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1543 gridBagConstraints.weightx = 0.5;
1544 gridBagConstraints.weighty = 0.05;
1545 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1546 filtersPanel.add(interestingItemsScrollPane, gridBagConstraints);
1548 scoreList.setModel(
new DefaultListModel<Score>());
1549 scoreList.setEnabled(
false);
1550 scoreList.setVisibleRowCount(3);
1551 scoreScrollPane.setViewportView(scoreList);
1553 gridBagConstraints =
new java.awt.GridBagConstraints();
1554 gridBagConstraints.gridx = 1;
1555 gridBagConstraints.gridy = 14;
1556 gridBagConstraints.gridwidth = 3;
1557 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1558 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1559 gridBagConstraints.weightx = 0.5;
1560 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 6);
1561 filtersPanel.add(scoreScrollPane, gridBagConstraints);
1563 parentIncludeButtonGroup.add(excludeRadioButton);
1564 org.openide.awt.Mnemonics.setLocalizedText(excludeRadioButton,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.excludeRadioButton.text"));
1565 excludeRadioButton.setEnabled(
false);
1566 gridBagConstraints =
new java.awt.GridBagConstraints();
1567 gridBagConstraints.gridx = 2;
1568 gridBagConstraints.gridy = 10;
1569 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1570 gridBagConstraints.weightx = 0.1;
1571 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 0);
1572 filtersPanel.add(excludeRadioButton, gridBagConstraints);
1574 org.openide.awt.Mnemonics.setLocalizedText(knownFilesCheckbox,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.knownFilesCheckbox.text"));
1575 knownFilesCheckbox.setToolTipText(
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.knownFilesCheckbox.toolTipText"));
1576 gridBagConstraints =
new java.awt.GridBagConstraints();
1577 gridBagConstraints.gridx = 0;
1578 gridBagConstraints.gridy = 16;
1579 gridBagConstraints.gridwidth = 4;
1580 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
1581 gridBagConstraints.insets =
new java.awt.Insets(0, 6, 4, 6);
1582 filtersPanel.add(knownFilesCheckbox, gridBagConstraints);
1584 parentPathButtonGroup.add(fullRadioButton);
1585 fullRadioButton.setSelected(
true);
1586 org.openide.awt.Mnemonics.setLocalizedText(fullRadioButton,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.fullRadioButton.text"));
1587 fullRadioButton.setEnabled(
false);
1589 javax.swing.GroupLayout fullRadioPanelLayout =
new javax.swing.GroupLayout(fullRadioPanel);
1590 fullRadioPanel.setLayout(fullRadioPanelLayout);
1591 fullRadioPanelLayout.setHorizontalGroup(
1592 fullRadioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1593 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, fullRadioPanelLayout.createSequentialGroup()
1594 .addContainerGap(58, Short.MAX_VALUE)
1595 .addComponent(fullRadioButton)
1596 .addGap(20, 20, 20))
1598 fullRadioPanelLayout.setVerticalGroup(
1599 fullRadioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1600 .addGroup(fullRadioPanelLayout.createSequentialGroup()
1601 .addComponent(fullRadioButton)
1602 .addGap(0, 4, Short.MAX_VALUE))
1605 gridBagConstraints =
new java.awt.GridBagConstraints();
1606 gridBagConstraints.gridx = 0;
1607 gridBagConstraints.gridy = 9;
1608 gridBagConstraints.gridwidth = 2;
1609 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1610 gridBagConstraints.weightx = 1.0;
1611 filtersPanel.add(fullRadioPanel, gridBagConstraints);
1613 parentIncludeButtonGroup.add(includeRadioButton);
1614 includeRadioButton.setSelected(
true);
1615 org.openide.awt.Mnemonics.setLocalizedText(includeRadioButton,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.includeRadioButton.text"));
1616 includeRadioButton.setEnabled(
false);
1618 javax.swing.GroupLayout includeRadioPanelLayout =
new javax.swing.GroupLayout(includeRadioPanel);
1619 includeRadioPanel.setLayout(includeRadioPanelLayout);
1620 includeRadioPanelLayout.setHorizontalGroup(
1621 includeRadioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1622 .addGroup(includeRadioPanelLayout.createSequentialGroup()
1623 .addComponent(filler2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1624 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 58, Short.MAX_VALUE)
1625 .addComponent(includeRadioButton))
1627 includeRadioPanelLayout.setVerticalGroup(
1628 includeRadioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1629 .addComponent(filler2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1630 .addComponent(includeRadioButton)
1633 gridBagConstraints =
new java.awt.GridBagConstraints();
1634 gridBagConstraints.gridx = 0;
1635 gridBagConstraints.gridy = 10;
1636 gridBagConstraints.gridwidth = 2;
1637 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1638 gridBagConstraints.weightx = 1.0;
1639 filtersPanel.add(includeRadioPanel, gridBagConstraints);
1641 parentTextField.setEnabled(
false);
1643 javax.swing.GroupLayout parentTextPanelLayout =
new javax.swing.GroupLayout(parentTextPanel);
1644 parentTextPanel.setLayout(parentTextPanelLayout);
1645 parentTextPanelLayout.setHorizontalGroup(
1646 parentTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1647 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, parentTextPanelLayout.createSequentialGroup()
1649 .addComponent(parentTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 71, Short.MAX_VALUE))
1651 parentTextPanelLayout.setVerticalGroup(
1652 parentTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1653 .addComponent(parentTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1656 gridBagConstraints =
new java.awt.GridBagConstraints();
1657 gridBagConstraints.gridx = 1;
1658 gridBagConstraints.gridy = 11;
1659 gridBagConstraints.gridwidth = 2;
1660 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1661 gridBagConstraints.weightx = 1.5;
1662 gridBagConstraints.insets =
new java.awt.Insets(0, 4, 4, 0);
1663 filtersPanel.add(parentTextPanel, gridBagConstraints);
1665 filtersScrollPane.setViewportView(filtersPanel);
1667 org.openide.awt.Mnemonics.setLocalizedText(searchButton,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.searchButton.text"));
1668 searchButton.addActionListener(
new java.awt.event.ActionListener() {
1669 public void actionPerformed(java.awt.event.ActionEvent evt) {
1670 searchButtonActionPerformed(evt);
1674 sortingPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.sortingPanel.border.title")));
1675 sortingPanel.setPreferredSize(
new java.awt.Dimension(345, 112));
1677 org.openide.awt.Mnemonics.setLocalizedText(orderGroupsByLabel,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.orderGroupsByLabel.text"));
1679 org.openide.awt.Mnemonics.setLocalizedText(orderByLabel,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.orderByLabel.text"));
1681 org.openide.awt.Mnemonics.setLocalizedText(groupByLabel,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.groupByLabel.text"));
1683 javax.swing.GroupLayout sortingPanelLayout =
new javax.swing.GroupLayout(sortingPanel);
1684 sortingPanel.setLayout(sortingPanelLayout);
1685 sortingPanelLayout.setHorizontalGroup(
1686 sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1687 .addGroup(sortingPanelLayout.createSequentialGroup()
1689 .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1690 .addComponent(orderGroupsByLabel)
1691 .addGroup(sortingPanelLayout.createSequentialGroup()
1692 .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1693 .addComponent(groupByLabel)
1694 .addComponent(orderByLabel))
1695 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1696 .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
1697 .addComponent(groupSortingComboBox, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1698 .addComponent(orderByCombobox, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1699 .addComponent(groupByCombobox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
1702 sortingPanelLayout.setVerticalGroup(
1703 sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1704 .addGroup(sortingPanelLayout.createSequentialGroup()
1706 .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1707 .addComponent(groupByCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1708 .addComponent(groupByLabel))
1709 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1710 .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1711 .addComponent(groupSortingComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1712 .addComponent(orderGroupsByLabel))
1713 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1714 .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1715 .addComponent(orderByCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1716 .addComponent(orderByLabel))
1720 errorLabel.setForeground(
new java.awt.Color(255, 0, 0));
1722 org.openide.awt.Mnemonics.setLocalizedText(cancelButton,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.cancelButton.text"));
1723 cancelButton.setEnabled(
false);
1724 cancelButton.addActionListener(
new java.awt.event.ActionListener() {
1725 public void actionPerformed(java.awt.event.ActionEvent evt) {
1726 cancelButtonActionPerformed(evt);
1730 org.openide.awt.Mnemonics.setLocalizedText(stepThreeLabel,
org.openide.util.NbBundle.getMessage(FileSearchPanel.class,
"FileSearchPanel.stepThreeLabel.text"));
1732 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
1733 this.setLayout(layout);
1734 layout.setHorizontalGroup(
1735 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1736 .addGroup(layout.createSequentialGroup()
1738 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1739 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
1740 .addComponent(stepTwoLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1742 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
1743 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
1744 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
1745 .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1746 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1747 .addComponent(cancelButton)
1748 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1749 .addComponent(searchButton))
1750 .addComponent(stepThreeLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1751 .addComponent(filtersScrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1752 .addComponent(sortingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE))
1756 layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] {cancelButton, searchButton});
1758 layout.setVerticalGroup(
1759 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1760 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
1762 .addComponent(stepTwoLabel)
1763 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1764 .addComponent(filtersScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE)
1765 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1766 .addComponent(stepThreeLabel)
1767 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1768 .addComponent(sortingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1769 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1770 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1771 .addComponent(errorLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
1772 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1773 .addComponent(cancelButton)
1774 .addComponent(searchButton)))
1779 private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {
1781 List<FileSearchFiltering.FileFilter> filters = getFilters();
1782 enableSearch(
false);
1783 DiscoveryEventUtils.getDiscoveryEventBus().post(
new DiscoveryEventUtils.SearchStartedEvent(fileType));
1786 FileSearch.AttributeType groupingAttr = getGroupingAttribute();
1787 FileGroup.GroupSortingAlgorithm groupSortAlgorithm = getGroupSortingMethod();
1790 FileSorter.SortingMethod fileSort = getFileSortingMethod();
1791 CentralRepository centralRepoDb = null;
1792 if (CentralRepository.isEnabled()) {
1794 centralRepoDb = CentralRepository.getInstance();
1795 }
catch (CentralRepoException ex) {
1796 centralRepoDb = null;
1797 logger.log(Level.SEVERE,
"Error loading central repository database, no central repository options will be available for File Discovery", ex);
1800 searchWorker =
new SearchWorker(centralRepoDb, filters, groupingAttr, groupSortAlgorithm, fileSort);
1801 searchWorker.execute();
1811 private void enableSearch(
boolean enabled) {
1813 DiscoveryTopComponent.getTopComponent().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
1815 DiscoveryTopComponent.getTopComponent().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
1817 if (null != fileType) {
1820 imagesSelected(enabled,
false);
1823 videosSelected(enabled,
false);
1826 documentsSelected(enabled,
false);
1832 searchButton.setEnabled(enabled);
1833 cancelButton.setEnabled(!enabled);
1834 orderByCombobox.setEnabled(enabled);
1835 groupByCombobox.setEnabled(enabled);
1836 groupSortingComboBox.setEnabled(enabled);
1845 void handleSearchCancelledEvent(DiscoveryEventUtils.SearchCancelledEvent searchCancelledEvent) {
1846 SwingUtilities.invokeLater(() -> {
1857 void handleSearchCompleteEvent(DiscoveryEventUtils.SearchCompleteEvent searchCompleteEvent) {
1858 SwingUtilities.invokeLater(() -> {
1863 private void parentCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1864 parentFilterSettings(
true,
true, parentCheckbox.isSelected(), null);
1867 private void keywordCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1868 keywordList.setEnabled(keywordCheckbox.isSelected());
1871 private void sizeCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1872 sizeList.setEnabled(sizeCheckbox.isSelected());
1875 private void crFrequencyCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1876 crFrequencyList.setEnabled(crFrequencyCheckbox.isSelected());
1879 private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {
1880 if (!parentTextField.getText().isEmpty()) {
1881 ParentSearchTerm searchTerm;
1882 searchTerm =
new ParentSearchTerm(parentTextField.getText(), fullRadioButton.isSelected(), includeRadioButton.isSelected());
1883 parentListModel.add(parentListModel.size(), searchTerm);
1885 parentTextField.setText(
"");
1892 void cancelSearch() {
1893 if (searchWorker != null) {
1894 searchWorker.cancel(
true);
1898 private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {
1899 int index = parentList.getSelectedIndex();
1901 parentListModel.remove(index);
1906 private void parentListValueChanged(javax.swing.event.ListSelectionEvent evt) {
1907 if (parentList.getSelectedValuesList().isEmpty()) {
1908 deleteButton.setEnabled(
false);
1910 deleteButton.setEnabled(
true);
1914 private void dataSourceCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1915 dataSourceList.setEnabled(dataSourceCheckbox.isSelected());
1918 private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {
1922 private void hashSetCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1923 hashSetList.setEnabled(hashSetCheckbox.isSelected());
1926 private void objectsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1927 objectsList.setEnabled(objectsCheckbox.isSelected());
1930 private void tagsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1931 tagsList.setEnabled(tagsCheckbox.isSelected());
1934 private void interestingItemsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1935 interestingItemsList.setEnabled(interestingItemsCheckbox.isSelected());
1938 private void scoreCheckboxActionPerformed(java.awt.event.ActionEvent evt) {
1939 scoreList.setEnabled(scoreCheckbox.isSelected());
1944 private javax.swing.JButton addButton;
1945 private javax.swing.JButton cancelButton;
1946 private javax.swing.JCheckBox crFrequencyCheckbox;
1947 private javax.swing.JList<Frequency> crFrequencyList;
1948 private javax.swing.JScrollPane crFrequencyScrollPane;
1949 private javax.swing.JCheckBox dataSourceCheckbox;
1950 private javax.swing.JList<DataSourceItem> dataSourceList;
1951 private javax.swing.JScrollPane dataSourceScrollPane;
1952 private javax.swing.JButton deleteButton;
1953 private javax.swing.JLabel errorLabel;
1954 private javax.swing.JRadioButton excludeRadioButton;
1955 private javax.swing.JRadioButton fullRadioButton;
1956 private javax.swing.JComboBox<GroupingAttributeType> groupByCombobox;
1957 private javax.swing.JComboBox<GroupSortingAlgorithm> groupSortingComboBox;
1958 private javax.swing.JCheckBox hashSetCheckbox;
1959 private javax.swing.JList<String> hashSetList;
1960 private javax.swing.JScrollPane hashSetScrollPane;
1961 private javax.swing.JRadioButton includeRadioButton;
1962 private javax.swing.JCheckBox interestingItemsCheckbox;
1963 private javax.swing.JList<String> interestingItemsList;
1964 private javax.swing.JScrollPane interestingItemsScrollPane;
1965 private javax.swing.JCheckBox keywordCheckbox;
1966 private javax.swing.JList<String> keywordList;
1967 private javax.swing.JScrollPane keywordScrollPane;
1968 private javax.swing.JCheckBox knownFilesCheckbox;
1969 private javax.swing.JCheckBox notableCheckbox;
1970 private javax.swing.JCheckBox objectsCheckbox;
1971 private javax.swing.JList<String> objectsList;
1972 private javax.swing.JScrollPane objectsScrollPane;
1973 private javax.swing.JComboBox<SortingMethod> orderByCombobox;
1974 private javax.swing.JCheckBox parentCheckbox;
1975 private javax.swing.JList<ParentSearchTerm> parentList;
1976 private javax.swing.JScrollPane parentScrollPane;
1977 private javax.swing.JTextField parentTextField;
1978 private javax.swing.JCheckBox scoreCheckbox;
1979 private javax.swing.JList<Score> scoreList;
1980 private javax.swing.JScrollPane scoreScrollPane;
1981 private javax.swing.JButton searchButton;
1982 private javax.swing.JCheckBox sizeCheckbox;
1983 private javax.swing.JList<FileSize> sizeList;
1984 private javax.swing.JScrollPane sizeScrollPane;
1985 private javax.swing.JLabel stepTwoLabel;
1986 private javax.swing.JRadioButton substringRadioButton;
1987 private javax.swing.JCheckBox tagsCheckbox;
1988 private javax.swing.JList<TagName> tagsList;
1989 private javax.swing.JScrollPane tagsScrollPane;
1990 private javax.swing.JCheckBox userCreatedCheckbox;