mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Fixed semantics.
This commit is contained in:
parent
305c7a332b
commit
126c12d2d1
@ -205,19 +205,9 @@ class DateSearchFilter extends AbstractFileSearchFilter<DateSearchPanel> {
|
||||
getComponent().addActionListener(l);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPropertyChangeListener(PropertyChangeListener listener) {
|
||||
getComponent().addPropertyChangeListener(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
if (!isEnabled()) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return this.getComponent().isSearchable();
|
||||
}
|
||||
return this.getComponent().isValidSearch();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -430,7 +430,7 @@ class DateSearchPanel extends javax.swing.JPanel {
|
||||
dateToButtonCalendar.setTargetDate(date);
|
||||
}
|
||||
|
||||
boolean isSearchable() {
|
||||
boolean isValidSearch() {
|
||||
return this.accessedCheckBox.isSelected() ||
|
||||
this.changedCheckBox.isSelected() ||
|
||||
this.createdCheckBox.isSelected() ||
|
||||
|
@ -41,6 +41,11 @@ import javax.swing.JComponent;
|
||||
*/
|
||||
boolean isEnabled();
|
||||
|
||||
/**
|
||||
* Checks if the panel has valid input for search.
|
||||
*
|
||||
* @return Whether the panel has valid input for search.
|
||||
*/
|
||||
boolean isValid();
|
||||
|
||||
/**
|
||||
@ -59,6 +64,11 @@ import javax.swing.JComponent;
|
||||
*/
|
||||
void addActionListener(ActionListener l);
|
||||
|
||||
/**
|
||||
* Adds the property change listener to the panel
|
||||
*
|
||||
* @param listener the listener to add.
|
||||
*/
|
||||
void addPropertyChangeListener(PropertyChangeListener listener);
|
||||
|
||||
/**
|
||||
|
@ -105,7 +105,7 @@ class FileSearchPanel extends javax.swing.JPanel {
|
||||
filter.addPropertyChangeListener(new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
searchButton.setEnabled(isSearchable());
|
||||
searchButton.setEnabled(isValidSearch());
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -116,13 +116,13 @@ class FileSearchPanel extends javax.swing.JPanel {
|
||||
search();
|
||||
}
|
||||
});
|
||||
searchButton.setEnabled(isSearchable());
|
||||
searchButton.setEnabled(isValidSearch());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if any of the filters in the panel are enabled (checked)
|
||||
*/
|
||||
private boolean isSearchable() {
|
||||
private boolean isValidSearch() {
|
||||
boolean enabled = false;
|
||||
for (FileSearchFilter filter : this.getFilters()) {
|
||||
if (filter.isEnabled()) {
|
||||
@ -144,7 +144,7 @@ class FileSearchPanel extends javax.swing.JPanel {
|
||||
// change the cursor to "waiting cursor" for this operation
|
||||
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||
try {
|
||||
if (this.isSearchable()) {
|
||||
if (this.isValidSearch()) {
|
||||
String title = NbBundle.getMessage(this.getClass(), "FileSearchPanel.search.results.title", ++resultWindowCount);
|
||||
String pathText = NbBundle.getMessage(this.getClass(), "FileSearchPanel.search.results.pathText");
|
||||
|
||||
|
@ -86,10 +86,6 @@ class KnownStatusSearchFilter extends AbstractFileSearchFilter<KnownStatusSearch
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
if (!isEnabled()) {
|
||||
return true;
|
||||
} else {
|
||||
return this.getComponent().isSearchable();
|
||||
}
|
||||
return this.getComponent().isValidSearch();
|
||||
}
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ class KnownStatusSearchPanel extends javax.swing.JPanel {
|
||||
pcs.removePropertyChangeListener(pcl);
|
||||
}
|
||||
|
||||
boolean isSearchable() {
|
||||
boolean isValidSearch() {
|
||||
return this.unknownOptionCheckBox.isSelected() || this.knownBadOptionCheckBox.isSelected() || this.knownOptionCheckBox.isSelected();
|
||||
}
|
||||
|
||||
|
@ -43,10 +43,6 @@ class MimeTypeFilter extends AbstractFileSearchFilter<MimeTypePanel> {
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
if (!isEnabled()) {
|
||||
return true;
|
||||
} else {
|
||||
return !this.getComponent().getMimeTypesSelected().isEmpty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,10 +65,6 @@ class NameSearchFilter extends AbstractFileSearchFilter<NameSearchPanel> {
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
if (!isEnabled()) {
|
||||
return true;
|
||||
} else {
|
||||
return !this.getComponent().getSearchTextField().getText().isEmpty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user