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.
This issue resulted from the Tag Editor Support API Inception Review. The DocumentElementInfo class should be removed, as its method are either not used or can be replaced by DocumentModel methods. BaseDocument should not appear in the API. Only javax.swing.text.Document should be used. There are several classes in the API which are not final and they have protected methods, thus it is not clear whether they are intended to be extended. These classes should be made final. Listener interfaces should extend EventListener. The DocumentModelProvider class contains a single method. This method should be moved to DocumentModel and the class removed.
1) DocumentElementInfo removal: The class has been removed and the DocumentModel now has public String getType() method instead. This method is used to determine the type of the document element and is mostly used by clients (navigator, folding) to determine the DocumentElement type (based on the type the client changes its behaviour). Andrei correctly pointed out, that because of that (not only) there has to be a dependency between a client and the provider. For example a XML DocumentModel provider will define XML_TAG, XML_TEXT element types and the client needs to use it. Of course there always has to be a kind of dependency between the client and the provider, but at least the compile dependency is eliminated by the "String" approach. On the other hand this causes that the types has to be defined in both client and provider and the content (content of the strings) has to be the same. 2) DocumentElementListener and DocumentModelListener now extends EventListener 3) DocumentModelProvider.getDocumentModel() static method moved to DocumentModel class and the DocumentModelProvider class has been removed. 4) All API classes are now final and do not contain any protected methods. 5) BaseDocument removal has been done in all API classes even there still will be defacto dependency on that class. So I added a warning message (exception) saying that currently it is necessary to pass BaseDocument instance into the DocumentModel.getDocumentProvider(j.s.t.Document) method.
Closing DevRev issue.