Go to the documentation of this file.
19package org.sleuthkit.autopsy.datamodel.hosts;
22import java.awt.event.ActionEvent;
23import java.util.Collections;
24import java.util.logging.Level;
25import javax.swing.AbstractAction;
26import javax.swing.JOptionPane;
27import org.apache.commons.lang.StringUtils;
28import org.openide.util.NbBundle.Messages;
29import org.openide.windows.WindowManager;
30import org.sleuthkit.autopsy.casemodule.Case;
31import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
32import org.sleuthkit.autopsy.coreutils.Logger;
33import org.sleuthkit.autopsy.datamodel.persons.AddEditPersonDialog;
34import org.sleuthkit.datamodel.Host;
35import org.sleuthkit.datamodel.Person;
36import org.sleuthkit.datamodel.TskCoreException;
42 "AssociateNewPersonAction_menuTitle=New Person...",
43 "AssociateNewPersonAction_onError_title=Error While Associating New Person",
46 "AssociateNewPersonAction_onError_description=There was an error while associating host {0} with new person {1}."})
59 super(Bundle.AssociateNewPersonAction_menuTitle());
65 String newPersonName =
"";
68 if (StringUtils.isNotBlank(newPersonName)) {
73 String hostName = this.host ==
null || this.host.getName() ==
null ?
"" : this.host.getName();
74 logger.log(Level.WARNING, String.format(
"Unable to remove parent from host: %s", hostName), ex);
76 JOptionPane.showMessageDialog(
77 WindowManager.getDefault().getMainWindow(),
78 Bundle.AssociateNewPersonAction_onError_description(hostName, newPersonName),
79 Bundle.AssociateNewPersonAction_onError_title(),
80 JOptionPane.WARNING_MESSAGE);
93 Frame parent = WindowManager.getDefault().getMainWindow();
101 addEditDialog.setResizable(
false);
102 addEditDialog.setLocationRelativeTo(parent);
103 addEditDialog.setVisible(
true);
104 addEditDialog.toFront();
107 String newHostName = addEditDialog.
getValue();
SleuthkitCase getSleuthkitCase()
static Case getCurrentCaseThrows()
synchronized static Logger getLogger(String name)
String getAddDialogName()
static final Logger logger
void actionPerformed(ActionEvent e)
AssociateNewPersonAction(Host host)
Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.