19 package org.sleuthkit.autopsy.filesearch;
21 import java.awt.Component;
22 import java.util.Collections;
23 import java.util.List;
24 import javax.swing.BoxLayout;
25 import javax.swing.JComponent;
26 import javax.swing.JPanel;
27 import javax.swing.border.EmptyBorder;
35 class FilterArea
extends JPanel {
39 private final String title;
40 private List<FileSearchFilter> filters;
41 private JPanel filtersPanel;
49 FilterArea(String title, FileSearchFilter filter) {
50 this(title, Collections.singletonList(filter));
59 FilterArea(String title, List<FileSearchFilter> filters) {
61 this.filters = filters;
72 List<FileSearchFilter> getFilters() {
92 filtersPanel =
new JPanel();
93 filtersPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
95 BoxLayout filtersPanelLayout =
new BoxLayout(
this, BoxLayout.Y_AXIS);
96 this.setLayout(filtersPanelLayout);
98 for (
int i = 0; i < filters.size(); i++) {
99 FileSearchFilter f = filters.get(i);
100 JComponent filterComponent = f.getComponent();
101 filterComponent.setAlignmentX(Component.LEFT_ALIGNMENT);
102 if (i != filters.size() - 1) {
103 filterComponent.setBorder(
new EmptyBorder(0, 0, 15, 0));
106 filterComponent.setBorder(
new EmptyBorder(0, 0, 18, 0));
108 this.add(filterComponent);
110 this.setAlignmentX(Component.LEFT_ALIGNMENT);
113 private void refresh() {