Debian Codegraph @

doc/org.eclipse.emf.cheatsheets/src/org/eclipse/emf/cheatsheets/actions/OpenEmptyEMFProjectWizardAction.java

raw
1 /**
2 * Copyright (c) 2006 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v2.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v20.html
7 *
8 * Contributors:
9 * IBM - Initial API and implementation
10 */
11 package org.eclipse.emf.cheatsheets.actions;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.ui.INewWizard;
15 import org.eclipse.ui.cheatsheets.ICheatSheetAction;
16 import org.eclipse.ui.cheatsheets.ICheatSheetManager;
17
18 import org.eclipse.emf.codegen.ecore.ui.EmptyProjectWizard;
19
20
21 /**
22 * <p>Action that opens the new EMF model wizard.
23 * @since 2.2.0
24 */
25 public class OpenEmptyEMFProjectWizardAction extends AbstractOpenWizardAction implements ICheatSheetAction
26 {
27 protected String projectName;
28
29 /**
30 * Execute the action
31 * @param params Array of parameters - index 0: path of the genmodel, index 1: model importer descriptor ID
32 * @param manager Cheatsheet Manager
33 */
34 public void run(String[] params, ICheatSheetManager manager)
35 {
36 projectName = params[0];
37 run();
38 }
39
40 /**
41 * Create a new wizard
42 * @exception CoreException
43 */
44 @Override
45 protected final INewWizard createWizard() throws CoreException
46 {
47 EmptyProjectWizard wizard = new EmptyProjectWizard();
48 if (projectName != null)
49 {
50 wizard.setInitialProjectName(projectName);
51 }
52 return wizard;
53 }
54 }