Created
July 18, 2011 00:04
-
-
Save juniorz/1088269 to your computer and use it in GitHub Desktop.
Open Xtext Project Wizard Action
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.eclipse.amalgam.tutorials.cheatsheets.xtext.actions; | |
import org.eclipse.jface.action.Action; | |
import org.eclipse.jface.dialogs.Dialog; | |
import org.eclipse.jface.viewers.StructuredSelection; | |
import org.eclipse.jface.wizard.WizardDialog; | |
import org.eclipse.swt.widgets.Shell; | |
import org.eclipse.ui.PlatformUI; | |
import org.eclipse.ui.cheatsheets.ICheatSheetAction; | |
import org.eclipse.ui.cheatsheets.ICheatSheetManager; | |
import org.eclipse.xtext.xtext.ui.wizard.project.NewXtextProjectWizard; | |
import org.eclipse.xtext.xtext.ui.wizard.project.XtextProjectCreator; | |
public class OpenXtextProjectWizard extends Action implements ICheatSheetAction { | |
@Override | |
public void run(String[] params, ICheatSheetManager manager) { | |
super.run(); | |
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); | |
NewXtextProjectWizard wizard = new NewXtextProjectWizard(new XtextProjectCreator()); | |
wizard.init(PlatformUI.getWorkbench(), new StructuredSelection()); | |
WizardDialog dialog = new WizardDialog(shell, wizard); | |
dialog.create(); | |
dialog.open(); | |
notifyResult(dialog.getReturnCode() == Dialog.OK); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment