0

How can I open an Eclipse CompareEditor inside a View?

More specifically, I want the view to contain a SashForm. In the left sash I put some information about the commit, and in the right sash I want to put a compare editor that compares the commit to its parent. Is there such a thing even possible?

I've succeeded in using a GitCompareEditorInput from eGit and the CompareUI class to open a separate compare editor or a dialog with the compare editor (that compares a certain commit to its parent). But now I am interested in putting that compare editor inside another view, as detailed above.

Thanks

Update: I have tried CompareEditorInput.createContents(compositeParent) but I only get two empty rectangles.

2
  • It's a bit of an overkill, since you'd have to re-implement all editor functionalities inside an editor component
    – Georgian
    Feb 6, 2014 at 22:03
  • eclipse.compare.internal.CompareDialog seems to be able to do it. Right now I am trying to reverse engineer the way it does it.
    – cdmihai
    Feb 6, 2014 at 22:20

1 Answer 1

0

The key to hosting a CompareEditorInput class appears to be providing a class which implements org.eclipse.compare.ICompareContainer. Once you have this you connect it to the input using CompareEditorInput.setContainer(container).

org.eclipse.compare.internal.CompareContainer provides a partial implementation of the container but this is internal so should only be used as a guide rather than used directly.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.