Autopsy  4.7.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
IngestProfileSelectionWizardPanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2017 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.ingest.runIngestModuleWizard;
20 
21 import java.awt.Component;
22 import java.util.HashSet;
23 import java.util.Set;
24 import javax.swing.event.ChangeEvent;
25 import javax.swing.event.ChangeListener;
26 import org.openide.WizardDescriptor;
27 import org.openide.util.HelpCtx;
28 import org.openide.util.NbBundle.Messages;
31 
38 
39  @Messages("IngestProfileWizardPanel.panelName=Ingest Profile Selection")
40 
41  private final static String LAST_PROFILE_PROPERTIES_FILE = "IngestProfileSelectionPanel"; //NON-NLS
42  private final String executionContext;
43  private final String lastProfilePropertyName;
44  private final Set<ChangeListener> listeners = new HashSet<>(1);
45  private IngestProfileSelectionPanel ingestProfileSelectionPanel;
46  private String lastProfileUsed;
47 
48  public IngestProfileSelectionWizardPanel(String executionContext, String lastProfilePropertyName) {
49  this.lastProfilePropertyName = lastProfilePropertyName;
50  this.executionContext = executionContext;
51  }
52 
59  IngestJobSettings getIngestJobSettings() {
61  }
62 
66  String getDefaultContext() {
67  return executionContext;
68  }
69 
75  public static String getLastProfilePropertiesFile() {
77  }
78 
79  @Override
80  public Component getComponent() {
81  if (ingestProfileSelectionPanel == null) {
85  } else {
86  lastProfileUsed = getDefaultContext();
87  }
88  ingestProfileSelectionPanel = new IngestProfileSelectionPanel(this, lastProfileUsed);
89  ingestProfileSelectionPanel.setName(Bundle.IngestProfileWizardPanel_panelName());
90  }
92  }
93 
94  @Override
95  public HelpCtx getHelp() {
96  return HelpCtx.DEFAULT_HELP;
97  }
98 
99  @Override
100  public boolean isValid() {
101  return true;
102  }
103 
107  protected final void fireChangeEvent() {
108  Set<ChangeListener> ls;
109  synchronized (listeners) {
110  ls = new HashSet<>(listeners);
111  }
112  ChangeEvent ev = new ChangeEvent(this);
113  for (ChangeListener l : ls) {
114  l.stateChanged(ev);
115  }
116  }
117 
118  @Override
119  public void addChangeListener(ChangeListener l) {
120  synchronized (listeners) {
121  listeners.add(l);
122  }
123  }
124 
125  @Override
126  public void removeChangeListener(ChangeListener l) {
127  synchronized (listeners) {
128  listeners.remove(l);
129  }
130  }
131 
132  @Override
133  public void readSettings(WizardDescriptor wiz) {
134  }
135 
136  @Override
137  public void storeSettings(WizardDescriptor wiz) {
138  lastProfileUsed = ingestProfileSelectionPanel.getLastSelectedProfile();
140  }
141 
142  @Override
143  public boolean skipNextPanel() {
144  return ingestProfileSelectionPanel.isLastPanel;
145  }
146 
147  @Override
148  public boolean panelEnablesSkipping() {
149  return true;
150  }
151 }
static synchronized void setConfigSetting(String moduleName, String settingName, String settingVal)
static String getConfigSetting(String moduleName, String settingName)

Copyright © 2012-2016 Basis Technology. Generated on: Mon Jun 18 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.