1 package org.simantics.interop.update.editor;
3 import org.eclipse.ui.PartInitException;
4 import org.simantics.db.Resource;
5 import org.simantics.db.layer0.variable.RVI;
6 import org.simantics.ui.workbench.ResourceEditorInput2;
7 import org.simantics.utils.ui.workbench.WorkbenchUtils;
10 * Editor input for ModelUpdateEditor
12 * @author Marko Luukkainen <marko.luukkainen@vtt.fi>
15 public class UpdateEditorInput extends ResourceEditorInput2{
17 private String editorID;
21 private boolean newDistinct = false;
24 public UpdateEditorInput(String editorID, Resource r1, Resource r2, RVI rvi) {
25 this(editorID, r1, r2, null,rvi);
31 * @param r1 old model that is being updated
32 * @param r2 new model containing the changes that we want to apply
33 * @param r3 original model to detect user mace changes to the old model r1. This parameter can be
36 public UpdateEditorInput(String editorID, Resource r1, Resource r2, Resource r3, RVI rvi) {
37 super(editorID, r1, r1, rvi);
41 this.editorID = editorID;
44 public Resource getR1() {
48 public Resource getR2() {
52 public Resource getR3() {
57 public void openEditor() throws PartInitException {
58 WorkbenchUtils.openEditor(editorID, this);
61 // With tree-way comparison, treat new resources for compared old and new models as distinct.
62 // default : false. Comparison may consider that new objects in models r1 and r2 are the same.
63 public boolean isNewDistinct() {
67 public void setNewDistinct(boolean newDistinct) {
68 this.newDistinct = newDistinct;