我在netbeans上开发一个Platform,并新建了一个新的文件类型.hql。但是运行项目时,界面上的“新建文件”按钮是灰显的,不能新建我的hql文件。请问我怎么才能使这个按钮变亮,并利用它。

解决方案 »

  1.   

    不是我建的,我是在主项目模块中添加了netbeans的库“项目 UI”模块后,会自动有那个按钮,但是是灰显的。然后在自己建立的一个模块中配置了<file name="org-netbeans-modules-project-ui-NewFile.instance">
                    <attr name="delegate" newvalue="org.netbeans.modules.project.ui.actions.NewFile"/>
                    <attr name="displayName" bundlevalue="org.netbeans.modules.project.ui.actions.Bundle#LBL_NewFileAction_Name"/>
                    <attr name="iconBase" stringvalue="org/netbeans/modules/project/ui/resources/newFile.png"/>
                    <attr name="instanceCreate" methodvalue="org.openide.awt.Actions.alwaysEnabled"/>
                    <attr name="noIconInMenu" boolvalue="false"/>
                </file>这样代码,按钮变亮,点击却没反应了。