19 package org.sleuthkit.autopsy.datamodel.hosts;
21 import java.awt.event.ActionEvent;
22 import java.util.logging.Level;
23 import javax.swing.AbstractAction;
24 import javax.swing.JOptionPane;
25 import javax.swing.SwingWorker;
26 import org.openide.util.NbBundle;
27 import org.openide.util.NbBundle.Messages;
28 import org.openide.windows.WindowManager;
39 "MergeHostAction_onError_title=Error Merging Hosts",
40 "# {0} - sourceHostName",
41 "# {1} - destHostName",
42 "MergeHostAction_onError_description=There was an error merging host {0} into host {1}.",})
57 super(destHost.getName());
59 this.sourceHost = sourceHost;
60 this.destHost = destHost;
64 "MergeHostAction.progressIndicatorName=Merging Hosts",
65 "MergeHostAction.confirmTitle=Confirmation",
68 "MergeHostAction.confirmText=Are you sure you want to merge {0} into {1}?\nThis may include merging OS Accounts and cannot be undone.",
71 "MergeHostAction.progressText=Merging {0} into {1}..."
77 int response = JOptionPane.showConfirmDialog(
78 WindowManager.getDefault().getMainWindow(),
79 NbBundle.getMessage(this.getClass(),
"MergeHostAction.confirmText", sourceHost.getName(), destHost.getName()),
80 NbBundle.getMessage(
this.getClass(),
"MergeHostAction.confirmTitle"),
81 JOptionPane.YES_NO_OPTION);
82 if (response == JOptionPane.NO_OPTION) {
87 Bundle.MergeHostAction_progressIndicatorName());
90 progressDialog.
start(NbBundle.getMessage(
this.getClass(),
"MergeHostAction.progressText", sourceHost.getName(), destHost.getName()));
104 this.sourceHost = sourceHost;
105 this.destHost = destHost;
106 this.progress = progress;
116 "MergeHostAction.errorTitle=Error Merging Hosts",
117 "MergeHostAction.errorText=An error occurred while merging hosts.\nTry again in a few minutes or check the log for details."
124 }
catch (Exception ex) {
125 logger.log(Level.SEVERE,
"Error merging " + sourceHost.getName() +
" into " + destHost.getName(), ex);
127 JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
128 NbBundle.getMessage(this.getClass(),
"MergeHostAction.errorText"),
129 NbBundle.getMessage(this.getClass(),
"MergeHostAction.errorTitle"),
130 JOptionPane.ERROR_MESSAGE);
MergeHostAction(Host sourceHost, Host destHost)
synchronized void start(String message, int totalWorkUnits)
SleuthkitCase getSleuthkitCase()
void actionPerformed(ActionEvent e)
synchronized static Logger getLogger(String name)
static Case getCurrentCaseThrows()
MergeHostsBackgroundTask(Host sourceHost, Host destHost, ProgressIndicator progress)
final ProgressIndicator progress