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.
If you use the New File Type Wizard to create a new file type (by XML Root Element), you will create a DataObject and associated files for this new File Type. However you then find that the XML Check and XML Validate functionality is disabled when editing this type of XML file, which is not useful. You can obviously fix the problem, by editing the generated code (as I have), but as it seems that Check and Validate are useful and necessary XML file functions in all cases, so I am proposing that it enabled by default in the code generated by the wizard 1) I am proposing that additional code be added to the DataObject created. in the constructor - it is currently: CookieSet cookies = getCookieSet(); cookies.add((Node.Cookie) DataEditorSupport.create(this, getPrimaryEntry(), cookies)); proposed solution - add three further lines so that it now reads CookieSet cookies = getCookieSet(); cookies.add((Node.Cookie) DataEditorSupport.create(this, getPrimaryEntry(), cookies)); InputSource in = DataObjectAdapters.inputSource(this); cookies.add(new CheckXMLSupport(in)); cookies.add(new ValidateXMLSupport(in)); 2) Also add the check and validate actions to Loader Actions in the generated layer.xml so that they are available from the file popup menu (as is normally available for any XML file) example of possible addition entries: <file name="org-netbeans-modules-xml-tools-actions-CheckAction.shadow"> <attr name="originalFile" stringvalue="Actions/XML/org-netbeans-modules-xml-tools-actions-CheckAction.instance"/> <attr name="position" intvalue="205"/> </file> <file name="org-netbeans-modules-xml-tools-actions-ValidateAction.shadow"> <attr name="originalFile" stringvalue="Actions/XML/org-netbeans-modules-xml-tools-actions-ValidateAction.instance"/> <attr name="position" intvalue="207"/> </file> Hope that all the preceding information is useful and complete. Please contact me if you feel anything is missing from this proposal. /Richard
Missed the TransformableSupport cookie in part 1 of my original request. So part 1 of the request is updated to be: 1) I am proposing that additional code be added to the DataObject created. in the constructor - it is currently: CookieSet cookies = getCookieSet(); cookies.add((Node.Cookie) DataEditorSupport.create(this, getPrimaryEntry(), cookies)); proposed solution - add four further lines so that it now reads CookieSet cookies = getCookieSet(); cookies.add((Node.Cookie) DataEditorSupport.create(this, getPrimaryEntry(), cookies)); InputSource in = DataObjectAdapters.inputSource(this); cookies.add(new CheckXMLSupport(in)); cookies.add(new ValidateXMLSupport(in)); cookies.add(new TransformableSupport( DataObjectAdapters.source(this)));