Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authordstadnik2006-11-24 11:12:01 -0500
committerdstadnik2006-11-24 11:12:01 -0500
commit420c4280db54edebd541cc44ef0b714b867ef61d (patch)
tree39b7ed4d1a67e726d4047c6a7f3c7052cce465cb /doc
parent915e9299e5fd5c935f50e1c8963ecd414eee06f8 (diff)
downloadorg.eclipse.gmf-tooling-420c4280db54edebd541cc44ef0b714b867ef61d.tar.gz
org.eclipse.gmf-tooling-420c4280db54edebd541cc44ef0b714b867ef61d.tar.xz
org.eclipse.gmf-tooling-420c4280db54edebd541cc44ef0b714b867ef61d.zip
use new mapping wizard
Diffstat (limited to 'doc')
-rw-r--r--doc/org.eclipse.gmf.doc.ui/cheatsheets/tutorial.xml9
-rw-r--r--doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenMapWizardAction.java55
2 files changed, 35 insertions, 29 deletions
diff --git a/doc/org.eclipse.gmf.doc.ui/cheatsheets/tutorial.xml b/doc/org.eclipse.gmf.doc.ui/cheatsheets/tutorial.xml
index d9bcd0a44..aa964a5e2 100644
--- a/doc/org.eclipse.gmf.doc.ui/cheatsheets/tutorial.xml
+++ b/doc/org.eclipse.gmf.doc.ui/cheatsheets/tutorial.xml
@@ -60,10 +60,11 @@
<action
pluginId="org.eclipse.gmf.doc.ui"
class="org.eclipse.gmf.internal.doc.ui.actions.OpenMapWizardAction"
- param1="mindmap.gmfmap"
- param2="platform:/resource/org.eclipse.gmf.examples.mindmap/model/mindmap.ecore"
- param3="platform:/resource/org.eclipse.gmf.examples.mindmap/model/mindmap.gmfgraph"
- param4="platform:/resource/org.eclipse.gmf.examples.mindmap/model/mindmap.gmftool"
+ param1="org.eclipse.gmf.examples.mindmap/model"
+ param2="mindmap.gmfmap"
+ param3="platform:/resource/org.eclipse.gmf.examples.mindmap/model/mindmap.ecore"
+ param4="platform:/resource/org.eclipse.gmf.examples.mindmap/model/mindmap.gmfgraph"
+ param5="platform:/resource/org.eclipse.gmf.examples.mindmap/model/mindmap.gmftool"
/>
<description>Now it's time to map our graphical elements and their tools to our domain model.
<br/><br/>The following steps are required:
diff --git a/doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenMapWizardAction.java b/doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenMapWizardAction.java
index 2bdd78b4f..38d498479 100644
--- a/doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenMapWizardAction.java
+++ b/doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenMapWizardAction.java
@@ -10,36 +10,32 @@
*******************************************************************************/
package org.eclipse.gmf.internal.doc.ui.actions;
-import org.eclipse.gmf.internal.bridge.wizards.NewGMFMapModelWizard;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.gmf.internal.bridge.wizards.GMFMapGuideModelWizard;
import org.eclipse.gmf.internal.bridge.wizards.pages.NewMapFileCreationPage;
-import org.eclipse.gmf.internal.bridge.wizards.pages.OldWizardInput;
-import org.eclipse.gmf.internal.bridge.wizards.pages.WizardInput;
import org.eclipse.gmf.internal.doc.ui.Activator;
import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.ui.IActionDelegate;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.cheatsheets.ICheatSheetAction;
import org.eclipse.ui.cheatsheets.ICheatSheetManager;
public class OpenMapWizardAction extends Action implements ICheatSheetAction {
+
private static final int WIZARD_WIDTH = 500;
private static final int WIZARD_HEIGHT = 500;
- /**
- * @param text
- */
public OpenMapWizardAction() {
super("OpenMapWizard"); //$NON-NLS-1$
}
- /**
- * @see IActionDelegate#run(IAction)
- */
public void run() {
run(new String[] {}, null);
}
@@ -51,31 +47,40 @@ public class OpenMapWizardAction extends Action implements ICheatSheetAction {
* org.eclipse.ui.cheatsheets.ICheatSheetManager)
*/
public void run(String[] params, ICheatSheetManager manager) {
- final String modelName;
-
+ final String modelFolder;
if (params != null && params.length > 0) {
- modelName = params[0];
+ modelFolder = params[0];
} else {
- modelName = "mindmap.gmfmap";
+ modelFolder = "org.eclipse.gmf.examples.mindmap/model"; //$NON-NLS-1$
}
- final NewGMFMapModelWizard wizard = new NewGMFMapModelWizard();
- OldWizardInput input = (OldWizardInput)wizard.getWizardInput();
+ final String modelName;
if (params != null && params.length > 1) {
- input.setInitialECoreFile(params[1]);
- }
- if (params != null && params.length > 2) {
- input.setInitialGraphFile(params[2]);
+ modelName = params[1];
+ } else {
+ modelName = "mindmap.gmfmap"; //$NON-NLS-1$
}
- if (params != null && params.length > 3) {
- input.setInitialToolFile(params[3]);
+ // other models
+ List<URI> uris = new ArrayList<URI>();
+ for (int i = 2; i < 5; i++) {
+ String param = params[i];
+ if (param == null) {
+ continue;
+ }
+ try {
+ uris.add(URI.createURI(param));
+ } catch (IllegalArgumentException iae) {
+ Activator.log(iae);
+ }
}
// as IWorkbenchWizard
- wizard.init(PlatformUI.getWorkbench(), new StructuredSelection());
+ GMFMapGuideModelWizard wizard = new GMFMapGuideModelWizard();
+ wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(uris));
WizardDialog dialog = new WizardDialog(Activator.getActiveWorkbenchShell(), wizard);
dialog.create();
- NewMapFileCreationPage filePage = (NewMapFileCreationPage) wizard.getPage("newMapFileCreationPage");
+ NewMapFileCreationPage filePage = (NewMapFileCreationPage) wizard.getPage("newMapFileCreationPage"); //$NON-NLS-1$
+ filePage.setContainerFullPath(new Path(modelFolder));
filePage.setFileName(modelName);
dialog.getShell().setSize(Math.max(WIZARD_WIDTH, dialog.getShell().getSize().x), WIZARD_HEIGHT);

Back to the top