DomManager and registering DomFileDescription

I'm working through the tutorial "Accessing XML through IntelliJ IDEA DOM".

http://www.jetbrains.com/idea/documentation/dom-rp.html

The tutorial says to register the model through:

DomManager manager = DomManager.getDomManager(project);     manager.registerFileDescription(new DomFileDescription(Root.class, "root") {      protected void initializeFileDescription() {      }     });


 


But when I go to do this I notice that:

   manager.registerFileDescription(new DomFileDescription(Root.class, "root")


 


is depricated and the JavaDoc says:

   Make your file description an extension.

Does anyone have a small code snippet to share for regsitering the DOM model in 8.x?

Writing an IntelliJ plugin is like been a character in the The Da Vinci Code! All help much appreciated.

Tegan

2 comments
Comment actions Permalink

From Spring integration plugin.xml:

<dom.fileDescription
implementation="com.intellij.spring.SpringDomFileDescription"/>

0
Comment actions Permalink

You should provide an extension point:

<extensions defaultExtensionNs="com.intellij">

[...]

      <dom.fileDescription implementation="FQCN"/>


</extensions>


Also check out the sources of bundled plugins at http://svn.jetbrains.org/idea/Trunk/bundled/

0

Please sign in to leave a comment.