6639 fix appearance of past occrrurences filter

This commit is contained in:
William Schaefer 2020-08-17 10:06:59 -04:00
parent e2a7b72525
commit d0be74fc65
2 changed files with 7 additions and 14 deletions

View File

@ -39,12 +39,11 @@ public class DomainFilterPanel extends AbstractFiltersPanel {
addFilter(new ArtifactTypeFilterPanel(), false, null, 1);
addFilter(new DateFilterPanel(), false, null, 1);
int[] pastOccurrencesIndices;
if (!CentralRepository.isEnabled()) {
pastOccurrencesIndices = new int[]{0};
} else {
if (CentralRepository.isEnabled()) {
pastOccurrencesIndices = new int[]{2, 3, 4};
addFilter(new PastOccurrencesFilterPanel(), true, pastOccurrencesIndices, 0);
}
addFilter(new PastOccurrencesFilterPanel(), true, pastOccurrencesIndices, 0);
addPanelsToScrollPane(domainFiltersSplitPane);
}

View File

@ -38,15 +38,9 @@ final class PastOccurrencesFilterPanel extends AbstractDiscoveryFilterPanel {
*/
PastOccurrencesFilterPanel() {
initComponents();
setUpFrequencyFilter(ResultType.FILE);
}
/**
* Creates new form PastOccurrencesFilterPanel.
*/
PastOccurrencesFilterPanel(ResultType type) {
initComponents();
setUpFrequencyFilter(type);
setUpFrequencyFilter();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
@ -101,11 +95,11 @@ final class PastOccurrencesFilterPanel extends AbstractDiscoveryFilterPanel {
/**
* Initialize the frequency filter.
*/
private void setUpFrequencyFilter(ResultType type) {
private void setUpFrequencyFilter() {
int count = 0;
DefaultListModel<FileSearchData.Frequency> frequencyListModel = (DefaultListModel<FileSearchData.Frequency>) crFrequencyList.getModel();
frequencyListModel.removeAllElements();
if (!CentralRepository.isEnabled() && type != ResultType.ATTRIBUTE) {
if (!CentralRepository.isEnabled()) {
for (FileSearchData.Frequency freq : FileSearchData.Frequency.getOptionsForFilteringWithoutCr()) {
frequencyListModel.add(count, freq);
}