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

白昼怎懂夜的黑 提交于 2019-12-20 06:16:47

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/44742478/how-do-i-get-the-xml-dom-node-of-where-my-cursor-is-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!