| /** |
| * <copyright> |
| * |
| * Copyright (c) 2011 E.D.Willink 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: |
| * E.D.Willink - initial API and implementation |
| * |
| * </copyright> |
| * |
| * $Id: GenerateEssentialOCLEditor.mwe2,v 1.4 2011/05/20 09:37:03 ewillink Exp $ |
| * |
| * Run As->MWE2 Workflow to regenerate the editor. |
| * If it fails with a stack dump, open the Xtext file and do |
| * a dummy edit. Generally there is an error in the source file. |
| */ |
| module GenerateMarkupEditor |
| |
| import org.eclipse.emf.mwe.utils.* |
| import org.eclipse.xtext.generator.* |
| import org.eclipse.xtext.ui.generator.* |
| |
| var markup.file.extensions = "markupocl" |
| var markupprojectName = "org.eclipse.ocl.examples.xtext.markup" |
| var markupruntimeProject = "../${markupprojectName}" |
| |
| /** |
| * Generate the markup Editor. |
| */ |
| Workflow { |
| bean = StandaloneSetup { |
| scanClassPath = true |
| platformUri = "${markupruntimeProject}/.." |
| registerGeneratedEPackage = "org.eclipse.ocl.examples.xtext.markup.MarkupPackage" |
| registerGenModelFile = "platform:/resource/org.eclipse.ocl.examples.xtext.markup/model/Markup.genmodel" |
| } |
| |
| component = DirectoryCleaner { |
| directory = "${markupruntimeProject}/src-gen" |
| } |
| |
| component = DirectoryCleaner { |
| directory = "${markupruntimeProject}.ui/src-gen" |
| } |
| |
| component = Generator { |
| pathRtProject = markupruntimeProject |
| pathUiProject = "${markupruntimeProject}.ui" |
| projectNameRt = markupprojectName |
| projectNameUi = "${markupprojectName}.ui" |
| mergeManifest = false |
| |
| language = { |
| uri = "classpath:/org/eclipse/ocl/examples/xtext/markup/Markup.xtext" |
| fileExtensions = markup.file.extensions |
| |
| // Java API to access grammar elements (required by several other fragments) |
| fragment = grammarAccess.GrammarAccessFragment {} |
| |
| |
| // the serialization component |
| fragment = serializer.SerializerFragment {} |
| |
| // a custom ResourceFactory for use with EMF |
| fragment = resourceFactory.ResourceFactoryFragment { |
| fileExtensions = markup.file.extensions |
| } |
| |
| fragment = parser.antlr.XtextAntlrGeneratorFragment { |
| options = { backtrack = true classSplitting = true } |
| } |
| |
| // check-based API for validation |
| /* |
| fragment = validation.CheckFragment {} |
| */ |
| |
| // java-based API for validation |
| fragment = validation.JavaValidatorFragment { |
| composedCheck = "org.eclipse.xtext.validation.ImportUriValidator" |
| // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator" |
| } |
| |
| // scoping and exporting API |
| fragment = scoping.ImportNamespacesScopingFragment {} |
| fragment = exporting.QualifiedNamesFragment {} |
| |
| // formatter API |
| fragment = formatting.FormatterFragment {} |
| |
| // labeling API |
| fragment = labeling.LabelProviderFragment {} |
| |
| // outline API |
| fragment = outline.OutlineTreeProviderFragment {} |
| fragment = outline.QuickOutlineFragment {} |
| |
| // java-based API for content assistance |
| fragment = contentAssist.JavaBasedContentAssistFragment {} |
| |
| fragment = parser.antlr.XtextAntlrUiGeneratorFragment { |
| options = { backtrack = true classSplitting = true} |
| } |
| |
| fragment = builder.BuilderIntegrationFragment {} |
| |
| // quickfix API |
| fragment = quickfix.QuickfixProviderFragment {} |
| } |
| } |
| } |