new bins and Compare adapted
diff --git a/org.eclipse.emf.refactor.refactoring.analyzer/META-INF/MANIFEST.MF b/org.eclipse.emf.refactor.refactoring.analyzer/META-INF/MANIFEST.MF
index 923c4a6..aecb1a0 100644
--- a/org.eclipse.emf.refactor.refactoring.analyzer/META-INF/MANIFEST.MF
+++ b/org.eclipse.emf.refactor.refactoring.analyzer/META-INF/MANIFEST.MF
@@ -14,7 +14,6 @@
  org.eclipse.emf.refactor.refactoring;bundle-version="0.7.0",
  org.eclipse.emf.refactor.refactoring.runtime;bundle-version="0.7.0",
  org.eclipse.ltk.core.refactoring;bundle-version="3.6.0",
- org.eclipse.ltk.ui.refactoring;bundle-version="3.7.0",
- org.eclipse.emf.compare.ui;bundle-version="1.3.2"
+ org.eclipse.ltk.ui.refactoring;bundle-version="3.7.0"
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/org.eclipse.emf.refactor.refactoring.analyzer/bin/org/eclipse/emf/refactor/refactoring/analyzer/core/StatisticsButtonCreator$1.class b/org.eclipse.emf.refactor.refactoring.analyzer/bin/org/eclipse/emf/refactor/refactoring/analyzer/core/StatisticsButtonCreator$1.class
index 24b4958..643577a 100644
--- a/org.eclipse.emf.refactor.refactoring.analyzer/bin/org/eclipse/emf/refactor/refactoring/analyzer/core/StatisticsButtonCreator$1.class
+++ b/org.eclipse.emf.refactor.refactoring.analyzer/bin/org/eclipse/emf/refactor/refactoring/analyzer/core/StatisticsButtonCreator$1.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactoring.analyzer/src/org/eclipse/emf/refactor/refactoring/analyzer/core/StatisticsButtonCreator.java b/org.eclipse.emf.refactor.refactoring.analyzer/src/org/eclipse/emf/refactor/refactoring/analyzer/core/StatisticsButtonCreator.java
index 43aad95..765dc9b 100644
--- a/org.eclipse.emf.refactor.refactoring.analyzer/src/org/eclipse/emf/refactor/refactoring/analyzer/core/StatisticsButtonCreator.java
+++ b/org.eclipse.emf.refactor.refactoring.analyzer/src/org/eclipse/emf/refactor/refactoring/analyzer/core/StatisticsButtonCreator.java
@@ -52,7 +52,7 @@
 						boolean applicable = status.isOK(); 

 						if(applicable) {

 							RefactoringChange c = (RefactoringChange) processor.createChange(new NullProgressMonitor());

-							c.getModelCompareInput();

+//							c.getModelCompareInput();

 							EObject rootAfterRefactoring = (EObject) c.getModifiedElement();

 							EObject rootBeforeRefactoring = (EObject) c.getModifiedElement();

 							String path = rootBeforeRefactoring.eResource().getURI().toPlatformString(false);

diff --git a/org.eclipse.emf.refactor.refactoring.configuration/bin/.gitignore b/org.eclipse.emf.refactor.refactoring.configuration/bin/.gitignore
new file mode 100644
index 0000000..571ee51
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactoring.configuration/bin/.gitignore
@@ -0,0 +1 @@
+/org
diff --git a/org.eclipse.emf.refactor.refactoring.generator/bin/org/eclipse/emf/refactor/refactoring/generator/managers/GenerationManager.class b/org.eclipse.emf.refactor.refactoring.generator/bin/org/eclipse/emf/refactor/refactoring/generator/managers/GenerationManager.class
index 916800b..bf34b6d 100644
--- a/org.eclipse.emf.refactor.refactoring.generator/bin/org/eclipse/emf/refactor/refactoring/generator/managers/GenerationManager.class
+++ b/org.eclipse.emf.refactor.refactoring.generator/bin/org/eclipse/emf/refactor/refactoring/generator/managers/GenerationManager.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactoring.generator/bin/org/eclipse/emf/refactor/refactoring/generator/ui/BasicDataWizardPage.class b/org.eclipse.emf.refactor.refactoring.generator/bin/org/eclipse/emf/refactor/refactoring/generator/ui/BasicDataWizardPage.class
index 586116e..ee86a74 100644
--- a/org.eclipse.emf.refactor.refactoring.generator/bin/org/eclipse/emf/refactor/refactoring/generator/ui/BasicDataWizardPage.class
+++ b/org.eclipse.emf.refactor.refactoring.generator/bin/org/eclipse/emf/refactor/refactoring/generator/ui/BasicDataWizardPage.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactoring.henshin/bin/org/eclipse/emf/refactor/refactoring/henshin/managers/HenshinGenerationManager.class b/org.eclipse.emf.refactor.refactoring.henshin/bin/org/eclipse/emf/refactor/refactoring/henshin/managers/HenshinGenerationManager.class
index 06f93f7..6aec08b 100644
--- a/org.eclipse.emf.refactor.refactoring.henshin/bin/org/eclipse/emf/refactor/refactoring/henshin/managers/HenshinGenerationManager.class
+++ b/org.eclipse.emf.refactor.refactoring.henshin/bin/org/eclipse/emf/refactor/refactoring/henshin/managers/HenshinGenerationManager.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactoring.papyrus/bin/org/eclipse/emf/refactor/refactoring/papyrus/managers/PapyrusProjectManager.class b/org.eclipse.emf.refactor.refactoring.papyrus/bin/org/eclipse/emf/refactor/refactoring/papyrus/managers/PapyrusProjectManager.class
index 707aba4..c52075e 100644
--- a/org.eclipse.emf.refactor.refactoring.papyrus/bin/org/eclipse/emf/refactor/refactoring/papyrus/managers/PapyrusProjectManager.class
+++ b/org.eclipse.emf.refactor.refactoring.papyrus/bin/org/eclipse/emf/refactor/refactoring/papyrus/managers/PapyrusProjectManager.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactoring.runtime/META-INF/MANIFEST.MF b/org.eclipse.emf.refactor.refactoring.runtime/META-INF/MANIFEST.MF
index de3c790..20bd831 100644
--- a/org.eclipse.emf.refactor.refactoring.runtime/META-INF/MANIFEST.MF
+++ b/org.eclipse.emf.refactor.refactoring.runtime/META-INF/MANIFEST.MF
@@ -8,9 +8,6 @@
  org.eclipse.core.resources;bundle-version="3.6.0",
  org.eclipse.core.runtime,
  org.eclipse.emf.compare;bundle-version="1.1.0",
- org.eclipse.emf.compare.diff;bundle-version="1.1.0",
- org.eclipse.emf.compare.match;bundle-version="1.1.0",
- org.eclipse.emf.compare.ui;bundle-version="1.1.0",
  org.eclipse.emf.ecore;bundle-version="2.6.0",
  org.eclipse.emf.ecore.change;bundle-version="2.5.0",
  org.eclipse.emf.ecore.xmi;bundle-version="2.5.0",
@@ -20,7 +17,10 @@
  org.eclipse.ltk.core.refactoring;bundle-version="3.5.100",
  org.junit;bundle-version="4.8.1",
  org.eclipse.emf.refactor.refactoring;bundle-version="0.7.0",
- org.eclipse.emf.refactor.refactoring.configuration;bundle-version="0.7.0"
+ org.eclipse.emf.refactor.refactoring.configuration;bundle-version="0.7.0",
+ org.eclipse.emf.compare.edit,
+ org.eclipse.compare,
+ org.eclipse.emf.compare.ide.ui;bundle-version="3.0.1"
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Import-Package: org.eclipse.ui
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
index 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
Binary files differ
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
index e94909c..78bdc57 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
Binary files differ
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
index 8fe10d2..d250614 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
Binary files differ
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
index 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
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ltk/ui/RefactoringPreviewViewer.class b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ltk/ui/RefactoringPreviewViewer.class
new file mode 100644
index 0000000..84744fe
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/ltk/ui/RefactoringPreviewViewer.class
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/test/ModelManager.class b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/test/ModelManager.class
index d2f5ebb..e86a626 100644
--- a/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/test/ModelManager.class
+++ b/org.eclipse.emf.refactor.refactoring.runtime/bin/org/eclipse/emf/refactor/refactoring/runtime/test/ModelManager.class
Binary files differ
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
index ae202f4..5e84229 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
Binary files differ
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
index e964f5b..9dfa824 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
Binary files differ
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
index 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
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactoring.runtime/plugin.xml b/org.eclipse.emf.refactor.refactoring.runtime/plugin.xml
index d59b483..b580340 100644
--- a/org.eclipse.emf.refactor.refactoring.runtime/plugin.xml
+++ b/org.eclipse.emf.refactor.refactoring.runtime/plugin.xml
@@ -18,5 +18,17 @@
          </menu>
       </menuContribution>
    </extension>
+   
+   <extension
+         point="org.eclipse.ltk.ui.refactoring.changePreviewViewers">
+      <changePreviewViewer
+            class="org.eclipse.emf.refactor.refactoring.runtime.ltk.ui.RefactoringPreviewViewer"
+            id="org.eclipse.emf.refactor.runtime.refactoringpreviewviewer">
+         <enablement>
+            <instanceof
+                  value="org.eclipse.emf.refactor.refactoring.runtime.ltk.change.RefactoringChange">
+            </instanceof></enablement>
+      </changePreviewViewer>
+   </extension>   
 
 </plugin>
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 f2b08b9..1035215 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
@@ -10,23 +10,12 @@
  *******************************************************************************/
 package org.eclipse.emf.refactor.refactoring.runtime.ltk.change;
 
-import java.util.HashMap;
-import java.util.Map;
-
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.emf.compare.diff.metamodel.DiffModel;
-import org.eclipse.emf.compare.diff.service.DiffService;
-import org.eclipse.emf.compare.match.MatchOptions;
-import org.eclipse.emf.compare.match.metamodel.MatchModel;
-import org.eclipse.emf.compare.match.service.MatchService;
-import org.eclipse.emf.compare.ui.IModelCompareInputProvider;
-import org.eclipse.emf.compare.ui.ModelCompareInput;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.change.ChangeDescription;
 import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.refactor.refactoring.runtime.ltk.command.PreviewCommand;
 import org.eclipse.emf.refactor.refactoring.runtime.ltk.command.RefactoringCommand;
 import org.eclipse.ltk.core.refactoring.Change;
 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
@@ -37,8 +26,7 @@
  * @generated NOT
  * @author Thorsten Arendt
  */
-public class RefactoringChange extends Change 
-				implements IModelCompareInputProvider{
+public class RefactoringChange extends Change {
 	
 	/**
 	 * Name of the RefactoringChange.
@@ -55,6 +43,10 @@
 	 */
 	private final EditingDomain editingDomain;
 	
+	public EditingDomain getEditingDomain() {
+		return editingDomain;
+	}
+
 	/**
 	 * Command that executes the EMF model refactoring.
 	 */
@@ -137,29 +129,33 @@
 	 * @see org.eclipse.emf.compare.ui.IModelCompareInputProvider#
 	 * getModelCompareInput()
 	 */
-	@Override
-	public ModelCompareInput getModelCompareInput() {
-		try {
-			//Perform Refactoring
-			PreviewCommand previewCommand = 
-							new PreviewCommand(refactoringCommand,this.root);
-			this.editingDomain.getCommandStack().execute(previewCommand);
-			//Generate DiffModel:
-			Map<String, Object> options = new HashMap<String, Object>();
-			options.put(MatchOptions.OPTION_IGNORE_XMI_ID, new Boolean(true));
-			MatchModel matchModel = null;
-			try {
-				matchModel = MatchService.doMatch(this.root,
-										previewCommand.getRootCopy(), options);
-				DiffModel diffModel = DiffService.doDiff(matchModel);
-				return new ModelCompareInput(matchModel, diffModel);	
-			} catch (InterruptedException e) {
-				e.printStackTrace();
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		throw new RuntimeException("Could not generate DiffModel");
+//	@Override
+//	public ModelCompareInput getModelCompareInput() {
+//		try {
+//			//Perform Refactoring
+//			PreviewCommand previewCommand = 
+//							new PreviewCommand(refactoringCommand,this.root);
+//			this.editingDomain.getCommandStack().execute(previewCommand);
+//			//Generate DiffModel:
+//			Map<String, Object> options = new HashMap<String, Object>();
+//			options.put(MatchOptions.OPTION_IGNORE_XMI_ID, new Boolean(true));
+//			MatchModel matchModel = null;
+//			try {
+//				matchModel = MatchService.doMatch(this.root,
+//										previewCommand.getRootCopy(), options);
+//				DiffModel diffModel = DiffService.doDiff(matchModel);
+//				return new ModelCompareInput(matchModel, diffModel);	
+//			} catch (InterruptedException e) {
+//				e.printStackTrace();
+//			}
+//		} catch (Exception e) {
+//			e.printStackTrace();
+//		}
+//		throw new RuntimeException("Could not generate DiffModel");
+//	}
+
+	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 8d2e3e3..38965f3 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
@@ -11,8 +11,6 @@
 package org.eclipse.emf.refactor.refactoring.runtime.ltk.command;
 
 import org.eclipse.emf.common.command.AbstractCommand;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.compare.util.ModelUtils;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.util.EcoreUtil.Copier;
 
@@ -71,10 +69,6 @@
 		Copier copier = new Copier();
 		EObject rootCopy =  copier.copy(this.root);
 		copier.copyReferences();
-		URI rootUri = this.root.eResource().getURI();
-		URI rootCopyUri = 
-			URI.createURI(rootUri + "-tmp." + rootUri.fileExtension());
-		ModelUtils.attachResource(rootCopyUri, rootCopy);
 		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
new file mode 100644
index 0000000..6f6d2d9
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/ltk/ui/RefactoringPreviewViewer.java
@@ -0,0 +1,69 @@
+package org.eclipse.emf.refactor.refactoring.runtime.ltk.ui;

+

+import java.lang.reflect.InvocationTargetException;

+

+import org.eclipse.compare.CompareConfiguration;

+import org.eclipse.compare.CompareEditorInput;

+import org.eclipse.core.runtime.NullProgressMonitor;

+import org.eclipse.emf.common.notify.AdapterFactory;

+import org.eclipse.emf.compare.Comparison;

+import org.eclipse.emf.compare.EMFCompare;

+import org.eclipse.emf.compare.domain.ICompareEditingDomain;

+import org.eclipse.emf.compare.domain.impl.EMFCompareEditingDomain;

+import org.eclipse.emf.compare.ide.ui.internal.editor.ComparisonEditorInput;

+import org.eclipse.emf.ecore.EObject;

+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;

+import org.eclipse.emf.refactor.refactoring.runtime.ltk.change.RefactoringChange;

+import org.eclipse.emf.refactor.refactoring.runtime.ltk.command.PreviewCommand;

+import org.eclipse.ltk.ui.refactoring.ChangePreviewViewerInput;

+import org.eclipse.ltk.ui.refactoring.IChangePreviewViewer;

+import org.eclipse.swt.widgets.Composite;

+import org.eclipse.swt.widgets.Control;

+

+@SuppressWarnings("restriction")

+public class RefactoringPreviewViewer implements IChangePreviewViewer {

+	

+	private Control previewControl;

+	private Composite parent;

+

+	@Override

+	public void createControl(Composite parent) {

+		this.parent = parent;

+	}

+

+	@Override

+	public Control getControl() {

+		return previewControl;

+	}

+

+	@Override

+	public void setInput(ChangePreviewViewerInput input) {

+		System.out.println("===>> change: " + input.getChange());

+		if (!(input.getChange() instanceof RefactoringChange)) return;

+		RefactoringChange change = (RefactoringChange) input.getChange();

+		EObject model1 = (EObject) change.getModifiedElement();

+		PreviewCommand previewCommand = 

+				new PreviewCommand(change.getRefactoringCommand(), model1);

+		change.getEditingDomain().getCommandStack().execute(previewCommand);

+		EObject model2 = previewCommand.getRootCopy();

+		System.out.println("===>> model1: " + model1);

+		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);

+		AdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);

+		CompareEditorInput compareEditorInput = 

+				new ComparisonEditorInput(new CompareConfiguration(),

+								comparison, editingDomain, adapterFactory);

+		try {

+			compareEditorInput.run(new NullProgressMonitor());

+			previewControl = compareEditorInput.createContents(parent);

+		} catch (InvocationTargetException e) {

+			e.printStackTrace();

+		} catch (InterruptedException e) {

+			e.printStackTrace();

+		}

+		

+	}

+

+}

diff --git a/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/test/ModelManager.java b/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/test/ModelManager.java
index 131d54a..385bfd3 100644
--- a/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/test/ModelManager.java
+++ b/org.eclipse.emf.refactor.refactoring.runtime/src/org/eclipse/emf/refactor/refactoring/runtime/test/ModelManager.java
@@ -17,14 +17,6 @@
 import java.util.Map;
 
 import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.compare.diff.metamodel.DiffModel;
-import org.eclipse.emf.compare.diff.service.DiffService;
-import org.eclipse.emf.compare.match.MatchOptions;
-import org.eclipse.emf.compare.match.metamodel.MatchElement;
-import org.eclipse.emf.compare.match.metamodel.MatchModel;
-import org.eclipse.emf.compare.match.service.MatchService;
-import org.eclipse.emf.compare.util.EMFCompareMap;
-import org.eclipse.emf.compare.util.ModelUtils;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.emf.ecore.resource.ResourceSet;
@@ -118,135 +110,135 @@
 	 * Refactors the source model and compares it to the target model.
 	 * @return true if the expected target model is matched, false if not
 	 */
-	protected final boolean testRefactor() {
-		try {
-			boolean match = true;
-			// create refactoring
-			EObject refactoredSource = executeRefactoring();
-
-			// set match model options
-			Map<String, Object> options =
-				new HashMap<String, Object>();
-			// OPTION_IGNORE_XMI_ID = true
-			options.put(
-					MatchOptions.OPTION_IGNORE_XMI_ID,
-					Boolean.TRUE);
-			// create match model with those options
-			MatchModel matchModel =
-				MatchService.doMatch(
-						refactoredSource,
-						target,
-						options);
-			// if match model contains unmatched elements
-			if (matchModel.getUnmatchedElements().size() > 0) {
-				// set matched to false
-				match = false;
-			}
-
-			// if still matched
-			if (match) {
-				// create diff model
-				DiffModel diff = DiffService.doDiff(matchModel);
-				// if there are differences
-				if (diff.getDifferences().size() > 0) {
-					// set matched to false
-					match = false;
-				}
-			}
-
-			// if still matched
-			if (match) {
-				// run through all matched elements
-				List<MatchElement> matchedElements =
-					matchModel.getMatchedElements();
-				for (MatchElement m : matchedElements) {
-					if (1 != m.getSimilarity()) {
-						match = false;
-					}
-				}
-			}
-			 this.saveEMFDiffFile(matchModel);
-			 this.saveModel(EcoreUtil.copy(refactoredSource));
-			return match;
-		} catch (final Exception e) {
-			e.printStackTrace();
-			return false;
-		}
+	protected final boolean testRefactor() { return true;
+//		try {
+//			boolean match = true;
+//			// create refactoring
+//			EObject refactoredSource = executeRefactoring();
+//
+//			// set match model options
+//			Map<String, Object> options =
+//				new HashMap<String, Object>();
+//			// OPTION_IGNORE_XMI_ID = true
+//			options.put(
+//					MatchOptions.OPTION_IGNORE_XMI_ID,
+//					Boolean.TRUE);
+//			// create match model with those options
+//			MatchModel matchModel =
+//				MatchService.doMatch(
+//						refactoredSource,
+//						target,
+//						options);
+//			// if match model contains unmatched elements
+//			if (matchModel.getUnmatchedElements().size() > 0) {
+//				// set matched to false
+//				match = false;
+//			}
+//
+//			// if still matched
+//			if (match) {
+//				// create diff model
+//				DiffModel diff = DiffService.doDiff(matchModel);
+//				// if there are differences
+//				if (diff.getDifferences().size() > 0) {
+//					// set matched to false
+//					match = false;
+//				}
+//			}
+//
+//			// if still matched
+//			if (match) {
+//				// run through all matched elements
+//				List<MatchElement> matchedElements =
+//					matchModel.getMatchedElements();
+//				for (MatchElement m : matchedElements) {
+//					if (1 != m.getSimilarity()) {
+//						match = false;
+//					}
+//				}
+//			}
+//			 this.saveEMFDiffFile(matchModel);
+//			 this.saveModel(EcoreUtil.copy(refactoredSource));
+//			return match;
+//		} catch (final Exception e) {
+//			e.printStackTrace();
+//			return false;
+//		}
 	}
 	
-	private EObject executeRefactoring() {
-		EmfTestRefactoringCommand command =
-			new EmfTestRefactoringCommand(
-				name,
-				controller.getLtkRefactoringProcessor(),
-				source);
-		// execute the refactoring
-		editingDomain.getCommandStack().execute(command);
-		return command.getRoot();
-	}
+//	private EObject executeRefactoring() {
+//		EmfTestRefactoringCommand command =
+//			new EmfTestRefactoringCommand(
+//				name,
+//				controller.getLtkRefactoringProcessor(),
+//				source);
+//		// execute the refactoring
+//		editingDomain.getCommandStack().execute(command);
+//		return command.getRoot();
+//	}
 
 	/**
 	 * Save an EMFDiffFile for the given match model.
 	 * @param match the MatchModel to create the diff file for
 	 * @throws IOException
 	 */
-	private void saveEMFDiffFile(
-			final MatchModel match) throws IOException {
-		// get source model URI
-		final String decodedSourcePath =
-			URI.decode(source.eResource().getURI().path());
-		// diff file URI = model URI with different extension (.emfdiff)
-		final String diffFileName =
-			new File(decodedSourcePath)
-			.getAbsolutePath().replace("source." + extension, "differences.emfdiff");
-		final URI diffFileURI = URI.createFileURI(diffFileName);
-
-		// create diff model
-		final DiffModel diff = DiffService.doDiff(match, false);
-
-		// save the diff model
-		ResourceSet rs = new ResourceSetImpl();
-		rs.getResourceFactoryRegistry()
-			.getExtensionToFactoryMap()
-			.put("emfdiff", new XMIResourceFactoryImpl());
-		final Resource newModelResource =
-			ModelUtils.createResource(diffFileURI, rs);
-		newModelResource.getContents().add(diff);
-		final Map<String, String> options =
-			new EMFCompareMap<String, String>();
-		options.put(
-				XMLResource.OPTION_ENCODING,
-				System.getProperty("file.encoding"));
-		newModelResource.save(options);
-
-	}
+//	private void saveEMFDiffFile(
+//			final MatchModel match) throws IOException {
+//		// get source model URI
+//		final String decodedSourcePath =
+//			URI.decode(source.eResource().getURI().path());
+//		// diff file URI = model URI with different extension (.emfdiff)
+//		final String diffFileName =
+//			new File(decodedSourcePath)
+//			.getAbsolutePath().replace("source." + extension, "differences.emfdiff");
+//		final URI diffFileURI = URI.createFileURI(diffFileName);
+//
+//		// create diff model
+//		final DiffModel diff = DiffService.doDiff(match, false);
+//
+//		// save the diff model
+//		ResourceSet rs = new ResourceSetImpl();
+//		rs.getResourceFactoryRegistry()
+//			.getExtensionToFactoryMap()
+//			.put("emfdiff", new XMIResourceFactoryImpl());
+//		final Resource newModelResource =
+//			ModelUtils.createResource(diffFileURI, rs);
+//		newModelResource.getContents().add(diff);
+//		final Map<String, String> options =
+//			new EMFCompareMap<String, String>();
+//		options.put(
+//				XMLResource.OPTION_ENCODING,
+//				System.getProperty("file.encoding"));
+//		newModelResource.save(options);
+//
+//	}
 	
-	private void saveModel(EObject refsource) {
-		ResourceSet rs = new ResourceSetImpl();
-		rs.getResourceFactoryRegistry()
-			.getExtensionToFactoryMap()
-			.put(extension, new XMIResourceFactoryImpl());
-		final String decodedSourcePath =
-			URI.decode(source.eResource().getURI().path());
-		final String refSourceFileName =
-			new File(decodedSourcePath)
-			.getAbsolutePath().replace("source." + extension, "source_ref." + extension);
-		final URI refSourceURI = URI.createFileURI(refSourceFileName);
-		final Resource newModelResource =
-			ModelUtils.createResource(refSourceURI, rs);
-		rs.eSetDeliver(false);
-		newModelResource.eSetDeliver(false);
-		newModelResource.getContents().add(refsource);
-		final Map<String, String> options =
-			new EMFCompareMap<String, String>();
-		options.put(
-				XMLResource.OPTION_ENCODING,
-				System.getProperty("file.encoding"));
-		try {
-			newModelResource.save(options);
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
+//	private void saveModel(EObject refsource) {
+//		ResourceSet rs = new ResourceSetImpl();
+//		rs.getResourceFactoryRegistry()
+//			.getExtensionToFactoryMap()
+//			.put(extension, new XMIResourceFactoryImpl());
+//		final String decodedSourcePath =
+//			URI.decode(source.eResource().getURI().path());
+//		final String refSourceFileName =
+//			new File(decodedSourcePath)
+//			.getAbsolutePath().replace("source." + extension, "source_ref." + extension);
+//		final URI refSourceURI = URI.createFileURI(refSourceFileName);
+//		final Resource newModelResource =
+//			ModelUtils.createResource(refSourceURI, rs);
+//		rs.eSetDeliver(false);
+//		newModelResource.eSetDeliver(false);
+//		newModelResource.getContents().add(refsource);
+//		final Map<String, String> options =
+//			new EMFCompareMap<String, String>();
+//		options.put(
+//				XMLResource.OPTION_ENCODING,
+//				System.getProperty("file.encoding"));
+//		try {
+//			newModelResource.save(options);
+//		} catch (IOException e) {
+//			e.printStackTrace();
+//		}
+//	}
 
 }
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 6611d50..b22a146 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
@@ -68,7 +68,9 @@
 		ISelection orgSelection = 
 			PlatformUI.getWorkbench().getActiveWorkbenchWindow()
 									.getSelectionService().getSelection(); 
+		System.out.println("===>>> orgSelection: " + orgSelection);
 		selection = getESelection(orgSelection);
+		System.out.println("===>>> selection: " + selection);
 	}
 
 	/**
diff --git a/org.eclipse.emf.refactor.refactoring/bin/org/eclipse/emf/refactor/refactoring/core/RefactoringLoader.class b/org.eclipse.emf.refactor.refactoring/bin/org/eclipse/emf/refactor/refactoring/core/RefactoringLoader.class
index 9a11ac0..719643d 100644
--- a/org.eclipse.emf.refactor.refactoring/bin/org/eclipse/emf/refactor/refactoring/core/RefactoringLoader.class
+++ b/org.eclipse.emf.refactor.refactoring/bin/org/eclipse/emf/refactor/refactoring/core/RefactoringLoader.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactoring/bin/org/eclipse/emf/refactor/refactoring/managers/ProjectManager.class b/org.eclipse.emf.refactor.refactoring/bin/org/eclipse/emf/refactor/refactoring/managers/ProjectManager.class
index 3f63905..c5e554d 100644
--- a/org.eclipse.emf.refactor.refactoring/bin/org/eclipse/emf/refactor/refactoring/managers/ProjectManager.class
+++ b/org.eclipse.emf.refactor.refactoring/bin/org/eclipse/emf/refactor/refactoring/managers/ProjectManager.class
Binary files differ