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.

View | Details | Raw Unified | Return to bug 220401
Collapse All | Expand All

(-)a/openide.filesystems/apichanges.xml (+17 lines)
Lines 49-54 Link Here
49
        <apidef name="filesystems">Filesystems API</apidef>
49
        <apidef name="filesystems">Filesystems API</apidef>
50
    </apidefs>
50
    </apidefs>
51
    <changes>
51
    <changes>
52
        <change id="FileChooserBuilder-setAcceptAllFileFilterUsed">
53
            <api name="filesystems"/>
54
            <summary>New method FileChooserBuilder.setAcceptAllFileFilterUsed.</summary>
55
            <version major="8" minor="3"/>
56
            <date year="2012" month="10" day="19"/>
57
            <author login="tmysik"/>
58
            <compatibility addition="yes" deprecation="no"/>
59
            <description>
60
                <p>
61
                    Added <a href="@TOP@org/openide/filesystems/FileChooserBuilder.html#setAcceptAllFileFilterUsed()">
62
                    new method</a> to <code>FileChooserBuilder</code> that determines whether the <code>AcceptAll FileFilter</code>
63
                    should be used in the created file chooser.
64
                </p>
65
            </description>
66
            <class package="org.openide.filesystems" name="FileChooserBuilder"/>
67
            <issue number="220401"/>
68
        </change>
52
        <change id="FileChooserBuilder-addDefaultFileFilters">
69
        <change id="FileChooserBuilder-addDefaultFileFilters">
53
            <api name="filesystems"/>
70
            <api name="filesystems"/>
54
            <summary>New method FileChooserBuilder.addDefaultFileFilters and accompanying annotations.</summary>
71
            <summary>New method FileChooserBuilder.addDefaultFileFilters and accompanying annotations.</summary>
(-)a/openide.filesystems/manifest.mf (-1 / +1 lines)
Lines 2-6 Link Here
2
OpenIDE-Module: org.openide.filesystems
2
OpenIDE-Module: org.openide.filesystems
3
OpenIDE-Module-Localizing-Bundle: org/openide/filesystems/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/openide/filesystems/Bundle.properties
4
OpenIDE-Module-Layer: org/openide/filesystems/resources/layer.xml
4
OpenIDE-Module-Layer: org/openide/filesystems/resources/layer.xml
5
OpenIDE-Module-Specification-Version: 8.2
5
OpenIDE-Module-Specification-Version: 8.3
6
6
(-)a/openide.filesystems/src/org/openide/filesystems/FileChooserBuilder.java (+18 lines)
Lines 123-128 Link Here
123
            Boolean.getBoolean("forget.recent.dirs");
123
            Boolean.getBoolean("forget.recent.dirs");
124
    private SelectionApprover approver;
124
    private SelectionApprover approver;
125
    private final List<FileFilter> filters = new ArrayList<FileFilter>(3);
125
    private final List<FileFilter> filters = new ArrayList<FileFilter>(3);
126
    private boolean useAcceptAllFileFilter = true;
126
    /**
127
    /**
127
     * Create a new FileChooserBuilder using the name of the passed class
128
     * Create a new FileChooserBuilder using the name of the passed class
128
     * as the metadata for looking up a starting directory from previous
129
     * as the metadata for looking up a starting directory from previous
Lines 209-214 Link Here
209
    }
210
    }
210
211
211
    /**
212
    /**
213
     * Determines whether the <code>AcceptAll FileFilter</code> is used
214
     * as an available choice in the choosable filter list.
215
     * If false, the <code>AcceptAll</code> file filter is removed from
216
     * the list of available file filters.
217
     * If true, the <code>AcceptAll</code> file filter will become the
218
     * the actively used file filter.
219
     * @param accept whether the <code>AcceptAll FileFilter</code> is used
220
     * @return this
221
     * @since 8.3
222
     */
223
    public FileChooserBuilder setAcceptAllFileFilterUsed(boolean accept) {
224
        useAcceptAllFileFilter = accept;
225
        return this;
226
    }
227
228
    /**
212
     * Set the current directory which should be used <b>only if</b>
229
     * Set the current directory which should be used <b>only if</b>
213
     * a last-used directory cannot be found for the key string passed
230
     * a last-used directory cannot be found for the key string passed
214
     * into this builder's constructor.
231
     * into this builder's constructor.
Lines 387-392 Link Here
387
                JFileChooser.FILES_AND_DIRECTORIES);
404
                JFileChooser.FILES_AND_DIRECTORIES);
388
        chooser.setFileHidingEnabled(fileHiding);
405
        chooser.setFileHidingEnabled(fileHiding);
389
        chooser.setControlButtonsAreShown(controlButtonsShown);
406
        chooser.setControlButtonsAreShown(controlButtonsShown);
407
        chooser.setAcceptAllFileFilterUsed(useAcceptAllFileFilter);
390
        if (title != null) {
408
        if (title != null) {
391
            chooser.setDialogTitle(title);
409
            chooser.setDialogTitle(title);
392
        }
410
        }
(-)a/openide.filesystems/test/unit/src/org/openide/filesystems/FileChooserBuilderTest.java (+7 lines)
Lines 223-228 Link Here
223
        assertEquals (ff.size() + 1, actual.size());
223
        assertEquals (ff.size() + 1, actual.size());
224
    }
224
    }
225
225
226
    public void testSetAcceptAllFileFilterUsed() {
227
        FileChooserBuilder instance = new FileChooserBuilder("k");
228
        assertTrue(instance.createFileChooser().isAcceptAllFileFilterUsed());
229
        instance.setAcceptAllFileFilterUsed(false);
230
        assertFalse(instance.createFileChooser().isAcceptAllFileFilterUsed());
231
    }
232
226
    private static final class FF extends FileFilter {
233
    private static final class FF extends FileFilter {
227
        private String x;
234
        private String x;
228
        FF(String x) {
235
        FF(String x) {

Return to bug 220401