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);
Run Code Online (Sandbox Code Playgroud)
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?
尝试使用 CompareEditorInput(而不是 EditorInput),然后将其 Configuration 属性设置为 CompareConfiguration,您可以使用其构造函数之一设置首选项存储。ComparePreferences 优先进行结构比较(或者推测不进行)。
| 归档时间: |
|
| 查看次数: |
1108 次 |
| 最近记录: |