package jetbrains.mps.lang.editor.menus.substitute.testLanguage.editor; /*Generated by MPS */ import jetbrains.mps.nodeEditor.menus.substitute.SubstituteMenuBase; import org.jetbrains.annotations.NotNull; import java.util.List; import jetbrains.mps.lang.editor.menus.MenuPart; import jetbrains.mps.openapi.editor.menus.substitute.SubstituteMenuItem; import jetbrains.mps.openapi.editor.menus.substitute.SubstituteMenuContext; import java.util.ArrayList; import jetbrains.mps.lang.editor.menus.GroupMenuPart; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import java.util.Arrays; import jetbrains.mps.lang.editor.menus.substitute.ConstraintsFilteringSubstituteMenuPartDecorator; import jetbrains.mps.lang.editor.menus.substitute.SimpleConceptSubstituteMenuPart; import jetbrains.mps.lang.editor.menus.substitute.WrapperSubstituteMenuPart; import jetbrains.mps.editor.runtime.menus.SubstituteItemFacade; import jetbrains.mps.lang.editor.menus.substitute.SubstituteMenuItemWrapper; import org.jetbrains.mps.openapi.model.SNode; import org.jetbrains.annotations.Nullable; import org.jetbrains.mps.openapi.language.SAbstractConcept; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SConceptOperations; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations; import jetbrains.mps.openapi.editor.menus.substitute.SubstituteMenuLookup; import jetbrains.mps.openapi.editor.EditorContext; import jetbrains.mps.lang.editor.menus.substitute.DefaultSubstituteMenuLookup; import jetbrains.mps.smodel.language.LanguageRegistry; public class TestSubstitituteAbstractChildAmbigousPosition_SubstituteMenu extends SubstituteMenuBase { @NotNull @Override protected List<MenuPart<SubstituteMenuItem, SubstituteMenuContext>> getParts(final SubstituteMenuContext _context) { List<MenuPart<SubstituteMenuItem, SubstituteMenuContext>> result = new ArrayList<MenuPart<SubstituteMenuItem, SubstituteMenuContext>>(); result.add(new TestSubstitituteAbstractChildAmbigousPosition_SubstituteMenu.SMP_Group_7ojsku_a()); result.add(new TestSubstitituteAbstractChildAmbigousPosition_SubstituteMenu.SMP_Group_7ojsku_b()); result.add(new TestSubstitituteAbstractChildAmbigousPosition_SubstituteMenu.SMP_Group_7ojsku_c()); result.add(new TestSubstitituteAbstractChildAmbigousPosition_SubstituteMenu.SMP_Group_7ojsku_d()); return result; } public class SMP_Group_7ojsku_a extends GroupMenuPart<SubstituteMenuItem, SubstituteMenuContext> { @Override protected boolean isApplicable(SubstituteMenuContext _context) { return eq_7ojsku_a0a0a1(_context.getLink(), MetaAdapterFactory.getContainmentLink(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7ce1116e3a6fb0bdL, 0x7f53d2199235476fL, "ambigousSameConcepts")); } @Override protected List<MenuPart<SubstituteMenuItem, SubstituteMenuContext>> getParts() { return Arrays.<MenuPart<SubstituteMenuItem, SubstituteMenuContext>>asList(new ConstraintsFilteringSubstituteMenuPartDecorator(new SimpleConceptSubstituteMenuPart(MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d21992378bccL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteChildAmbigousPosition1")), MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d21992378bccL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteChildAmbigousPosition1")), new ConstraintsFilteringSubstituteMenuPartDecorator(new SimpleConceptSubstituteMenuPart(MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d21992378bccL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteChildAmbigousPosition1")), MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d21992378bccL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteChildAmbigousPosition1"))); } } public class SMP_Group_7ojsku_b extends GroupMenuPart<SubstituteMenuItem, SubstituteMenuContext> { @Override protected boolean isApplicable(SubstituteMenuContext _context) { return eq_7ojsku_a0a0a2(_context.getLink(), MetaAdapterFactory.getContainmentLink(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7ce1116e3a6fb0bdL, 0x7f53d21992386290L, "ambigousDifferentConcepts")); } @Override protected List<MenuPart<SubstituteMenuItem, SubstituteMenuContext>> getParts() { return Arrays.<MenuPart<SubstituteMenuItem, SubstituteMenuContext>>asList(new ConstraintsFilteringSubstituteMenuPartDecorator(new SimpleConceptSubstituteMenuPart(MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d21992378bccL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteChildAmbigousPosition1")), MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d21992378bccL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteChildAmbigousPosition1")), new ConstraintsFilteringSubstituteMenuPartDecorator(new SimpleConceptSubstituteMenuPart(MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d21992378f83L, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteChildAmbigousPosition2")), MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d21992378f83L, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteChildAmbigousPosition2"))); } } public class SMP_Group_7ojsku_c extends GroupMenuPart<SubstituteMenuItem, SubstituteMenuContext> { @Override protected boolean isApplicable(SubstituteMenuContext _context) { return eq_7ojsku_a0a0a3(_context.getLink(), MetaAdapterFactory.getContainmentLink(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7ce1116e3a6fb0bdL, 0x7f53d219923643dcL, "ambigousWrapSameConcepts")); } @Override protected List<MenuPart<SubstituteMenuItem, SubstituteMenuContext>> getParts() { return Arrays.<MenuPart<SubstituteMenuItem, SubstituteMenuContext>>asList(new ConstraintsFilteringSubstituteMenuPartDecorator(new TestSubstitituteAbstractChildAmbigousPosition_SubstituteMenu.SMP_Group_7ojsku_c.SMP_Wrap_7ojsku_a2(), MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d2199235476bL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteAbstractChildAmbigousPosition")), new ConstraintsFilteringSubstituteMenuPartDecorator(new TestSubstitituteAbstractChildAmbigousPosition_SubstituteMenu.SMP_Group_7ojsku_c.SMP_Wrap_7ojsku_b2(), MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d2199235476bL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteAbstractChildAmbigousPosition"))); } private class SMP_Wrap_7ojsku_a2 extends WrapperSubstituteMenuPart { @NotNull @Override protected SubstituteMenuItem wrapItem(final SubstituteMenuItem item, final SubstituteMenuContext _context) { final SubstituteItemFacade wrappedItem = new SubstituteItemFacade(item); return new SubstituteMenuItemWrapper(item) { private SNode myCreatedNode; @Nullable @Override public SAbstractConcept getOutputConcept() { return MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d2199235476bL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteAbstractChildAmbigousPosition"); } @Nullable @Override public SNode createNode(@NotNull String pattern) { SNode nodeToWrap = super.createNode(pattern); myCreatedNode = nodeToWrap; SNode node = SConceptOperations.createNewNode(MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d21992378bccL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteChildAmbigousPosition1")); SLinkOperations.setTarget(node, MetaAdapterFactory.getContainmentLink(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d2199235476bL, 0x7f53d21992362f25L, "subchild"), nodeToWrap); return node; } @Override public void select(@NotNull SNode createdNode, @NotNull String pattern) { super.select(myCreatedNode, pattern); } }; } @Nullable @Override protected SubstituteMenuLookup getLookup(SubstituteMenuContext _context) { final EditorContext editorContext = _context.getEditorContext(); return new DefaultSubstituteMenuLookup(LanguageRegistry.getInstance(editorContext.getRepository()), MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d21992386b18L, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteSubChildAmbigousPosition1")); } } private class SMP_Wrap_7ojsku_b2 extends WrapperSubstituteMenuPart { @NotNull @Override protected SubstituteMenuItem wrapItem(final SubstituteMenuItem item, final SubstituteMenuContext _context) { final SubstituteItemFacade wrappedItem = new SubstituteItemFacade(item); return new SubstituteMenuItemWrapper(item) { private SNode myCreatedNode; @Nullable @Override public SAbstractConcept getOutputConcept() { return MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d2199235476bL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteAbstractChildAmbigousPosition"); } @Nullable @Override public SNode createNode(@NotNull String pattern) { SNode nodeToWrap = super.createNode(pattern); myCreatedNode = nodeToWrap; SNode node = SConceptOperations.createNewNode(MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d21992378bccL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteChildAmbigousPosition1")); SLinkOperations.setTarget(node, MetaAdapterFactory.getContainmentLink(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d2199235476bL, 0x7f53d21992362f25L, "subchild"), nodeToWrap); return node; } @Override public void select(@NotNull SNode createdNode, @NotNull String pattern) { super.select(myCreatedNode, pattern); } }; } @Nullable @Override protected SubstituteMenuLookup getLookup(SubstituteMenuContext _context) { final EditorContext editorContext = _context.getEditorContext(); return new DefaultSubstituteMenuLookup(LanguageRegistry.getInstance(editorContext.getRepository()), MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d21992386b18L, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteSubChildAmbigousPosition1")); } } } public class SMP_Group_7ojsku_d extends GroupMenuPart<SubstituteMenuItem, SubstituteMenuContext> { @Override protected boolean isApplicable(SubstituteMenuContext _context) { return eq_7ojsku_a0a0a4(_context.getLink(), MetaAdapterFactory.getContainmentLink(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7ce1116e3a6fb0bdL, 0x7f53d219923862afL, "ambigousWrapDifferentConcepts")); } @Override protected List<MenuPart<SubstituteMenuItem, SubstituteMenuContext>> getParts() { return Arrays.<MenuPart<SubstituteMenuItem, SubstituteMenuContext>>asList(new ConstraintsFilteringSubstituteMenuPartDecorator(new TestSubstitituteAbstractChildAmbigousPosition_SubstituteMenu.SMP_Group_7ojsku_d.SMP_Wrap_7ojsku_a3(), MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d2199235476bL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteAbstractChildAmbigousPosition")), new ConstraintsFilteringSubstituteMenuPartDecorator(new TestSubstitituteAbstractChildAmbigousPosition_SubstituteMenu.SMP_Group_7ojsku_d.SMP_Wrap_7ojsku_b3(), MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d2199235476bL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteAbstractChildAmbigousPosition"))); } private class SMP_Wrap_7ojsku_a3 extends WrapperSubstituteMenuPart { @NotNull @Override protected SubstituteMenuItem wrapItem(final SubstituteMenuItem item, final SubstituteMenuContext _context) { final SubstituteItemFacade wrappedItem = new SubstituteItemFacade(item); return new SubstituteMenuItemWrapper(item) { private SNode myCreatedNode; @Nullable @Override public SAbstractConcept getOutputConcept() { return MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d2199235476bL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteAbstractChildAmbigousPosition"); } @Nullable @Override public SNode createNode(@NotNull String pattern) { SNode nodeToWrap = super.createNode(pattern); myCreatedNode = nodeToWrap; SNode node = SConceptOperations.createNewNode(MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d21992378bccL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteChildAmbigousPosition1")); SLinkOperations.setTarget(node, MetaAdapterFactory.getContainmentLink(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d2199235476bL, 0x7f53d21992362f25L, "subchild"), nodeToWrap); return node; } @Override public void select(@NotNull SNode createdNode, @NotNull String pattern) { super.select(myCreatedNode, pattern); } }; } @Nullable @Override protected SubstituteMenuLookup getLookup(SubstituteMenuContext _context) { final EditorContext editorContext = _context.getEditorContext(); return new DefaultSubstituteMenuLookup(LanguageRegistry.getInstance(editorContext.getRepository()), MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d21992386b18L, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteSubChildAmbigousPosition1")); } } private class SMP_Wrap_7ojsku_b3 extends WrapperSubstituteMenuPart { @NotNull @Override protected SubstituteMenuItem wrapItem(final SubstituteMenuItem item, final SubstituteMenuContext _context) { final SubstituteItemFacade wrappedItem = new SubstituteItemFacade(item); return new SubstituteMenuItemWrapper(item) { private SNode myCreatedNode; @Nullable @Override public SAbstractConcept getOutputConcept() { return MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d2199235476bL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteAbstractChildAmbigousPosition"); } @Nullable @Override public SNode createNode(@NotNull String pattern) { SNode nodeToWrap = super.createNode(pattern); myCreatedNode = nodeToWrap; SNode node = SConceptOperations.createNewNode(MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d21992378bccL, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteChildAmbigousPosition1")); SLinkOperations.setTarget(node, MetaAdapterFactory.getContainmentLink(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d2199235476bL, 0x7f53d21992362f25L, "subchild"), nodeToWrap); return node; } @Override public void select(@NotNull SNode createdNode, @NotNull String pattern) { super.select(myCreatedNode, pattern); } }; } @Nullable @Override protected SubstituteMenuLookup getLookup(SubstituteMenuContext _context) { final EditorContext editorContext = _context.getEditorContext(); return new DefaultSubstituteMenuLookup(LanguageRegistry.getInstance(editorContext.getRepository()), MetaAdapterFactory.getConcept(0xcb6d57037c8e46a9L, 0xb993c1373dc0942fL, 0x7f53d21992386b19L, "jetbrains.mps.lang.editor.menus.substitute.testLanguage.structure.TestSubstitituteSubChildAmbigousPosition2")); } } } private static boolean eq_7ojsku_a0a0a1(Object a, Object b) { return (a != null ? a.equals(b) : a == b); } private static boolean eq_7ojsku_a0a0a2(Object a, Object b) { return (a != null ? a.equals(b) : a == b); } private static boolean eq_7ojsku_a0a0a3(Object a, Object b) { return (a != null ? a.equals(b) : a == b); } private static boolean eq_7ojsku_a0a0a4(Object a, Object b) { return (a != null ? a.equals(b) : a == b); } }