mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 01:07:42 +00:00
reset local files wizard component when selected again
This commit is contained in:
parent
f8bb586d4f
commit
20c73bd79d
@ -134,6 +134,13 @@ final class AddImageVisualPanel1 extends JPanel {
|
|||||||
return currentPanel.getContentType();
|
return currentPanel.getContentType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset the data sources panel selected
|
||||||
|
*/
|
||||||
|
public void reset() {
|
||||||
|
currentPanel.reset();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the image path of the current panel.
|
* Sets the image path of the current panel.
|
||||||
* @param s the image path to set
|
* @param s the image path to set
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.sleuthkit.autopsy.casemodule;
|
package org.sleuthkit.autopsy.casemodule;
|
||||||
|
|
||||||
import java.beans.PropertyChangeEvent;
|
import java.beans.PropertyChangeEvent;
|
||||||
@ -86,7 +85,8 @@ class AddImageWizardPanel1 implements WizardDescriptor.Panel<WizardDescriptor>,
|
|||||||
* Tests whether the panel is finished and it is safe to proceed to the next
|
* Tests whether the panel is finished and it is safe to proceed to the next
|
||||||
* one. If the panel is valid, the "Next" button will be enabled.
|
* one. If the panel is valid, the "Next" button will be enabled.
|
||||||
*
|
*
|
||||||
* @return boolean true if all the fields are correctly filled, false otherwise
|
* @return boolean true if all the fields are correctly filled, false
|
||||||
|
* otherwise
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
@ -112,7 +112,6 @@ class AddImageWizardPanel1 implements WizardDescriptor.Panel<WizardDescriptor>,
|
|||||||
isNextEnable = isEnabled;
|
isNextEnable = isEnabled;
|
||||||
fireChangeEvent();
|
fireChangeEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1); // or can use ChangeSupport in NB 6.0
|
private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1); // or can use ChangeSupport in NB 6.0
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -140,8 +139,8 @@ class AddImageWizardPanel1 implements WizardDescriptor.Panel<WizardDescriptor>,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is auto-generated. It seems that this method is used to listen
|
* This method is auto-generated. It seems that this method is used to
|
||||||
* to any change in this wizard panel.
|
* listen to any change in this wizard panel.
|
||||||
*/
|
*/
|
||||||
protected final void fireChangeEvent() {
|
protected final void fireChangeEvent() {
|
||||||
Iterator<ChangeListener> it;
|
Iterator<ChangeListener> it;
|
||||||
@ -154,23 +153,23 @@ class AddImageWizardPanel1 implements WizardDescriptor.Panel<WizardDescriptor>,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// You can use a settings object to keep track of state. Normally the
|
// You can use a settings object to keep track of state. Normally the
|
||||||
// settings object will be the WizardDescriptor, so you can use
|
// settings object will be the WizardDescriptor, so you can use
|
||||||
// WizardDescriptor.getProperty & putProperty to store information entered
|
// WizardDescriptor.getProperty & putProperty to store information entered
|
||||||
// by the user.
|
// by the user.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides the wizard panel with the current data--either the default data
|
* Provides the wizard panel with the current data--either the default data
|
||||||
* or already-modified settings, if the user used the previous and/or next
|
* or already-modified settings, if the user used the previous and/or next
|
||||||
* buttons. This method can be called multiple times on one instance of
|
* buttons. This method can be called multiple times on one instance of
|
||||||
* WizardDescriptor.Panel.
|
* WizardDescriptor.Panel. s
|
||||||
*s
|
*
|
||||||
* @param settings the setting to be read from
|
* @param settings the setting to be read from
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void readSettings(WizardDescriptor settings) {
|
public void readSettings(WizardDescriptor settings) {
|
||||||
AddImageVisualPanel1 component = getComponent();
|
|
||||||
|
//reset settings if supports it
|
||||||
|
//getComponent().reset();
|
||||||
|
|
||||||
// Prepopulate the image directory from the properties file
|
// Prepopulate the image directory from the properties file
|
||||||
try {
|
try {
|
||||||
@ -201,17 +200,16 @@ class AddImageWizardPanel1 implements WizardDescriptor.Panel<WizardDescriptor>,
|
|||||||
cleanupTask.disable();
|
cleanupTask.disable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e){
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides the wizard panel with the opportunity to update the settings
|
* Provides the wizard panel with the opportunity to update the settings
|
||||||
* with its current customized state. Rather than updating its settings
|
* with its current customized state. Rather than updating its settings with
|
||||||
* with every change in the GUI, it should collect them, and then only save
|
* every change in the GUI, it should collect them, and then only save them
|
||||||
* them when requested to by this method. This method can be called multiple
|
* when requested to by this method. This method can be called multiple
|
||||||
* times on one instance of WizardDescriptor.Panel.
|
* times on one instance of WizardDescriptor.Panel.
|
||||||
*
|
*
|
||||||
* @param settings the setting to be stored to
|
* @param settings the setting to be stored to
|
||||||
@ -230,12 +228,12 @@ class AddImageWizardPanel1 implements WizardDescriptor.Panel<WizardDescriptor>,
|
|||||||
String firstImagePath = firstImage.substring(0, firstImage.lastIndexOf(File.separator) + 1);
|
String firstImagePath = firstImage.substring(0, firstImage.lastIndexOf(File.separator) + 1);
|
||||||
ModuleSettings.setConfigSetting(ModuleSettings.MAIN_SETTINGS, PROP_LASTDATASOURCE_PATH, firstImagePath);
|
ModuleSettings.setConfigSetting(ModuleSettings.MAIN_SETTINGS, PROP_LASTDATASOURCE_PATH, firstImagePath);
|
||||||
ModuleSettings.setConfigSetting(ModuleSettings.MAIN_SETTINGS, PROP_LASTDATASOURCE_TYPE, getComponent().getContentType().toString());
|
ModuleSettings.setConfigSetting(ModuleSettings.MAIN_SETTINGS, PROP_LASTDATASOURCE_TYPE, getComponent().getContentType().toString());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The "listener" for any property change in this panel. Any property changes
|
* The "listener" for any property change in this panel. Any property
|
||||||
* will invoke the "fireChangeEvent()" method.
|
* changes will invoke the "fireChangeEvent()" method.
|
||||||
*
|
*
|
||||||
* @param evt the property change event
|
* @param evt the property change event
|
||||||
*/
|
*/
|
||||||
|
@ -52,7 +52,7 @@ import org.sleuthkit.datamodel.TskException;
|
|||||||
*/
|
*/
|
||||||
class AddImageWizardPanel3 implements WizardDescriptor.Panel<WizardDescriptor> {
|
class AddImageWizardPanel3 implements WizardDescriptor.Panel<WizardDescriptor> {
|
||||||
|
|
||||||
private Logger logger = Logger.getLogger(AddImageWizardPanel3.class.getName());
|
private static final Logger logger = Logger.getLogger(AddImageWizardPanel3.class.getName());
|
||||||
private IngestConfigurator ingestConfig = Lookup.getDefault().lookup(IngestConfigurator.class);
|
private IngestConfigurator ingestConfig = Lookup.getDefault().lookup(IngestConfigurator.class);
|
||||||
/**
|
/**
|
||||||
* The visual component that displays this panel. If you need to access the
|
* The visual component that displays this panel. If you need to access the
|
||||||
|
@ -58,6 +58,11 @@ abstract class ContentTypePanel extends JPanel {
|
|||||||
*/
|
*/
|
||||||
abstract public boolean enableNext();
|
abstract public boolean enableNext();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tells this panel to reset itself
|
||||||
|
*/
|
||||||
|
abstract public void reset();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tells this panel it has been selected.
|
* Tells this panel it has been selected.
|
||||||
*/
|
*/
|
||||||
|
@ -155,6 +155,11 @@ public class ImageFilePanel extends ContentTypePanel implements DocumentListener
|
|||||||
return ContentType.IMAGE;
|
return ContentType.IMAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reset() {
|
||||||
|
//nothing to reset
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -166,6 +166,11 @@ public class LocalDiskPanel extends ContentTypePanel {
|
|||||||
return enableNext;
|
return enableNext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reset() {
|
||||||
|
//nothing to reset
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the representation of this panel as a String.
|
* @return the representation of this panel as a String.
|
||||||
*/
|
*/
|
||||||
|
@ -91,7 +91,13 @@ public class LocalFilesPanel extends ContentTypePanel {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void select() {
|
public void select() {
|
||||||
//nothing needed
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reset() {
|
||||||
|
currentFiles.clear();
|
||||||
|
selectedPaths.setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -213,8 +219,7 @@ public class LocalFilesPanel extends ContentTypePanel {
|
|||||||
}//GEN-LAST:event_selectButtonActionPerformed
|
}//GEN-LAST:event_selectButtonActionPerformed
|
||||||
|
|
||||||
private void clearButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearButtonActionPerformed
|
private void clearButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearButtonActionPerformed
|
||||||
currentFiles.clear();
|
reset();
|
||||||
selectedPaths.setText("");
|
|
||||||
|
|
||||||
}//GEN-LAST:event_clearButtonActionPerformed
|
}//GEN-LAST:event_clearButtonActionPerformed
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user