| // Add dependency to the glue plugin |
| var genPlugin = GmfGen!GenPlugin.all.first; |
| genPlugin.requiredPlugins.add("org.eclipse.epsilon.eugenia.examples.executablestatemachine.glue"); |
| |
| // Add a customised label parser for Transition#actions |
| var transitionLink = GmfGen!GenLink.all.selectOne(l|l.editPartClassName == "TransitionEditPart"); |
| var modelFacet = transitionLink.labels.first.modelFacet; |
| var parser = new GmfGen!PredefinedParser; |
| parser.className = "ActionXtext2GmfParser"; |
| parser.editMethod = GmfGen!LabelTextAccessMethod#NATIVE; |
| parser.viewMethod = GmfGen!LabelTextAccessMethod#NATIVE; |
| findOrCreateGenParsers().implementations.add(parser); |
| modelFacet.parser = parser; |
| |
| // Remove any unused label parsers |
| delete GmfGen!GenParserImplementation.all.select(i|i.uses.isEmpty()); |
| |
| // Ensures that the GenParsers element exists |
| operation findOrCreateGenParsers() : GmfGen!GenParsers { |
| if (GmfGen!GenParsers.all.isEmpty()) { |
| genEditorGenerator.labelParsers = new GmfGen!GenParsers; |
| } |
| |
| return GmfGen!GenParsers.all.first; |
| } |