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);
|
getComponent().addActionListener(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addPropertyChangeListener(PropertyChangeListener listener) {
|
|
||||||
getComponent().addPropertyChangeListener(listener);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
if (!isEnabled()) {
|
return this.getComponent().isValidSearch();
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return this.getComponent().isSearchable();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -430,7 +430,7 @@ class DateSearchPanel extends javax.swing.JPanel {
|
|||||||
dateToButtonCalendar.setTargetDate(date);
|
dateToButtonCalendar.setTargetDate(date);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isSearchable() {
|
boolean isValidSearch() {
|
||||||
return this.accessedCheckBox.isSelected() ||
|
return this.accessedCheckBox.isSelected() ||
|
||||||
this.changedCheckBox.isSelected() ||
|
this.changedCheckBox.isSelected() ||
|
||||||
this.createdCheckBox.isSelected() ||
|
this.createdCheckBox.isSelected() ||
|
||||||
|
@ -25,7 +25,7 @@ import javax.swing.JComponent;
|
|||||||
/**
|
/**
|
||||||
* Provides a filter and the panel to display it to the FileSearchTopComponent
|
* Provides a filter and the panel to display it to the FileSearchTopComponent
|
||||||
*/
|
*/
|
||||||
interface FileSearchFilter {
|
interface FileSearchFilter {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the panel to put in the File Search pane.
|
* Gets the panel to put in the File Search pane.
|
||||||
@ -41,6 +41,11 @@ import javax.swing.JComponent;
|
|||||||
*/
|
*/
|
||||||
boolean isEnabled();
|
boolean isEnabled();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the panel has valid input for search.
|
||||||
|
*
|
||||||
|
* @return Whether the panel has valid input for search.
|
||||||
|
*/
|
||||||
boolean isValid();
|
boolean isValid();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,6 +64,11 @@ import javax.swing.JComponent;
|
|||||||
*/
|
*/
|
||||||
void addActionListener(ActionListener l);
|
void addActionListener(ActionListener l);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the property change listener to the panel
|
||||||
|
*
|
||||||
|
* @param listener the listener to add.
|
||||||
|
*/
|
||||||
void addPropertyChangeListener(PropertyChangeListener listener);
|
void addPropertyChangeListener(PropertyChangeListener listener);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -105,7 +105,7 @@ class FileSearchPanel extends javax.swing.JPanel {
|
|||||||
filter.addPropertyChangeListener(new PropertyChangeListener() {
|
filter.addPropertyChangeListener(new PropertyChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
searchButton.setEnabled(isSearchable());
|
searchButton.setEnabled(isValidSearch());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -116,13 +116,13 @@ class FileSearchPanel extends javax.swing.JPanel {
|
|||||||
search();
|
search();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
searchButton.setEnabled(isSearchable());
|
searchButton.setEnabled(isValidSearch());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if any of the filters in the panel are enabled (checked)
|
* @return true if any of the filters in the panel are enabled (checked)
|
||||||
*/
|
*/
|
||||||
private boolean isSearchable() {
|
private boolean isValidSearch() {
|
||||||
boolean enabled = false;
|
boolean enabled = false;
|
||||||
for (FileSearchFilter filter : this.getFilters()) {
|
for (FileSearchFilter filter : this.getFilters()) {
|
||||||
if (filter.isEnabled()) {
|
if (filter.isEnabled()) {
|
||||||
@ -144,7 +144,7 @@ class FileSearchPanel extends javax.swing.JPanel {
|
|||||||
// change the cursor to "waiting cursor" for this operation
|
// change the cursor to "waiting cursor" for this operation
|
||||||
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||||
try {
|
try {
|
||||||
if (this.isSearchable()) {
|
if (this.isValidSearch()) {
|
||||||
String title = NbBundle.getMessage(this.getClass(), "FileSearchPanel.search.results.title", ++resultWindowCount);
|
String title = NbBundle.getMessage(this.getClass(), "FileSearchPanel.search.results.title", ++resultWindowCount);
|
||||||
String pathText = NbBundle.getMessage(this.getClass(), "FileSearchPanel.search.results.pathText");
|
String pathText = NbBundle.getMessage(this.getClass(), "FileSearchPanel.search.results.pathText");
|
||||||
|
|
||||||
|
@ -86,10 +86,6 @@ class KnownStatusSearchFilter extends AbstractFileSearchFilter<KnownStatusSearch
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
if (!isEnabled()) {
|
return this.getComponent().isValidSearch();
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return this.getComponent().isSearchable();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ class KnownStatusSearchPanel extends javax.swing.JPanel {
|
|||||||
pcs.removePropertyChangeListener(pcl);
|
pcs.removePropertyChangeListener(pcl);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isSearchable() {
|
boolean isValidSearch() {
|
||||||
return this.unknownOptionCheckBox.isSelected() || this.knownBadOptionCheckBox.isSelected() || this.knownOptionCheckBox.isSelected();
|
return this.unknownOptionCheckBox.isSelected() || this.knownBadOptionCheckBox.isSelected() || this.knownOptionCheckBox.isSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,10 +43,6 @@ class MimeTypeFilter extends AbstractFileSearchFilter<MimeTypePanel> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
if (!isEnabled()) {
|
return !this.getComponent().getMimeTypesSelected().isEmpty();
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return !this.getComponent().getMimeTypesSelected().isEmpty();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,10 +65,6 @@ class NameSearchFilter extends AbstractFileSearchFilter<NameSearchPanel> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
if (!isEnabled()) {
|
return !this.getComponent().getSearchTextField().getText().isEmpty();
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return !this.getComponent().getSearchTextField().getText().isEmpty();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user