user3418847
user3418847

Reputation: 93

How do I get the XML Dom node of where my cursor is in Eclipse?

How do I get the xml dom node and xpath to where my cursor is in an Eclipse custom XML editor that I am building. It is a textEditor. I am implementing IContentAssistProcessor thus far.

Upvotes: 0

Views: 592

Answers (1)

Michael
Michael

Reputation: 5072

You can get the position of the cursor in the text editor and you can implement an XML reader that stores the locations of the XML nodes using the SAX Locator. For a mouse event, you could then scan the document and find the best matching node. I am not sure how performant this is but this is where I would start.

Upvotes: 1

Related Questions