Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2007-05-18 16:41:21 -0400
committeratikhomirov2007-05-18 16:41:21 -0400
commit2981c5cfb59542801e2f2d8931a75ea45038723a (patch)
tree6d48512004c6f09de9d1870a6d9d5e8bcf2d467c
parent5bd389884024b20123aedf56dd01177b14378d88 (diff)
downloadorg.eclipse.gmf-tooling-2981c5cfb59542801e2f2d8931a75ea45038723a.tar.gz
org.eclipse.gmf-tooling-2981c5cfb59542801e2f2d8931a75ea45038723a.tar.xz
org.eclipse.gmf-tooling-2981c5cfb59542801e2f2d8931a75ea45038723a.zip
[187811] akarjakina - Migration support refactored
-rw-r--r--plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/popup/actions/MigrateModelAction.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/popup/actions/MigrateModelAction.java b/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/popup/actions/MigrateModelAction.java
index a0ab3c550..78cea2ccc 100644
--- a/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/popup/actions/MigrateModelAction.java
+++ b/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/popup/actions/MigrateModelAction.java
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2006 Eclipse.org
+/*
+ * Copyright (c) 2006, 2007 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the Eclipse Public License v1.0 which
@@ -15,13 +15,12 @@ import java.util.Collections;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gmf.internal.common.migrate.MigrationUtil;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.gmf.internal.common.migrate.ModelLoadHelper;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -67,16 +66,14 @@ public class MigrateModelAction implements IObjectActionDelegate {
public void run(IAction action) {
final IFile modelFile = this.fileSelection;
URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
- ModelLoadHelper loadHelper = MigrationUtil.migrateModel(fileURI);
+ ModelLoadHelper loadHelper = new ModelLoadHelper(new ResourceSetImpl(), fileURI);
if (!loadHelper.isOK()) {
DiagnosticsDialog.openOk(getShell(), action.getText(), Messages.migration_problemsDetectedTitle, loadHelper.getDiagnostics());
return;
}
- String modelExtension = modelFile.getFileExtension();
- final IPath destPath = modelFile.getFullPath().removeFileExtension().addFileExtension(modelExtension);
InputDialog dlg = new InputDialog(getShell(), Messages.migration_modelDestinationFileTitle,
- Messages.migration_specifyFileNameLabel, destPath.lastSegment(), new IInputValidator() {
+ Messages.migration_specifyFileNameLabel, modelFile.getName(), new IInputValidator() {
public String isValid(String newText) {
IStatus fileNameStatus = ResourcesPlugin.getWorkspace().validateName(newText, IResource.FILE);

Back to the top