19 package org.sleuthkit.autopsy.datamodel.persons;
21 import java.awt.event.ActionEvent;
22 import java.util.List;
23 import java.util.logging.Level;
24 import javax.swing.AbstractAction;
25 import javax.swing.JOptionPane;
26 import org.apache.commons.collections.CollectionUtils;
27 import org.openide.util.NbBundle.Messages;
28 import org.openide.windows.WindowManager;
40 "DeletePersonAction_menuTitle=Delete Person",
41 "DeletePersonAction_onError_title=Error Delete Host from Person",
43 "DeletePersonAction_onError_description=There was an error removing person: {0}.",})
56 super(Bundle.DeletePersonAction_menuTitle());
66 this.setEnabled(
false);
70 if (CollectionUtils.isNotEmpty(hosts)) {
71 this.setEnabled(
false);
75 logger.log(Level.WARNING, String.format(
"Unable to fetch hosts belonging to person: %s", person.getName() == null ?
"<null>" : person.getName(), ex));
77 this.setEnabled(
true);
83 if (person != null && person.getName() != null) {
87 String personName = this.person == null || this.person.getName() == null ?
"" : this.person.getName();
88 logger.log(Level.WARNING, String.format(
"Unable to remove parent from host: %s", personName), ex);
90 JOptionPane.showMessageDialog(
91 WindowManager.getDefault().getMainWindow(),
92 Bundle.DeletePersonAction_onError_description(personName),
93 Bundle.DeletePersonAction_onError_title(),
94 JOptionPane.WARNING_MESSAGE);
DeletePersonAction(Person person)
SleuthkitCase getSleuthkitCase()
void actionPerformed(ActionEvent e)
synchronized static Logger getLogger(String name)
static Case getCurrentCaseThrows()