Autopsy  4.19.3
Graphical digital forensics platform for The Sleuth Kit and other tools.
Classes | Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
org.sleuthkit.autopsy.guiutils.JFileChooserFactory Class Reference

Classes

class  ChooserCallable
 

Public Member Functions

 JFileChooserFactory ()
 
 JFileChooserFactory (Class<?extends JFileChooser > cls)
 
JFileChooser getChooser ()
 

Static Private Member Functions

static String getCallerClassName ()
 

Private Attributes

JFileChooser chooser
 
final ExecutorService executor
 
final FutureTask< JFileChooser > futureFileChooser
 

Static Private Attributes

static final Logger logger = Logger.getLogger(JFileChooserFactory.class.getName())
 

Detailed Description

Factory class for initializing JFileChooser instances in a background thread.

It is a known issue that on Windows a JFileChooser can take an indeterminate amount of time to initialize. Therefore when a JFileChooser is initialized on the EDT there is the potential for the UI to appear hung while initialization is occurring.

Initializing a JFileChooser in a background thread should prevent the UI from hanging. Using this Factory class at component construction time should allow enough time for the JFileChooser to be initialized in the background before the UI user causes an event which will launch the JFileChooser. If the JFileChooser is not initialized prior to the event occurring, the EDT will be blocked, but the wait cursor will appear.

https://stackoverflow.com/questions/49792375/jfilechooser-is-very-slow-when-using-windows-look-and-feel

Definition at line 51 of file JFileChooserFactory.java.

Constructor & Destructor Documentation

org.sleuthkit.autopsy.guiutils.JFileChooserFactory.JFileChooserFactory ( )

Create a new instance of the factory. The constructor will kick off an executor to execute the initializing the JFileChooser task.

Definition at line 63 of file JFileChooserFactory.java.

org.sleuthkit.autopsy.guiutils.JFileChooserFactory.JFileChooserFactory ( Class<?extends JFileChooser >  cls)

Create a new instance of the factory using a class that extends JFileChooser. The class default constructor will be called to initialize the class.

The passed in Class must be public and its default constructor must be public.

Parameters
clsClass type to initialize.

Definition at line 77 of file JFileChooserFactory.java.

References org.sleuthkit.autopsy.guiutils.JFileChooserFactory.getCallerClassName().

Member Function Documentation

static String org.sleuthkit.autopsy.guiutils.JFileChooserFactory.getCallerClassName ( )
staticprivate

Get the name of the class that called this one. From https://stackoverflow.com/questions/11306811/how-to-get-the-caller-class-in-java

Returns
The name of the class that requested the JFileChooser or null if not found.

Definition at line 101 of file JFileChooserFactory.java.

Referenced by org.sleuthkit.autopsy.guiutils.JFileChooserFactory.JFileChooserFactory().

JFileChooser org.sleuthkit.autopsy.guiutils.JFileChooserFactory.getChooser ( )

Member Data Documentation

JFileChooser org.sleuthkit.autopsy.guiutils.JFileChooserFactory.chooser
private
final ExecutorService org.sleuthkit.autopsy.guiutils.JFileChooserFactory.executor
private

Definition at line 57 of file JFileChooserFactory.java.

final FutureTask<JFileChooser> org.sleuthkit.autopsy.guiutils.JFileChooserFactory.futureFileChooser
private

Definition at line 55 of file JFileChooserFactory.java.

final Logger org.sleuthkit.autopsy.guiutils.JFileChooserFactory.logger = Logger.getLogger(JFileChooserFactory.class.getName())
staticprivate

Definition at line 53 of file JFileChooserFactory.java.


The documentation for this class was generated from the following file:

Copyright © 2012-2022 Basis Technology. Generated on: Tue Jun 27 2023
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.