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 180821
Collapse All | Expand All

(-)options.api/apichanges.xml (+15 lines)
Lines 75-80 Link Here
75
<!-- ACTUAL CHANGES BEGIN HERE: -->
75
<!-- ACTUAL CHANGES BEGIN HERE: -->
76
76
77
<changes>
77
<changes>
78
    <change id="OptionsPanelController.setSubcategory">
79
        <api name="OptionsAPI"/>
80
        <summary>API to handle selection of subcategory from a composite OptionspanelController</summary>
81
        <version major="1" minor="38"/>
82
        <date day="3" month="12" year="2013"/>
83
        <author login="theofanis"/>
84
        <compatibility addition="yes"/>
85
        <description>
86
            Added API to handle selection of subcategory. It is meant to be called from
87
            a composite {@link org.netbeans.spi.options.OptionspanelController} and delegates to
88
            {@link org.netbeans.spi.options.OptionspanelController#setCurrentSubcategory(java.lang.String)}.
89
        </description>
90
        <class package="org.netbeans.spi.options" name="OptionsPanelController"/>
91
        <issue number="180821"/>
92
    </change>
78
   <change id="Import.restart">
93
   <change id="Import.restart">
79
        <api name="OptionsAPI"/>
94
        <api name="OptionsAPI"/>
80
        <summary>Should Import Require Restart?</summary>
95
        <summary>Should Import Require Restart?</summary>
(-)options.api/manifest.mf (-1 / +1 lines)
Lines 2-7 Link Here
2
OpenIDE-Module: org.netbeans.modules.options.api/1
2
OpenIDE-Module: org.netbeans.modules.options.api/1
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/options/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/options/Bundle.properties
4
OpenIDE-Module-Layer: org/netbeans/modules/options/resources/mf-layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/options/resources/mf-layer.xml
5
OpenIDE-Module-Specification-Version: 1.37
5
OpenIDE-Module-Specification-Version: 1.38
6
AutoUpdate-Show-In-Client: false
6
AutoUpdate-Show-In-Client: false
7
AutoUpdate-Essential-Module: true
7
AutoUpdate-Essential-Module: true
(-)options.api/src/org/netbeans/spi/options/OptionsPanelController.java (+12 lines)
Lines 213-218 Link Here
213
    }
213
    }
214
214
215
    /**
215
    /**
216
     * Enables to handle selection of subcategory. It is meant to be called from
217
     * a composite {@link org.netbeans.spi.options.OptionspanelController} and  delegates to
218
     * {@link org.netbeans.spi.options.OptionspanelController#setCurrentSubcategory(java.lang.String)}.
219
     * @param subpath path of subcategory to be selected. Path is 
220
     * composed from registration names divided by slash.
221
     * @since 1.38
222
     */
223
    public final void setSubcategory(String subpath) {
224
        setCurrentSubcategory(subpath);
225
    }
226
227
    /**
216
     * 
228
     * 
217
     * Get current help context asociated with this panel.
229
     * Get current help context asociated with this panel.
218
     * 
230
     * 
(-)options.editor/manifest.mf (-1 / +1 lines)
Lines 2-7 Link Here
2
OpenIDE-Module: org.netbeans.modules.options.editor/1
2
OpenIDE-Module: org.netbeans.modules.options.editor/1
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/options/editor/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/options/editor/Bundle.properties
4
OpenIDE-Module-Layer: org/netbeans/modules/options/editor/mf-layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/options/editor/mf-layer.xml
5
OpenIDE-Module-Specification-Version: 1.47
5
OpenIDE-Module-Specification-Version: 1.48
6
AutoUpdate-Show-In-Client: false
6
AutoUpdate-Show-In-Client: false
7
7
(-)options.editor/nbproject/project.xml (-1 / +1 lines)
Lines 127-133 Link Here
127
                    <compile-dependency/>
127
                    <compile-dependency/>
128
                    <run-dependency>
128
                    <run-dependency>
129
                        <release-version>1</release-version>
129
                        <release-version>1</release-version>
130
                        <specification-version>1.29</specification-version>
130
                        <specification-version>1.38</specification-version>
131
                    </run-dependency>
131
                    </run-dependency>
132
                </dependency>
132
                </dependency>
133
                <dependency>
133
                <dependency>
(-)options.editor/src/org/netbeans/modules/options/editor/FolderBasedController.java (-21 / +1 lines)
Lines 231-237 Link Here
231
                subpath = subpath.substring(e.getKey().length());
231
                subpath = subpath.substring(e.getKey().length());
232
232
233
                if (subpath.length() > 0 && subpath.startsWith("/")) {
233
                if (subpath.length() > 0 && subpath.startsWith("/")) {
234
                    setCurrentSubcategory(e.getValue(), subpath.substring(1));
234
                    e.getValue().setSubcategory(subpath.substring(1));
235
                }
235
                }
236
236
237
                return ;
237
                return ;
Lines 241-266 Link Here
241
        Logger.getLogger(FolderBasedController.class.getName()).log(Level.WARNING, "setCurrentSubcategory: cannot open: {0}", subpath);
241
        Logger.getLogger(FolderBasedController.class.getName()).log(Level.WARNING, "setCurrentSubcategory: cannot open: {0}", subpath);
242
    }
242
    }
243
243
244
    private static void setCurrentSubcategory(OptionsPanelController c, String subpath) {
245
        //#180821: cannot directly call setCurrentSubcategory on c as that is protected
246
        try {
247
            Method m = OptionsPanelController.class.getDeclaredMethod("setCurrentSubcategory", String.class);
248
249
            m.setAccessible(true);
250
            m.invoke(c, subpath);
251
        } catch (IllegalAccessException ex) {
252
            Exceptions.printStackTrace(ex);
253
        } catch (IllegalArgumentException ex) {
254
            Exceptions.printStackTrace(ex);
255
        } catch (InvocationTargetException ex) {
256
            Exceptions.printStackTrace(ex);
257
        } catch (NoSuchMethodException ex) {
258
            Exceptions.printStackTrace(ex);
259
        } catch (SecurityException ex) {
260
            Exceptions.printStackTrace(ex);
261
        }
262
    }
263
    
264
    Iterable<String> getMimeTypes() {
244
    Iterable<String> getMimeTypes() {
265
        return getMimeType2delegates ().keySet();
245
        return getMimeType2delegates ().keySet();
266
    }
246
    }

Return to bug 180821