2348 added comments to new methods and classes that were missing them

This commit is contained in:
William Schaefer 2017-03-08 17:57:02 -05:00
parent a47fa38410
commit feaf89cb1e
4 changed files with 32 additions and 23 deletions

View File

@ -184,7 +184,7 @@ class AddImageWizardDataSourceSettingsPanel extends ShortcutWizardDescriptorPane
}
} catch (Exception e) {
}
component.dspSelectionChanged((String)settings.getProperty("SelectedDsp")); //NON-NLS magic string used SelectDataSourceProcessorPanel
component.setDspSelection((String)settings.getProperty("SelectedDsp")); //NON-NLS magic string used SelectDataSourceProcessorPanel
}
/**

View File

@ -61,6 +61,7 @@ final class AddImageWizardDataSourceSettingsVisual extends JPanel {
this.wizPanel = wizPanel;
typePanel.setLayout(new BorderLayout());
discoverDataSourceProcessors();
currentDsp = ImageDSProcessor.getType(); //default value to the ImageDSProcessor
}
/**
@ -78,10 +79,13 @@ final class AddImageWizardDataSourceSettingsVisual extends JPanel {
}
/**
* WJS-TODO
* Set the current DataSourceProcessor and update the panel to reflect that
* selection.
*
* @param dsType - the name of the DataSourceProcessor you wish to have this
* panel display settings for.
*/
void dspSelectionChanged(String dsType) {
// update the current panel to selection
void setDspSelection(String dsType) {
currentDsp = dsType;
currentPanel = datasourceProcessorsMap.get(dsType).getPanel();
updateCurrentPanel(currentPanel);
@ -122,10 +126,6 @@ final class AddImageWizardDataSourceSettingsVisual extends JPanel {
protected DataSourceProcessor getCurrentDSProcessor() {
// get the type of the currently selected panel and then look up
// the correspodning DS Handler in the map
if (currentDsp.equals("")) {
System.out.println("LOADING EMPTY DSP WJSTODO WJS-TODO LOG ISSUE HERE");
currentDsp = ImageDSProcessor.getType();
}
DataSourceProcessor dsProcessor = datasourceProcessorsMap.get(currentDsp);
return dsProcessor;

View File

@ -22,11 +22,13 @@ import java.awt.Component;
import java.awt.Cursor;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.logging.Level;
import javax.swing.event.ChangeListener;
import org.openide.WizardDescriptor;
import org.openide.util.HelpCtx;
import org.openide.util.NbBundle;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
import org.sleuthkit.autopsy.ingest.runIngestModuleWizard.ShortcutWizardDescriptorPanel;
@ -34,13 +36,14 @@ import org.sleuthkit.autopsy.ingest.runIngestModuleWizard.ShortcutWizardDescript
* Create a wizard panel which contains a panel allowing the selection of the
* DataSourceProcessor
*/
class AddImageWizardSelectDspPanel extends ShortcutWizardDescriptorPanel implements PropertyChangeListener {
final class AddImageWizardSelectDspPanel extends ShortcutWizardDescriptorPanel implements PropertyChangeListener {
@NbBundle.Messages("SelectDataSourceProcessorPanel.name.text=Select Type of Data")
private AddImageWizardSelectDspVisual component;
private static final String LAST_DSP_PROPERTIES_FILE = "LastDSPUsed";
private static final String LAST_DSP_USED_KEY = "Last_DSP_Used";
private static final Logger logger = Logger.getLogger(AddImageWizardSelectDspVisual.class.getName());
@Override
public Component getComponent() {
if (component == null) {
@ -50,7 +53,7 @@ class AddImageWizardSelectDspPanel extends ShortcutWizardDescriptorPanel impleme
lastDspUsed = ModuleSettings.getConfigSetting(LAST_DSP_PROPERTIES_FILE, LAST_DSP_USED_KEY);
} else {
lastDspUsed = ImageDSProcessor.getType();
System.out.println("NO SAVED DSP WJS-TODO LOG THIS");
logger.log(Level.WARNING, "There was no properties file containing the last DataSourceProcessor used, Disk Image or VM will be selected by default"); //NON-NLS
}
WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
component = new AddImageWizardSelectDspVisual(lastDspUsed);

View File

@ -41,6 +41,9 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessor;
import org.sleuthkit.autopsy.datasourceprocessors.RawDSProcessor;
import org.sleuthkit.autopsy.coreutils.Logger;
/**
* Panel which displays the available DataSourceProcessors and allows selection of one
*/
final class AddImageWizardSelectDspVisual extends JPanel {
private static final Logger logger = Logger.getLogger(AddImageWizardSelectDspVisual.class.getName());
@ -58,10 +61,11 @@ final class AddImageWizardSelectDspVisual extends JPanel {
}
/**
* WJS-TODO
* Find the DSP which is currently selected and save it as the selected
* DataSourceProcessor.
*
*/
private void dspSelectionChanged() {
private void updateSelectedDsp() {
Enumeration<AbstractButton> buttonGroup = buttonGroup1.getElements();
while (buttonGroup.hasMoreElements()) {
AbstractButton dspButton = buttonGroup.nextElement();
@ -73,23 +77,23 @@ final class AddImageWizardSelectDspVisual extends JPanel {
}
/**
* WJS-TODO
* Get the DataSourceProcessor which is currently selected in this panel
*
* @return
* @return selectedDsp the DataSourceProcessor which is selected in this panel
*/
String getSelectedDsp() {
return selectedDsp;
}
/**
* WJS-TODO
* Create the a button for each DataSourceProcessor that should exist as an option.
*/
private void createDataSourceProcessorButtons() {
//Listener for button selection
ActionListener cbActionListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
dspSelectionChanged();
updateSelectedDsp();
}
};
List<String> dspList = getListOfDsps();
@ -139,9 +143,11 @@ final class AddImageWizardSelectDspVisual extends JPanel {
}
/**
* WJS-TODO
*
* @return
* Create a list of the DataSourceProcessors which should exist as options on this panel.
* The default Autopsy DataSourceProcessors will appear
* at the beggining of the list in the same order.
*
* @return dspList a list of DataSourceProcessors which can be chose in this panel
*/
private List<String> getListOfDsps() {
List<String> dspList = new ArrayList<>();
@ -172,11 +178,11 @@ final class AddImageWizardSelectDspVisual extends JPanel {
}
/**
* WJS-TODO
* Create a single button for a DataSourceProcessor
*
* @param dspType
* @param dspType - the name of the DataSourceProcessor
*
* @return
* @return dspButton a JToggleButton for the specified dspType
*/
private JToggleButton createDspButton(String dspType) {
JToggleButton dspButton = new JToggleButton();