mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
reset controls on reopen
This commit is contained in:
parent
e082c4f376
commit
84179456c0
@ -60,7 +60,6 @@ public final class PersonasTopComponent extends TopComponent {
|
||||
private List<Persona> currentResults = null;
|
||||
private Persona selectedPersona = null;
|
||||
|
||||
|
||||
/**
|
||||
* Listens for when this component will be rendered and executes a search to
|
||||
* update gui when it is displayed.
|
||||
@ -68,7 +67,8 @@ public final class PersonasTopComponent extends TopComponent {
|
||||
private final AncestorListener onAddListener = new AncestorListener() {
|
||||
@Override
|
||||
public void ancestorAdded(AncestorEvent event) {
|
||||
setKeywordSearchEnabled(false);
|
||||
resetSearchControls();
|
||||
setKeywordSearchEnabled(false, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -82,14 +82,12 @@ public final class PersonasTopComponent extends TopComponent {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@Messages({
|
||||
"PersonasTopComponent_Name=Personas",
|
||||
"PersonasTopComponent_delete_exception_Title=Delete failure",
|
||||
"PersonasTopComponent_delete_exception_msg=Failed to delete persona.",
|
||||
"PersonasTopComponent_delete_confirmation_Title=Are you sure?",
|
||||
"PersonasTopComponent_delete_confirmation_msg=Are you sure you want to delete this persona?",
|
||||
})
|
||||
"PersonasTopComponent_delete_confirmation_msg=Are you sure you want to delete this persona?",})
|
||||
public PersonasTopComponent() {
|
||||
initComponents();
|
||||
setName(Bundle.PersonasTopComponent_Name());
|
||||
@ -188,8 +186,24 @@ public final class PersonasTopComponent extends TopComponent {
|
||||
}
|
||||
}
|
||||
|
||||
private void setKeywordSearchEnabled(boolean selected) {
|
||||
if (cbFilterByKeyword.isSelected() != selected) {
|
||||
/**
|
||||
* Resets search controls to default state.
|
||||
*/
|
||||
private void resetSearchControls() {
|
||||
searchField.setText("");
|
||||
searchNameRadio.setSelected(true);
|
||||
searchAccountRadio.setSelected(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up the GUI for appropriate state for keyword search enabled state.
|
||||
*
|
||||
* @param selected Whether or not keyword search is enabled.
|
||||
* @param setFilterCb Whether or not the filter checkbox should be
|
||||
* manipulated as a part of this change.
|
||||
*/
|
||||
private void setKeywordSearchEnabled(boolean selected, boolean setFilterCb) {
|
||||
if (setFilterCb && cbFilterByKeyword.isSelected() != selected) {
|
||||
cbFilterByKeyword.setSelected(selected);
|
||||
}
|
||||
|
||||
@ -284,8 +298,7 @@ public final class PersonasTopComponent extends TopComponent {
|
||||
} else {
|
||||
results = Persona.getPersonaByAccountIdentifierLike(searchField.getText());
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
results = Persona.getPersonaByName("");
|
||||
}
|
||||
} catch (CentralRepoException ex) {
|
||||
@ -466,7 +479,7 @@ public final class PersonasTopComponent extends TopComponent {
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void cbFilterByKeywordActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbFilterByKeywordActionPerformed
|
||||
setKeywordSearchEnabled(cbFilterByKeyword.isSelected());
|
||||
setKeywordSearchEnabled(cbFilterByKeyword.isSelected(), false);
|
||||
}//GEN-LAST:event_cbFilterByKeywordActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
|
Loading…
x
Reference in New Issue
Block a user