19 package org.sleuthkit.autopsy.ingest;
21 import java.awt.EventQueue;
22 import java.beans.PropertyChangeEvent;
23 import java.beans.PropertyChangeListener;
24 import javax.swing.JTabbedPane;
25 import javax.swing.event.ChangeEvent;
26 import javax.swing.event.ChangeListener;
27 import org.openide.util.NbBundle;
35 @SuppressWarnings(
"PMD.SingularField")
38 @NbBundle.Messages({
"IngestOptionsPanel.settingsTab.text=Settings",
39 "IngestOptionsPanel.settingsTab.toolTipText=Settings regarding resources available to ingest.",
40 "IngestOptionsPanel.fileFiltersTab.text=File Filters",
41 "IngestOptionsPanel.fileFiltersTab.toolTipText=Settings for creating and editing ingest file filters.",
42 "IngestOptionsPanel.profilesTab.text=Profiles",
43 "IngestOptionsPanel.profilesTab.toolTipText=Settings for creating and editing profiles."})
46 private final static int INDEX_OF_FILTER_PANEL = 0;
48 private final static int INDEX_OF_SETTINGS_PANEL = 2;
50 private final static int INDEX_OF_PROFILE_PANEL = 1;
62 customizeComponents();
63 indexOfPreviousTab = tabbedPane.getSelectedIndex();
68 settingsPanel =
new IngestSettingsPanel();
69 profilePanel =
new ProfileSettingsPanel();
71 tabbedPane.insertTab(NbBundle.getMessage(
IngestOptionsPanel.class,
"IngestOptionsPanel.fileFiltersTab.text"), null,
72 filterPanel, NbBundle.getMessage(
IngestOptionsPanel.class,
"IngestOptionsPanel.fileFiltersTab.toolTipText"), INDEX_OF_FILTER_PANEL);
73 tabbedPane.insertTab(NbBundle.getMessage(
IngestOptionsPanel.class,
"IngestOptionsPanel.profilesTab.text"), null,
74 profilePanel, NbBundle.getMessage(
IngestOptionsPanel.class,
"IngestOptionsPanel.profilesTab.toolTipText"), INDEX_OF_PROFILE_PANEL);
75 tabbedPane.insertTab(NbBundle.getMessage(
IngestOptionsPanel.class,
"IngestOptionsPanel.settingsTab.text"), null,
76 settingsPanel, NbBundle.getMessage(
IngestOptionsPanel.class,
"IngestOptionsPanel.settingsTab.toolTipText"), INDEX_OF_SETTINGS_PANEL);
80 tabbedPane.addChangeListener(
new ChangeListener() {
82 public void stateChanged(ChangeEvent e) {
83 if (e.getSource() instanceof JTabbedPane) {
87 if (tabbedPane.getSelectedIndex() == INDEX_OF_FILTER_PANEL && tabbedPane.getSelectedIndex() != indexOfPreviousTab) {
91 saveTabByIndex(indexOfPreviousTab);
93 indexOfPreviousTab = tabbedPane.getSelectedIndex();
98 addIngestJobEventsListener();
120 EventQueue.invokeLater(
new Runnable() {
135 tabbedPane.setEnabled(!ingestIsRunning);
136 settingsPanel.enableButtons(!ingestIsRunning);
137 profilePanel.enableButtons(!ingestIsRunning);
138 filterPanel.enableButtons();
144 super.addPropertyChangeListener(l);
164 if (null != filterPanel) {
165 filterPanel.addPropertyChangeListener(l);
167 if (null != settingsPanel) {
168 settingsPanel.addPropertyChangeListener(l);
170 if (null != profilePanel) {
171 profilePanel.addPropertyChangeListener(l);
177 filterPanel.removePropertyChangeListener(l);
178 settingsPanel.removePropertyChangeListener(l);
179 profilePanel.removePropertyChangeListener(l);
184 saveTabByIndex(tabbedPane.getSelectedIndex());
196 case (INDEX_OF_FILTER_PANEL):
197 filterPanel.saveSettings();
199 case (INDEX_OF_PROFILE_PANEL):
200 profilePanel.saveSettings();
202 case (INDEX_OF_SETTINGS_PANEL):
203 settingsPanel.saveSettings();
218 settingsPanel.load();
241 tabbedPane =
new javax.swing.JTabbedPane();
243 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
244 this.setLayout(layout);
245 layout.setHorizontalGroup(
246 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
247 .addGroup(layout.createSequentialGroup()
248 .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 824, Short.MAX_VALUE)
251 layout.setVerticalGroup(
252 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
253 .addGroup(layout.createSequentialGroup()
254 .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 543, Short.MAX_VALUE)
ProfileSettingsPanel profilePanel
static synchronized IngestManager getInstance()
void addPropertyChangeListener(PropertyChangeListener l)
void propertyChange(PropertyChangeEvent evt)
boolean isIngestRunning()
void addIngestJobEventsListener()
IngestSettingsPanel settingsPanel
void addIngestJobEventListener(final PropertyChangeListener listener)
void customizeComponents()
void removePropertyChangeListener(PropertyChangeListener l)
void saveTabByIndex(int index)
javax.swing.JTabbedPane tabbedPane