6 package org.sleuthkit.autopsy.filesearch;
8 import java.awt.event.ActionListener;
9 import org.openide.util.NbBundle.Messages;
14 class MimeTypeFilter
extends AbstractFileSearchFilter<MimeTypePanel> {
16 public MimeTypeFilter(MimeTypePanel component) {
20 public MimeTypeFilter() {
21 this(
new MimeTypePanel());
25 public boolean isEnabled() {
26 return this.getComponent().isSelected();
30 public String getPredicate() throws FilterValidationException {
31 String predicate =
"";
32 for (String mimeType : this.getComponent().getMimeTypesSelected()) {
33 predicate +=
"mime_type = '" + mimeType +
"' OR ";
35 if (predicate.length() > 3) {
36 predicate = predicate.substring(0, predicate.length() - 3);
42 public void addActionListener(ActionListener l) {
47 "MimeTypeFilter.errorMessage.emptyMimeType=At least one MIME type must be selected."
49 public boolean isValid() {
50 if(this.getComponent().getMimeTypesSelected().isEmpty()){
51 setLastError(Bundle.MimeTypeFilter_errorMessage_emptyMimeType());