Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrgronback2006-03-03 15:18:09 +0000
committerrgronback2006-03-03 15:18:09 +0000
commitd789d8383128b44c2cb7cc5a321f20c0cada53dc (patch)
tree467c9d771ca82c06999fd50011a9267869a91a5d /doc/org.eclipse.gmf.doc.ui
parent45180058906e489e1b6dcf77c9d03379b5cf6c00 (diff)
downloadorg.eclipse.gmf-tooling-d789d8383128b44c2cb7cc5a321f20c0cada53dc.tar.gz
org.eclipse.gmf-tooling-d789d8383128b44c2cb7cc5a321f20c0cada53dc.tar.xz
org.eclipse.gmf-tooling-d789d8383128b44c2cb7cc5a321f20c0cada53dc.zip
New tutorial cheatsheet.
Diffstat (limited to 'doc/org.eclipse.gmf.doc.ui')
-rw-r--r--doc/org.eclipse.gmf.doc.ui/.classpath7
-rw-r--r--doc/org.eclipse.gmf.doc.ui/.project28
-rw-r--r--doc/org.eclipse.gmf.doc.ui/META-INF/MANIFEST.MF16
-rw-r--r--doc/org.eclipse.gmf.doc.ui/build.properties7
-rw-r--r--doc/org.eclipse.gmf.doc.ui/cheatsheets/tutorial.xml85
-rw-r--r--doc/org.eclipse.gmf.doc.ui/plugin.properties16
-rw-r--r--doc/org.eclipse.gmf.doc.ui/plugin.xml17
-rw-r--r--doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/Activator.java92
-rw-r--r--doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenGraphWizardAction.java74
-rw-r--r--doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenMapWizardAction.java86
-rw-r--r--doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenProjectWizardAction.java94
-rw-r--r--doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenToolWizardAction.java74
12 files changed, 596 insertions, 0 deletions
diff --git a/doc/org.eclipse.gmf.doc.ui/.classpath b/doc/org.eclipse.gmf.doc.ui/.classpath
new file mode 100644
index 000000000..751c8f2e5
--- /dev/null
+++ b/doc/org.eclipse.gmf.doc.ui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/doc/org.eclipse.gmf.doc.ui/.project b/doc/org.eclipse.gmf.doc.ui/.project
new file mode 100644
index 000000000..2fd157982
--- /dev/null
+++ b/doc/org.eclipse.gmf.doc.ui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.gmf.doc.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/doc/org.eclipse.gmf.doc.ui/META-INF/MANIFEST.MF b/doc/org.eclipse.gmf.doc.ui/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..07bc40325
--- /dev/null
+++ b/doc/org.eclipse.gmf.doc.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.gmf.doc.ui;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.gmf.internal.doc.ui.Activator
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.ui.cheatsheets,
+ org.eclipse.gmf.graphdef.edit,
+ org.eclipse.gmf.bridge.ui,
+ org.eclipse.emf.codegen.ecore.ui,
+ org.eclipse.gmf.tooldef.edit
+Eclipse-LazyStart: true
diff --git a/doc/org.eclipse.gmf.doc.ui/build.properties b/doc/org.eclipse.gmf.doc.ui/build.properties
new file mode 100644
index 000000000..cd302b5f7
--- /dev/null
+++ b/doc/org.eclipse.gmf.doc.ui/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ cheatsheets/
diff --git a/doc/org.eclipse.gmf.doc.ui/cheatsheets/tutorial.xml b/doc/org.eclipse.gmf.doc.ui/cheatsheets/tutorial.xml
new file mode 100644
index 000000000..84204e69b
--- /dev/null
+++ b/doc/org.eclipse.gmf.doc.ui/cheatsheets/tutorial.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<cheatsheet title="GMF Tutorial">
+ <intro href="http://wiki.eclipse.org/index.php/GMF_Tutorial">
+ <description>This tutorial guides you through the definition, mapping, and generation of a graphical editor for mindmaps using GMF.<br/><br/>To start working on this cheatsheet, click the &quot;Click to Begin&quot; button below.<br/><br/>For each step, press the Help button (?) to access full instructions and viewlets for each step.</description>
+ </intro>
+
+ <item href="http://wiki.eclipse.org/index.php/GMF_Tutorial#A_New_Project"
+ dialog="true"
+ title="Create a New Project" skip="true">
+ <action pluginId="org.eclipse.gmf.doc.ui"
+ class="org.eclipse.gmf.internal.doc.ui.actions.OpenProjectWizardAction"
+ param1="org.eclipse.gmf.examples.mindmap"
+ param2="model"/>
+ <description>First, we'll create a new project to hold our models.<br/><br/>The default name will be set and a new 'model' folder will be created for you, if you use the "Click to Perform" button below.</description>
+ </item>
+
+ <item href="http://wiki.eclipse.org/index.php/GMF_Tutorial#Domain_Model_Definition" skip="true"
+ title="The Domain Model">
+ <description>At this point, you can either copy the provided mindmap.ecore model into the 'model' folder, or use the ECore editor to model it using the provided diagram (press help (?) icon above).<br/><br/>When you're done, create a new genmodel for mindmap.ecore and generate the model and edit code.
+ <br/><br/>The following steps are required:
+ <br/><br/>1. Right-click the mindmap.ecore file and select <b>New... | Other... | Eclipse Modeling Framework | EMF Model</b> and use the defaults of the wizard to create a new mindmap.genmodel.
+ <br/><br/>2. Select the Mindmap package below the root of the genmodel and in the Properties view, change the <b>Base Package</b> property to <b>org.eclipse.gmf.examples</b>.
+ <br/><br/>3. Right-click on the root of the genmodel and select <b>Generate Model Code</b> followed by <b>Generate Edit Code</b>.
+ <br/><br/><br/>Now, with our domain model ready, we can begin our graphical definition. Press "Click to Complete" below.
+ </description>
+ </item>
+
+ <item
+ href="http://wiki.eclipse.org/index.php/GMF_Tutorial#Graphical_Definition"
+ dialog="true" skip="true"
+ title="Creating a Graphical Definition">
+ <action
+ pluginId="org.eclipse.gmf.doc.ui"
+ class="org.eclipse.gmf.internal.doc.ui.actions.OpenGraphWizardAction"
+ param1="mindmap.gmfgraph"/>
+ <description>In a graphical definition, you will define figures, nodes, compartments, connections, etc.<br/><br/>Using the wizard, we can get started on our graphical definition by examining our domain model. Use the "Click to Perform" button to get started.
+ <br/><br/>The following steps are required:
+ <br/><br/>1. In the wizard, select the 'model' folder to hold the mindmap.gmfgraph model.
+ <br/><br/>2. The second page of the wizard has a <b>Browse</b> button that should easily find our mindmap.ecore model.
+ <br/><br/>3. The last page of the wizard gives us options for those features found in our domain model (node, link, or label). Using the full tutorial text linked from the Help (?) button above, select the appropriate options, or just leave the defaults if you'd prefer.
+ </description>
+ </item>
+
+ <item href="http://wiki.eclipse.org/index.php/GMF_Tutorial#Tooling_Definition"
+ dialog="true" skip="true"
+ title="Create a Tooling Definition">
+ <action
+ pluginId="org.eclipse.gmf.doc.ui"
+ class="org.eclipse.gmf.internal.doc.ui.actions.OpenToolWizardAction"
+ param1="mindmap.gmftool"/>
+ <description>Our graphical definition for our editor will need tooling to be useful. We will again use a wizard to get started by examining the domain model once more.
+ <br/><br/>The following steps are required:
+ <br/><br/>1. Again, select the 'model' folder to hold the mindmap.gmftool model.
+ <br/><br/>2. And, on the second page we will locate our mindmap.ecore file as before.
+ <br/><br/>3. On the last page, we can again use the full tutorial text linked from the Help (?) button above to select the appropriate tool options, or just leave the defaults if you'd prefer.
+ </description>
+ </item>
+
+ <item title="Create a Mapping Definition" dialog="true" skip="true"
+ href="http://wiki.eclipse.org/index.php/GMF_Tutorial#Mapping_Definition">
+ <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"
+ />
+ <description>Now it's time to map our graphical elements and their tools to our domain model.
+ <br/><br/>The following steps are required:
+ <br/><br/>1. Again, select the 'model' folder to hold the mindmap.gmfmap model.
+ <br/><br/>2. On the second page, each of our domain, graphical definition, and tooling definition files are preset, so we will just need to press <b>Load</b> for each and press <b>Next</b>.
+ <br/><br/>3. Select <b>Map</b> for our 'Diagram Root Element'.
+ <br/><br/>4. On the last page of the wizard, examine the mappings determined appropriate by the wizard. Follow the full instructions in the Help (?) for details on this step, or just press <b>Finish</b>.
+ </description>
+ </item>
+
+ <item title="Code Generation" skip="true" href="http://wiki.eclipse.org/index.php/GMF_Tutorial#Code_Generation">
+ <description>The last model you'll need will be transformed from the mapping model and contain those properties needed to generate the source code for your editor.<br/><br/>To produce the generator model, right-click on your mindmap.gmfmap file and select <b>Create generator model...</b>.<br/><br/>You may want to browse this model and examine its properties. There are many options to consider when generating code. When you're ready, right-click the mindmap.gmfgen file and select <b>Generate diagram code</b>.</description>
+ </item>
+
+ <item title="Running the Diagram" href="http://wiki.eclipse.org/index.php/GMF_Tutorial#Running_the_Diagram">
+ <description>You are ready to test the diagram. From the <b>Run | Run...</b> menu, create a new <b>Eclipse Application</b> runtime configuration and launch your diagram using the default settings.<br/><br/>You'll need to create a project and then a <b>New | Examples | Mindmap diagram</b>. Explore the functionality provided, including layout, alignment, selection, etc.</description>
+ </item>
+</cheatsheet> \ No newline at end of file
diff --git a/doc/org.eclipse.gmf.doc.ui/plugin.properties b/doc/org.eclipse.gmf.doc.ui/plugin.properties
new file mode 100644
index 000000000..23325acdf
--- /dev/null
+++ b/doc/org.eclipse.gmf.doc.ui/plugin.properties
@@ -0,0 +1,16 @@
+###############################################################################
+# Copyright (c) 2006 Borland Software Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Borland Software Corporation - initial API and implementation
+###############################################################################
+pluginName = GMF Documentation Cheatsheets
+providerName = Eclipse.org
+
+cheatsheet.tutorial.desc = A basic tutorial covering the tooling side of GMF.
+cheatsheet.tutorial.name = GMF Tutorial
+cheatsheet.category.gmf = Graphical Modeling Framework \ No newline at end of file
diff --git a/doc/org.eclipse.gmf.doc.ui/plugin.xml b/doc/org.eclipse.gmf.doc.ui/plugin.xml
new file mode 100644
index 000000000..fbccfe80a
--- /dev/null
+++ b/doc/org.eclipse.gmf.doc.ui/plugin.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.cheatsheets.cheatSheetContent">
+ <category
+ id="org.eclipse.gmf"
+ name="%cheatsheet.category.gmf"/>
+ <cheatsheet
+ category="org.eclipse.gmf"
+ contentFile="$nl$/cheatsheets/tutorial.xml"
+ id="org.eclipse.gmf.doc.cheatsheats.tutorial.cheatsheet"
+ name="%cheatsheet.tutorial.name">
+ <description>%cheatsheet.tutorial.desc</description>
+ </cheatsheet>
+ </extension>
+</plugin>
diff --git a/doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/Activator.java b/doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/Activator.java
new file mode 100644
index 000000000..6c644a7cc
--- /dev/null
+++ b/doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/Activator.java
@@ -0,0 +1,92 @@
+package org.eclipse.gmf.internal.doc.ui;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The shared instance.
+ private static Activator plugin;
+
+ /**
+ * The constructor.
+ */
+ public Activator() {
+ plugin = this;
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ }
+
+ /**
+ * Returns the shared instance.
+ *
+ * @return the shared instance.
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given plug-in
+ * relative path.
+ *
+ * @param path
+ * the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.gmf.doc.ui", path);
+ }
+
+ public static Shell getActiveWorkbenchShell() {
+ IWorkbenchWindow window = getActiveWorkbenchWindow();
+ if (window != null)
+ return window.getShell();
+ else
+ return null;
+
+ }
+
+ public static IWorkbenchWindow getActiveWorkbenchWindow() {
+ return getDefault().getWorkbench().getActiveWorkbenchWindow();
+ }
+
+ public static void log(Exception ex) {
+ if (ex instanceof CoreException) {
+ log((CoreException) ex);
+ } else {
+ log(new Status(IStatus.ERROR, getPluginID(), 0, ex.getMessage(), ex));
+ }
+ }
+
+ public static void log(IStatus s) {
+ getDefault().getLog().log(s);
+ }
+
+ public static String getPluginID() {
+ return getDefault().getBundle().getSymbolicName();
+ }
+
+}
diff --git a/doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenGraphWizardAction.java b/doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenGraphWizardAction.java
new file mode 100644
index 000000000..e584fcb34
--- /dev/null
+++ b/doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenGraphWizardAction.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Borland Software Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.gmf.internal.doc.ui.actions;
+
+import org.eclipse.gmf.gmfgraph.presentation.GMFGraphModelWizard.GMFGraphModelWizardNewFileCreationPage;
+import org.eclipse.gmf.internal.bridge.wizards.GMFGraphSimpleModelWizard;
+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.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.IWorkbenchWizard;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.cheatsheets.ICheatSheetAction;
+import org.eclipse.ui.cheatsheets.ICheatSheetManager;
+
+public class OpenGraphWizardAction extends Action implements ICheatSheetAction {
+ private static final int WIZARD_WIDTH = 500;
+
+ private static final int WIZARD_HEIGHT = 500;
+
+ /**
+ * @param text
+ */
+ public OpenGraphWizardAction() {
+ super("OpenProject"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run() {
+ run(new String[] {}, null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.cheatsheets.ICheatSheetAction#run(java.lang.String[],
+ * org.eclipse.ui.cheatsheets.ICheatSheetManager)
+ */
+ public void run(String[] params, ICheatSheetManager manager) {
+ final String modelName;
+ if (params != null && params.length > 0) {
+ modelName = params[0];
+ } else {
+ modelName = "mindmap.gmfgraph";
+ }
+ final IWizard wizard = new GMFGraphSimpleModelWizard();
+
+ if (wizard instanceof IWorkbenchWizard) {
+ ((IWorkbenchWizard) wizard).init(PlatformUI.getWorkbench(), new StructuredSelection());
+ }
+ WizardDialog dialog = new WizardDialog(Activator.getActiveWorkbenchShell(), wizard);
+ dialog.create();
+ GMFGraphModelWizardNewFileCreationPage page = (GMFGraphModelWizardNewFileCreationPage) wizard.getPage("Whatever");
+ page.setFileName(modelName);
+ dialog.getShell().setSize(Math.max(WIZARD_WIDTH, dialog.getShell().getSize().x), WIZARD_HEIGHT);
+ dialog.open();
+ notifyResult(dialog.getReturnCode() == Dialog.OK);
+ }
+
+}
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
new file mode 100644
index 000000000..db5a5c48c
--- /dev/null
+++ b/doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenMapWizardAction.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Borland Software Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.gmf.internal.doc.ui.actions;
+
+import org.eclipse.gmf.internal.bridge.wizards.NewGMFMapModelWizard;
+import org.eclipse.gmf.internal.bridge.wizards.pages.NewMapFileCreationPage;
+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.IWorkbenchWizard;
+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("OpenProject"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run() {
+ run(new String[] {}, null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.cheatsheets.ICheatSheetAction#run(java.lang.String[],
+ * org.eclipse.ui.cheatsheets.ICheatSheetManager)
+ */
+ public void run(String[] params, ICheatSheetManager manager) {
+ final String modelName;
+
+ if (params != null && params.length > 0) {
+ modelName = params[0];
+ } else {
+ modelName = "mindmap.gmfmap";
+ }
+ final NewGMFMapModelWizard wizard = new NewGMFMapModelWizard();
+ WizardInput input = wizard.getWizardInput();
+ if (params != null && params.length > 1) {
+ input.setInitialECoreFile(params[1]);
+ }
+ if (params != null && params.length > 2) {
+ input.setInitialGraphFile(params[2]);
+ }
+ if (params != null && params.length > 3) {
+ input.setInitialToolFile(params[3]);
+ }
+
+ if (wizard instanceof IWorkbenchWizard) {
+ ((IWorkbenchWizard) wizard).init(PlatformUI.getWorkbench(), new StructuredSelection());
+ }
+ WizardDialog dialog = new WizardDialog(Activator.getActiveWorkbenchShell(), wizard);
+ dialog.create();
+ NewMapFileCreationPage filePage = (NewMapFileCreationPage) wizard.getPage("newMapFileCreationPage");
+ filePage.setFileName(modelName);
+
+ dialog.getShell().setSize(Math.max(WIZARD_WIDTH, dialog.getShell().getSize().x), WIZARD_HEIGHT);
+ dialog.open();
+ notifyResult(dialog.getReturnCode() == Dialog.OK);
+ }
+
+}
diff --git a/doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenProjectWizardAction.java b/doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenProjectWizardAction.java
new file mode 100644
index 000000000..f1e1de644
--- /dev/null
+++ b/doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenProjectWizardAction.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Borland Software Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.gmf.internal.doc.ui.actions;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.gmf.internal.bridge.wizards.NewGMFProjectWizard;
+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.IWorkbenchWizard;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.cheatsheets.ICheatSheetAction;
+import org.eclipse.ui.cheatsheets.ICheatSheetManager;
+import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
+
+public class OpenProjectWizardAction extends Action implements ICheatSheetAction {
+ private static final int SIZING_WIZARD_WIDTH = 500;
+
+ private static final int SIZING_WIZARD_HEIGHT = 500;
+
+ private IFolder folder;
+
+ /**
+ * @param text
+ */
+ public OpenProjectWizardAction() {
+ super("OpenProject"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run() {
+ run(new String[] {}, null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.cheatsheets.ICheatSheetAction#run(java.lang.String[],
+ * org.eclipse.ui.cheatsheets.ICheatSheetManager)
+ */
+ public void run(String[] params, ICheatSheetManager manager) {
+ String projectName = null;
+ final String modelFolderName;
+ if (params != null && params.length > 1) {
+ projectName = params[0];
+ modelFolderName = params[1];
+ } else {
+ modelFolderName = "model";
+ }
+
+ final NewGMFProjectWizard wizard = new NewGMFProjectWizard() {
+ public boolean performFinish() {
+ super.performFinish();
+ WizardNewProjectCreationPage page = (WizardNewProjectCreationPage) getPage("NewProjectCreationPage");
+ folder = page.getProjectHandle().getFolder(modelFolderName);
+
+ try {
+ folder.create(false, true, null);
+ } catch (CoreException e) {
+ Activator.log(e);
+ }
+ return true;
+ }
+ };
+ wizard.setInitialProjectName(projectName);
+ wizard.setShowDashboard(false);
+
+ if (wizard instanceof IWorkbenchWizard) {
+ ((IWorkbenchWizard) wizard).init(PlatformUI.getWorkbench(), new StructuredSelection());
+ }
+ WizardDialog dialog = new WizardDialog(Activator.getActiveWorkbenchShell(), wizard);
+ dialog.create();
+ dialog.getShell().setSize(Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT);
+ dialog.open();
+ notifyResult(dialog.getReturnCode() == Dialog.OK);
+
+ }
+
+}
diff --git a/doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenToolWizardAction.java b/doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenToolWizardAction.java
new file mode 100644
index 000000000..87a04af7f
--- /dev/null
+++ b/doc/org.eclipse.gmf.doc.ui/src/org/eclipse/gmf/internal/doc/ui/actions/OpenToolWizardAction.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Borland Software Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.gmf.internal.doc.ui.actions;
+
+import org.eclipse.gmf.internal.bridge.wizards.GMFToolSimpleModelWizard;
+import org.eclipse.gmf.internal.doc.ui.Activator;
+import org.eclipse.gmf.tooldef.presentation.GMFToolModelWizard.GMFToolModelWizardNewFileCreationPage;
+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.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.IWorkbenchWizard;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.cheatsheets.ICheatSheetAction;
+import org.eclipse.ui.cheatsheets.ICheatSheetManager;
+
+public class OpenToolWizardAction extends Action implements ICheatSheetAction {
+ private static final int WIZARD_WIDTH = 500;
+
+ private static final int WIZARD_HEIGHT = 500;
+
+ /**
+ * @param text
+ */
+ public OpenToolWizardAction() {
+ super("OpenProject"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run() {
+ run(new String[] {}, null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.cheatsheets.ICheatSheetAction#run(java.lang.String[],
+ * org.eclipse.ui.cheatsheets.ICheatSheetManager)
+ */
+ public void run(String[] params, ICheatSheetManager manager) {
+ final String modelName;
+ if (params != null && params.length > 0) {
+ modelName = params[0];
+ } else {
+ modelName = "mindmap.gmftool";
+ }
+ final IWizard wizard = new GMFToolSimpleModelWizard();
+
+ if (wizard instanceof IWorkbenchWizard) {
+ ((IWorkbenchWizard) wizard).init(PlatformUI.getWorkbench(), new StructuredSelection());
+ }
+ WizardDialog dialog = new WizardDialog(Activator.getActiveWorkbenchShell(), wizard);
+ dialog.create();
+ GMFToolModelWizardNewFileCreationPage page = (GMFToolModelWizardNewFileCreationPage) wizard.getPage("Whatever");
+ page.setFileName(modelName);
+ dialog.getShell().setSize(Math.max(WIZARD_WIDTH, dialog.getShell().getSize().x), WIZARD_HEIGHT);
+ dialog.open();
+ notifyResult(dialog.getReturnCode() == Dialog.OK);
+ }
+
+}

Back to the top