19 package org.sleuthkit.autopsy.ingest;
21 import java.awt.BorderLayout;
22 import java.awt.Dimension;
23 import java.awt.Toolkit;
24 import java.awt.event.ActionEvent;
25 import java.awt.event.ActionListener;
26 import java.awt.event.WindowAdapter;
27 import java.awt.event.WindowEvent;
28 import java.util.ArrayList;
29 import java.util.List;
30 import javax.swing.BoxLayout;
31 import javax.swing.JButton;
32 import javax.swing.JDialog;
33 import javax.swing.JFrame;
34 import javax.swing.JOptionPane;
35 import javax.swing.JPanel;
36 import org.openide.util.NbBundle;
46 private static Dimension
DIMENSIONS =
new Dimension(500, 300);
60 super(frame, title, modal);
61 this.dataSources.addAll(dataSources);
85 super(frame, title, modal);
96 this(
new JFrame(TITLE),
TITLE,
true);
107 this.dataSources.clear();
108 this.dataSources.addAll(dataSources);
115 setLayout(
new BorderLayout());
120 Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
122 int width = this.getSize().width;
123 int height = this.getSize().height;
124 setLocation((screenDimension.width - width) / 2, (screenDimension.height - height) / 2);
133 add(this.ingestJobSettingsPanel, BorderLayout.PAGE_START);
136 JButton startButton =
new JButton(NbBundle.getMessage(
this.getClass(),
"IngestDialog.startButton.title"));
137 startButton.addActionListener(
new ActionListener() {
139 public void actionPerformed(ActionEvent e) {
145 JButton closeButton =
new JButton(NbBundle.getMessage(
this.getClass(),
"IngestDialog.closeButton.title"));
146 closeButton.addActionListener(
new ActionListener() {
148 public void actionPerformed(ActionEvent e) {
154 JPanel buttonPanel =
new JPanel();
155 buttonPanel.setLayout(
new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
156 buttonPanel.add(
new javax.swing.Box.Filler(
new Dimension(10, 10),
new Dimension(10, 10),
new Dimension(10, 10)));
157 buttonPanel.add(startButton);
158 buttonPanel.add(
new javax.swing.Box.Filler(
new Dimension(10, 10),
new Dimension(10, 10),
new Dimension(10, 10)));
159 buttonPanel.add(closeButton);
160 add(buttonPanel, BorderLayout.LINE_START);
166 this.addWindowListener(
new WindowAdapter() {
168 public void windowClosing(WindowEvent e) {
199 ingestJobSettings.
save();
201 if (startIngestJob) {
209 List<String> warnings = ingestJobSettings.
getWarnings();
210 if (warnings.isEmpty() ==
false) {
211 StringBuilder warningMessage =
new StringBuilder();
212 for (String warning : warnings) {
213 warningMessage.append(warning).append(
"\n");
215 JOptionPane.showMessageDialog(null, warningMessage.toString());
static void showWarnings(IngestJobSettings ingestJobSettings)
void doButtonAction(boolean startIngestJob)
static synchronized IngestManager getInstance()
IngestJobSettingsPanel ingestJobSettingsPanel
static final String TITLE
synchronized void queueIngestJob(Collection< Content > dataSources, IngestJobSettings settings)
final List< Content > dataSources
IngestJobSettings getSettings()
RunIngestModulesDialog(List< Content > dataSources)
List< String > getWarnings()
void setDataSources(List< Content > dataSources)
RunIngestModulesDialog(JFrame frame, String title, boolean modal)
static Dimension DIMENSIONS
RunIngestModulesDialog(JFrame frame, String title, boolean modal, List< Content > dataSources)