diff options
Diffstat (limited to 'org.eclipse.emf.refactor.refactoring.runtime')
13 files changed, 41 insertions, 7 deletions
diff --git a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/config/RuntimeConfig.class b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/config/RuntimeConfig.class Binary files differindex b86f570..7fb5e4e 100644 --- a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/config/RuntimeConfig.class +++ b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/config/RuntimeConfig.class diff --git a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ltk/change/RefactoringChange.class b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ltk/change/RefactoringChange.class Binary files differindex 78bdc57..44fde36 100644 --- a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ltk/change/RefactoringChange.class +++ b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ltk/change/RefactoringChange.class diff --git a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ltk/command/PreviewCommand.class b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ltk/command/PreviewCommand.class Binary files differindex d250614..c52b73e 100644 --- a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ltk/command/PreviewCommand.class +++ b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ltk/command/PreviewCommand.class diff --git a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ltk/command/RefactoringCommand.class b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ltk/command/RefactoringCommand.class Binary files differindex ec85c23..575cff6 100644 --- a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ltk/command/RefactoringCommand.class +++ b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ltk/command/RefactoringCommand.class diff --git a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/test/EmfTestRefactoringCommand.class b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/test/EmfTestRefactoringCommand.class Binary files differindex 2e75191..7d25cf1 100644 --- a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/test/EmfTestRefactoringCommand.class +++ b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/test/EmfTestRefactoringCommand.class diff --git a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/test/JUnitTestCaseAdapter.class b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/test/JUnitTestCaseAdapter.class Binary files differindex 78d692b..ceafda0 100644 --- a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/test/JUnitTestCaseAdapter.class +++ b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/test/JUnitTestCaseAdapter.class diff --git a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ui/ApplicationMenu$1.class b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ui/ApplicationMenu$1.class Binary files differindex 5e84229..fadc5c3 100644 --- a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ui/ApplicationMenu$1.class +++ b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ui/ApplicationMenu$1.class diff --git a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ui/ApplicationMenu.class b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ui/ApplicationMenu.class Binary files differindex 9dfa824..25bd651 100644 --- a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ui/ApplicationMenu.class +++ b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ui/ApplicationMenu.class diff --git a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ui/InputPageButtonLoader.class b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ui/InputPageButtonLoader.class Binary files differindex 3a78f49..9c3a9a8 100644 --- a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ui/InputPageButtonLoader.class +++ b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ui/InputPageButtonLoader.class diff --git a/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/ltk/change/RefactoringChange.java b/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/ltk/change/RefactoringChange.java index 1035215..0bd18af 100644 --- a/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/ltk/change/RefactoringChange.java +++ b/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/ltk/change/RefactoringChange.java @@ -15,6 +15,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.change.ChangeDescription; +import org.eclipse.emf.ecore.util.EcoreUtil.Copier; import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.refactor.refactoring.runtime.ltk.command.RefactoringCommand; import org.eclipse.ltk.core.refactoring.Change; @@ -39,6 +40,11 @@ public class RefactoringChange extends Change { private final EObject root; /** + * Copy of the root element of the model (temporary model). + */ + private EObject rootCopy; + + /** * EditingDomain object of the EMF model. */ private final EditingDomain editingDomain; @@ -70,6 +76,7 @@ public class RefactoringChange extends Change { super(); this.name = name; this.root = root; + this.rootCopy = this.generateRootCopy(); this.editingDomain=editingDomain; if(null != changeDescription){ refactoringCommand = new RefactoringCommand(name,changeDescription); @@ -153,6 +160,27 @@ public class RefactoringChange extends Change { // } // throw new RuntimeException("Could not generate DiffModel"); // } + + /** + * Generates a copy of the EMF model presented by the root + * element. + * @return Copy of the EMF model presented by the root + * element. + */ + private EObject generateRootCopy() { + Copier copier = new Copier(); + EObject rootCopy = copier.copy(this.root); + copier.copyReferences(); + return rootCopy; + } + + /** + * Gets a copy of the root element of the model (temporary model). + * @return Copy of the root element of the model (temporary model). + */ + public EObject getRootCopy() { + return rootCopy; + } public RefactoringCommand getRefactoringCommand() { return refactoringCommand; diff --git a/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/ltk/command/PreviewCommand.java b/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/ltk/command/PreviewCommand.java index 38965f3..c792b55 100644 --- a/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/ltk/command/PreviewCommand.java +++ b/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/ltk/command/PreviewCommand.java @@ -12,7 +12,7 @@ package org.eclipse.emf.refactor.refactoring.runtime.ltk.command; import org.eclipse.emf.common.command.AbstractCommand; import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.util.EcoreUtil.Copier; +import org.eclipse.emf.ecore.util.EcoreUtil; /** * Class used for providing a command that provides @@ -66,10 +66,11 @@ public class PreviewCommand extends AbstractCommand { * element. */ private EObject generateRootCopy() { - Copier copier = new Copier(); - EObject rootCopy = copier.copy(this.root); - copier.copyReferences(); - return rootCopy; +// Copier copier = new Copier(); + return EcoreUtil.copy(this.root); +// EObject rootCopy = copier.copy(this.root); +// copier.copyReferences(); +// return rootCopy; } /** diff --git a/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/ltk/ui/RefactoringPreviewViewer.java b/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/ltk/ui/RefactoringPreviewViewer.java index 6f6d2d9..a5e8b90 100644 --- a/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/ltk/ui/RefactoringPreviewViewer.java +++ b/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/ltk/ui/RefactoringPreviewViewer.java @@ -34,6 +34,7 @@ public class RefactoringPreviewViewer implements IChangePreviewViewer { @Override
public Control getControl() {
return previewControl;
+// return parent;
}
@Override
@@ -50,7 +51,7 @@ public class RefactoringPreviewViewer implements IChangePreviewViewer { System.out.println("===>> model2: " + model2);
EMFCompare compare = EMFCompare.builder().build();
Comparison comparison = compare.compare(EMFCompare.createDefaultScope(model2, model1));
- ICompareEditingDomain editingDomain = EMFCompareEditingDomain.create(model1, model2, null);
+ ICompareEditingDomain editingDomain = EMFCompareEditingDomain.create(model2, model1, null);
AdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
CompareEditorInput compareEditorInput =
new ComparisonEditorInput(new CompareConfiguration(),
@@ -65,5 +66,8 @@ public class RefactoringPreviewViewer implements IChangePreviewViewer { }
}
+
+// @Override
+// public void setInput(ChangePreviewViewerInput input) { }
}
diff --git a/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/ui/ApplicationMenu.java b/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/ui/ApplicationMenu.java index b22a146..b20d7b8 100644 --- a/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/ui/ApplicationMenu.java +++ b/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/ui/ApplicationMenu.java @@ -187,8 +187,9 @@ public class ApplicationMenu extends ContributionItem { ConfigurationManager.getSelectedRefactorings(project); for(final Refactoring r : refactorings){ if(r.getGui().showInMenu(this.selection)){ - MenuItem menuItem = new MenuItem(menu, SWT.CHECK, index); + MenuItem menuItem = new MenuItem(menu, SWT.CHECK, menu.getItemCount()); menuItem.setText(r.getName()); + menuItem.setEnabled(true); menuItem.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { try { |