34 import javax.swing.filechooser.FileFilter;
35 import javax.swing.filechooser.FileView;
36
37 import com.sun.javatest.report.Report;
38 import com.sun.javatest.tool.IconFactory;
39 import com.sun.javatest.tool.UIFactory;
40 import com.sun.javatest.util.FileInfoCache;
41
42 /**
43 * A custom JFileChooser, for a user to choose a report directory.
44 */
45 //
46 // see also com.sun.javatest.tool.WorkDirChooser
47 //
48 class ReportDirChooser extends JFileChooser
49 {
50 // the following is a workaround to force the Report class to
51 // be safely loaded, before the JFileChooser starts running its background
52 // thread, exposing a JVM bug in class loading.
53 static {
54 Class reportClass = Report.class;
55 }
56
57 /**
58 * Create a ReportDirChooser, initially showing the user's current directory.
59 */
60 public ReportDirChooser() {
61 this(new File(System.getProperty("user.dir")));
62 }
63
64 /**
65 * Create a ReportDirChooser, initially showing a given directory.
66 * @param initialDir the initial directory to be shown
67 */
68 public ReportDirChooser(File initialDir) {
69 super(initialDir);
70 uif = new UIFactory(this, null); // no helpBroker required
71
72 icon = IconFactory.getSelectableFolderIcon();
73
74 // we want a filter that only selects directories
|
34 import javax.swing.filechooser.FileFilter;
35 import javax.swing.filechooser.FileView;
36
37 import com.sun.javatest.report.Report;
38 import com.sun.javatest.tool.IconFactory;
39 import com.sun.javatest.tool.UIFactory;
40 import com.sun.javatest.util.FileInfoCache;
41
42 /**
43 * A custom JFileChooser, for a user to choose a report directory.
44 */
45 //
46 // see also com.sun.javatest.tool.WorkDirChooser
47 //
48 class ReportDirChooser extends JFileChooser
49 {
50 // the following is a workaround to force the Report class to
51 // be safely loaded, before the JFileChooser starts running its background
52 // thread, exposing a JVM bug in class loading.
53 static {
54 Class<?> reportClass = Report.class;
55 }
56
57 /**
58 * Create a ReportDirChooser, initially showing the user's current directory.
59 */
60 public ReportDirChooser() {
61 this(new File(System.getProperty("user.dir")));
62 }
63
64 /**
65 * Create a ReportDirChooser, initially showing a given directory.
66 * @param initialDir the initial directory to be shown
67 */
68 public ReportDirChooser(File initialDir) {
69 super(initialDir);
70 uif = new UIFactory(this, null); // no helpBroker required
71
72 icon = IconFactory.getSelectableFolderIcon();
73
74 // we want a filter that only selects directories
|