Search code examples
javaeclipseeclipse-plugin

Eclipse plugin development: Disabling Java Structure Compare when comparing files?


I used the following code to compare two files:

CompareConfiguration config = new CompareConfiguration();
config.setRightEditable(false);
config.setLeftEditable(false);
config.setLeftLabel("Klasse 1");
config.setRightLabel("Klasse 2");
config.setProperty(CompareConfiguration.USE_OUTLINE_VIEW, Boolean.FALSE);

CompareUI.openCompareEditorOnPage(new EditorInput(config, file1, file2), page);

This works and a compare editor is opened. But unfortunately, the Java Source Compare and the Java Structure Compare is openend. I want to permanently disable Java Structure Compare. How can I do that?


Solution

  • Try using a CompareEditorInput (instead of EditorInput) and then setting the Configuration property of that to a CompareConfiguration which you can set the set a preference store using one of it's constructors. The ComparePreferences has a preference of doing the structure compare (or not presumably).