I am totally new to the Eclipse RCP platform. Are there any example how to use compare editor?
I have created a view, and now I want to add there compare editor to compare text data.
public class MyView extends ViewPart {
public static final String ID = "rcp.views.myview";
private TreeViewer treeViewer;
public MyView() {
super();
}
@Override
public void createPartControl(Composite parent) {
CompareViewerPane pane = new CompareViewerPane(parent, SWT.BORDER | SWT.FLAT);
//?????????????????
}
@Override
public void setFocus() {
}
}
I have not found a way to set up own view with compare pane (my poor experience in swt and jface, and mostly due to lack of working rcp examples). I have found a way (thanks to http://wiki.eclipse.org/FAQ_How_do_I_create_a_compare_editor%3F) to open compare pane using static methods of CompareUI class.
One more thing which I struggled with for a long time is setting up compare panes editable (actually I checked out from cvs eclipse compare plugin source code and ran it in debugger to find place where panes are set editable). On the http://wiki.eclipse.org/FAQ_How_do_I_create_a_compare_editor%3F they say that if one wants to create an editable compare pane, he just needs to set editable flags in CompareConfiguration, may be this have changed over time, but
don't believeto it. Currently (eclipse indigo) CompareConfiguration has editable flags set by default and to enable editable capability for compare viewers you have to implementIEditableContentinterface in your compare data source (CompareTtem that is described http://wiki.eclipse.org/FAQ_How_do_I_create_a_Compare_dialog%3F).That is all for now.