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.
Currently, class org.netbeans.modules.editor.NbEditorUtilities contains method public static DataObject getDataObject(Document doc) {...} Since DataObject will be deprecated, it would be useful to provide an additional method which returns a fileobject. That way, modules which use this utility class (e.g. JSP coloring module) do not need to depend on the DataObjects API. This is also related to issue 34541 (editor support without DataObjects): this editor will not put the DataObject as the property to the document; instead, it will probably put a FileObject there. So I suggest the new method is as follows: /** Get the fileobject from the document's * StreamDescriptionProperty property. */ public static FileObject getFileObject(Document doc) { Object sdp = doc.getProperty( Document.StreamDescriptionProperty); if (sdp instanceof FileObject) { return (FileObject)sdp; } if (sdp instanceof DataObject) { return ((DataObject)sdp).getPrimaryFile(); } return null; } Also related to issue 34814 - project should be available in the document.
fixed in [maintrunk] Thank you Petr. /cvs/editor/src/org/netbeans/modules/editor/NbEditorUtilities.java,v <-- NbEditorUtilities.java new revision: 1.14; previous revision: 1.13
Verified