This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 197457

Summary: FileChooserBuilder.SelectionApprover does not receive any selection
Product: platform Reporter: osv
Component: FilesystemsAssignee: Jaroslav Tulach <jtulach>
Status: RESOLVED FIXED    
Severity: normal CC: tboudreau
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description osv 2011-04-05 17:56:52 UTC
The FileChooserBuilder.SelectionApprover approve method is always called with an empty File[] array that makes no approving possible.

        File any = new FileChooserBuilder("openFilePreference")
                .setTitle("Fails to select any file"))
                .setSelectionApprover(new FileChooserBuilder.SelectionApprover() {
                    @Override
                    public boolean approve(File[] selection) {
                        return selection.length != 0;
                    }

                }).setApproveText("Open").showOpenDialog();
Comment 1 Jaroslav Tulach 2011-04-07 07:41:59 UTC
ergonomics#ef7a32640b90
Comment 2 Quality Engineering 2011-04-15 08:39:48 UTC
Integrated into 'main-golden', will be available in build *201104150401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/ef7a32640b90
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #197457: Make sure we pass into SelectionApprover some value even if single file is selected