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 215426 - Proxy button in Tools->Plugins assumes "General" option is present
Summary: Proxy button in Tools->Plugins assumes "General" option is present
Status: RESOLVED WORKSFORME
Alias: None
Product: platform
Classification: Unclassified
Component: Plugin Manager (show other bugs)
Version: 7.1.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Libor Fischmeistr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-11 20:44 UTC by tdanard
Modified: 2014-10-08 19:32 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tdanard 2012-07-11 20:44:41 UTC
In my application, the "Proxy" settings are not the settings that I want users to see first. Other settings are more important.

I have renamed the "General" settings "Proxy", and moved them to the end of the list of options using this layer.xml entry:

    <folder name="OptionsDialog">
        <folder name="Advanced_hidden"/>
        <file name="Advanced.instance_hidden"/>
        <file name="General.instance_hidden"/>
        <file name="Keymaps.instance_hidden"/>
        <file name="Proxy.instance">
            <attr
                methodvalue="org.netbeans.spi.options.OptionsCategory.createCategory" name="instanceCreate"/>
            <attr name="controller" newvalue="org.netbeans.core.ui.options.general.GeneralOptionsPanelController"/>
            <attr
                stringvalue="Proxy" name="categoryName"/>
            <attr intvalue="100" name="position"/>
            <attr name="iconBase" stringvalue="com/something/ProxyOption.png"/>
            <attr
                stringvalue="Proxy" name="keywords"/>
            <attr name="keywordsCategory" stringvalue="Proxy"/>
        </file>
    </folder> 

As a result, the "Proxy Settings" button in the Plugins manager no longer works. I assume it's looking for a "General" option.

The name of the option that the "Proxy Settings" uses should be pluggable. Ideally, it should look for the option instance that GeneralOptionsPanelController is in (in this case Proxy.instance)

At least, when there is no "General" option, the entire "Tools->Options" dialog should open.
Comment 1 Jiri Rechtacek 2012-07-25 05:27:56 UTC
Right. It's a correct using Options API - http://bits.netbeans.org/7.1.2/javadoc/org-netbeans-modules-options-api/org/netbeans/api/options/OptionsDisplayer.html#open(java.lang.String)

File it as ENHANCEMENT against platform/Options&Settings if you need enhance this API for your application. The patch will be welcome. Thanks
Comment 2 tdanard 2012-09-20 22:29:29 UTC
Reopened as enhancement request
Comment 3 tdanard 2014-03-19 16:38:52 UTC
I worked around this issue by changing my registration to:

    <folder name="OptionsDialog">
        <folder name="Advanced_hidden"/>
        <file name="Advanced.instance_hidden"/>
        <file name="General.instance">
            <attr methodvalue="org.netbeans.spi.options.OptionsCategory.createCategory" name="instanceCreate"/>
            <attr name="controller" newvalue="org.netbeans.core.ui.options.general.GeneralOptionsPanelController"/>
            <attr stringvalue="Proxy" name="categoryName"/>
            <attr intvalue="300" name="position"/>
            <attr name="iconBase" stringvalue="com/something/ProxyOption.png"/>
            <attr stringvalue="Proxy" name="keywords"/>
            <attr name="keywordsCategory" stringvalue="Proxy"/>
        </file>
        <file name="Keymaps.instance_hidden"/>
   </folder>

The only difference is that to open the "Proxy" options dialog, I have to call OptionsDisplayer.getDefault().open(OptionsDisplayer.GENERAL) instead of OptionsDisplayer.getDefault().open("Proxy")