How to get document from compare editor? I have got CompareViewerSwitchingPane, but I don’t know how to extract document for left and right pane.
I need it to get text that is displayed in the editor.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I have found a way how one could get document for his CompareEditorInput. There are different kinds of compare inputs: the one that goes to CompareEditor and the ones that go to CompareEditor viewers.
I was so close with CompareUI.getDocument(Object), but first time I found it I gave it CompareEditorInput and it returned me
nullinstead of a reasonable object (may be for intermediate developer there is no mysteries, but not for me). And I put it aside thinking that this method does not work.Thanks to aphex due to which I gave a bit more attention to
CompareUI.getDocument(Object)and it stroke me with an idea: hey, why not to try to pass DiffNode instead of a CompareEditor and finally it worked!