Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!

Bug 215426

Summary: Proxy button in Tools->Plugins assumes "General" option is present
Product: platform Reporter: tdanard
Component: Plugin ManagerAssignee: Libor Fischmeistr <lfischmeistr>
Status: RESOLVED WORKSFORME QA Contact: au-issues
Priority: P3    
Version: 7.1.2   
Target Milestone: TBD   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Issue Type: ENHANCEMENT Exception Report:

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")
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo