19 package org.sleuthkit.autopsy.commandlineingest;
21 import java.awt.BorderLayout;
22 import java.awt.Cursor;
23 import java.util.List;
24 import javax.swing.JOptionPane;
27 import org.openide.windows.WindowManager;
34 @SuppressWarnings(
"PMD.SingularField")
37 private static final long serialVersionUID = 1L;
40 private static final String REPORTING_CONFIGURATION_NAME =
"CommandLineIngest";
41 private static final boolean DISPLAY_CASE_SPECIFIC_DATA =
false;
42 private static final boolean RUN_REPORTS =
false;
57 return REPORTING_CONFIGURATION_NAME;
61 this.getParent().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
64 showWarnings(ingestJobSettings);
67 add(ingestJobSettingsPanel, BorderLayout.PAGE_START);
69 if (JOptionPane.showConfirmDialog(
this, ingestJobSettingsPanel,
"Ingest Module Configuration", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE) == JOptionPane.OK_OPTION) {
71 ingestJobSettings = ingestJobSettingsPanel.
getSettings();
72 ingestJobSettings.
save();
73 showWarnings(ingestJobSettings);
76 this.getParent().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
80 List<String> warnings = ingestJobSettings.
getWarnings();
81 if (warnings.isEmpty() ==
false) {
82 StringBuilder warningMessage =
new StringBuilder();
83 for (String warning : warnings) {
84 warningMessage.append(warning).append(
"\n");
86 JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), warningMessage.toString());
95 @SuppressWarnings(
"unchecked")
97 private
void initComponents() {
99 nodeScrollPane =
new javax.swing.JScrollPane();
100 nodePanel =
new javax.swing.JPanel();
101 bnEditIngestSettings =
new javax.swing.JButton();
102 jLabelDescription =
new javax.swing.JLabel();
103 bnEditReportSettings =
new javax.swing.JButton();
105 setPreferredSize(
new java.awt.Dimension(810, 422));
107 nodeScrollPane.setMinimumSize(
new java.awt.Dimension(0, 0));
108 nodeScrollPane.setPreferredSize(
new java.awt.Dimension(803, 553));
110 nodePanel.setMinimumSize(
new java.awt.Dimension(100, 100));
111 nodePanel.setPreferredSize(
new java.awt.Dimension(801, 551));
113 org.openide.awt.Mnemonics.setLocalizedText(bnEditIngestSettings,
org.openide.util.NbBundle.getMessage(
CommandLineIngestSettingsPanel.class,
"CommandLineIngestSettingsPanel.bnEditIngestSettings.text"));
114 bnEditIngestSettings.setToolTipText(
org.openide.util.NbBundle.getMessage(
CommandLineIngestSettingsPanel.class,
"CommandLineIngestSettingsPanel.bnEditIngestSettings.toolTipText"));
115 bnEditIngestSettings.setActionCommand(
org.openide.util.NbBundle.getMessage(
CommandLineIngestSettingsPanel.class,
"CommandLineIngestSettingsPanel.bnEditIngestSettings.text"));
116 bnEditIngestSettings.addActionListener(
new java.awt.event.ActionListener() {
117 public void actionPerformed(java.awt.event.ActionEvent evt) {
118 bnEditIngestSettingsActionPerformed(evt);
122 org.openide.awt.Mnemonics.setLocalizedText(jLabelDescription,
org.openide.util.NbBundle.getMessage(
CommandLineIngestSettingsPanel.class,
"CommandLineIngestSettingsPanel.jLabelDescription.text"));
124 org.openide.awt.Mnemonics.setLocalizedText(bnEditReportSettings,
org.openide.util.NbBundle.getMessage(
CommandLineIngestSettingsPanel.class,
"CommandLineIngestSettingsPanel.bnEditReportSettings.text"));
125 bnEditReportSettings.setToolTipText(
org.openide.util.NbBundle.getMessage(
CommandLineIngestSettingsPanel.class,
"CommandLineIngestSettingsPanel.bnEditReportSettings.toolTipText"));
126 bnEditReportSettings.setActionCommand(
org.openide.util.NbBundle.getMessage(
CommandLineIngestSettingsPanel.class,
"CommandLineIngestSettingsPanel.bnEditReportSettings.actionCommand"));
127 bnEditReportSettings.addActionListener(
new java.awt.event.ActionListener() {
128 public void actionPerformed(java.awt.event.ActionEvent evt) {
129 bnEditReportSettingsActionPerformed(evt);
133 javax.swing.GroupLayout nodePanelLayout =
new javax.swing.GroupLayout(nodePanel);
134 nodePanel.setLayout(nodePanelLayout);
135 nodePanelLayout.setHorizontalGroup(
136 nodePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
137 .addGroup(nodePanelLayout.createSequentialGroup()
139 .addGroup(nodePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
140 .addComponent(bnEditIngestSettings, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
141 .addComponent(jLabelDescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
142 .addComponent(bnEditReportSettings, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE))
143 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
145 nodePanelLayout.setVerticalGroup(
146 nodePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
147 .addGroup(nodePanelLayout.createSequentialGroup()
149 .addComponent(jLabelDescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
150 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
151 .addComponent(bnEditIngestSettings)
152 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
153 .addComponent(bnEditReportSettings)
154 .addContainerGap(381, Short.MAX_VALUE))
157 nodeScrollPane.setViewportView(nodePanel);
159 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
160 this.setLayout(layout);
161 layout.setHorizontalGroup(
162 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
163 .addComponent(nodeScrollPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
165 layout.setVerticalGroup(
166 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
167 .addComponent(nodeScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 421, Short.MAX_VALUE)
172 this.getParent().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
173 doReportWizard(getReportingConfigName(), DISPLAY_CASE_SPECIFIC_DATA, RUN_REPORTS);
174 this.getParent().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
178 displayIngestJobSettingsPanel();
void displayIngestJobSettingsPanel()
javax.swing.JScrollPane nodeScrollPane
static void showWarnings(IngestJobSettings ingestJobSettings)
javax.swing.JButton bnEditReportSettings
void bnEditReportSettingsActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JPanel nodePanel
static void doReportWizard(String configName, boolean displayCaseSpecificData, boolean runReports)
IngestJobSettings getSettings()
javax.swing.JLabel jLabelDescription
void bnEditIngestSettingsActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JButton bnEditIngestSettings
List< String > getWarnings()
synchronized static Logger getLogger(String name)
static String getReportingConfigName()
static String getCommandLineModeIngestModuleContextString()
CommandLineIngestSettingsPanel(CommandLineIngestSettingsPanelController theController)