package jetbrains.mps.lang.editor.editor;

/*Generated by MPS */

import jetbrains.mps.nodeEditor.menus.substitute.SubstituteMenuBase;
import jetbrains.mps.lang.editor.menus.EditorMenuDescriptorBase;
import jetbrains.mps.smodel.SNodePointer;
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.substitute.ConstraintsFilteringSubstituteMenuPartDecorator;
import jetbrains.mps.lang.editor.menus.substitute.SingleItemSubstituteMenuPart;
import org.jetbrains.annotations.Nullable;
import jetbrains.mps.lang.editor.menus.substitute.DefaultSubstituteMenuItem;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.smodel.action.SNodeFactoryOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import jetbrains.mps.lang.editor.behavior.EditorCellModel__BehaviorDescriptor;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations;
import jetbrains.mps.util.NameUtil;
import jetbrains.mps.lang.editor.menus.ParameterizedMenuPart;
import jetbrains.mps.scope.Scope;
import java.util.Collections;
import jetbrains.mps.internal.collections.runtime.Sequence;
import jetbrains.mps.editor.runtime.completion.CompletionItemInformation;
import jetbrains.mps.smodel.runtime.IconResource;
import jetbrains.mps.lang.editor.menus.ConceptMenusPart;
import java.util.Collection;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import jetbrains.mps.lang.editor.menus.substitute.DefaultSubstituteMenuLookup;
import jetbrains.mps.smodel.language.LanguageRegistry;
import org.jetbrains.mps.openapi.language.SConcept;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import org.jetbrains.mps.openapi.language.SContainmentLink;
import org.jetbrains.mps.openapi.language.SReferenceLink;
import org.jetbrains.mps.openapi.language.SProperty;

public class EditorCellModel_SubstituteMenu extends SubstituteMenuBase {
  public EditorCellModel_SubstituteMenu() {
    super(false, new EditorMenuDescriptorBase("default substitute menu for " + "EditorCellModel", new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587150618")));
  }
  @NotNull
  @Override
  protected List<MenuPart<SubstituteMenuItem, SubstituteMenuContext>> getParts(final SubstituteMenuContext _context) {
    List<MenuPart<SubstituteMenuItem, SubstituteMenuContext>> result = new ArrayList<MenuPart<SubstituteMenuItem, SubstituteMenuContext>>();
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_a(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_b(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_c(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_d(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_e(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_f(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_g(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_h(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_i(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_j(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_k(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_l(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_m(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_n(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_o(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_p(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_q(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_r(), CONCEPTS.CellModel_Constant$4e));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Action_le0q3j_s(), CONCEPTS.EditorCellModel$gN));
    result.add(new ConstraintsFilteringSubstituteMenuPartDecorator(new SMP_Param_le0q3j_t(), CONCEPTS.EditorCellModel$gN));
    result.add(new SMP_Subconcepts_le0q3j_u());
    return result;
  }

  private class SMP_Action_le0q3j_a extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587150620"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        SNode result = SNodeFactoryOperations.createNewNode(CONCEPTS.CellModel_Collection$Og, _context.getCurrentTargetNode());
        SLinkOperations.setTarget(result, LINKS.cellLayout$Of4I, SNodeFactoryOperations.createNewNode(CONCEPTS.CellLayout_Vertical$Fs, null));
        return result;
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return "collection (vertical)";
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "";
      }
    }
  }
  private class SMP_Action_le0q3j_b extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587150730"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        SNode result = SNodeFactoryOperations.createNewNode(_context.getModel(), CONCEPTS.CellModel_Collection$Og, _context.getCurrentTargetNode());
        SLinkOperations.setTarget(result, LINKS.cellLayout$Of4I, SNodeFactoryOperations.createNewNode(CONCEPTS.CellLayout_Vertical$Fs, null));
        if ((SNodeOperations.getNodeAncestor(_context.getParentNode(), CONCEPTS.CellModel_Collection$Og, true, false) != null)) {
          EditorCellModel__BehaviorDescriptor.setSelectable_idi4bRWUe.invoke(result, ((boolean) false));
        }
        return result;
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return "[/";
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "collection (vertical)";
      }
    }
  }
  private class SMP_Action_le0q3j_c extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587150857"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        SNode result = SNodeFactoryOperations.createNewNode(_context.getModel(), CONCEPTS.CellModel_Collection$Og, _context.getCurrentTargetNode());
        SLinkOperations.setTarget(result, LINKS.cellLayout$Of4I, SNodeFactoryOperations.createNewNode(CONCEPTS.CellLayout_Horizontal$43, null));
        return result;
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return "collection (horizontal)";
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "";
      }
    }
  }
  private class SMP_Action_le0q3j_d extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587150968"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        SNode result = SNodeFactoryOperations.createNewNode(_context.getModel(), CONCEPTS.CellModel_Collection$Og, _context.getCurrentTargetNode());
        SLinkOperations.setTarget(result, LINKS.cellLayout$Of4I, SNodeFactoryOperations.createNewNode(CONCEPTS.CellLayout_Horizontal$43, null));
        if ((SNodeOperations.getNodeAncestor(_context.getParentNode(), CONCEPTS.CellModel_Collection$Og, true, false) != null)) {
          EditorCellModel__BehaviorDescriptor.setSelectable_idi4bRWUe.invoke(result, ((boolean) false));
        }
        return result;
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return "[>";
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "collection (horizontal)";
      }
    }
  }
  private class SMP_Action_le0q3j_e extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587151095"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        SNode result = SNodeFactoryOperations.createNewNode(_context.getModel(), CONCEPTS.CellModel_Collection$Og, _context.getCurrentTargetNode());
        SNodeFactoryOperations.setNewChild(result, LINKS.cellLayout$Of4I, CONCEPTS.CellLayout_Indent$Dl);
        return result;
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return "collection (indent)";
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "";
      }
    }
  }
  private class SMP_Action_le0q3j_f extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587151204"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        SNode result = SNodeFactoryOperations.createNewNode(_context.getModel(), CONCEPTS.CellModel_Collection$Og, _context.getCurrentTargetNode());
        SNodeFactoryOperations.setNewChild(result, LINKS.cellLayout$Of4I, CONCEPTS.CellLayout_Indent$Dl);
        if ((SNodeOperations.getNodeAncestor(_context.getParentNode(), CONCEPTS.CellModel_Collection$Og, true, false) != null)) {
          EditorCellModel__BehaviorDescriptor.setSelectable_idi4bRWUe.invoke(result, ((boolean) false));
        }
        return result;
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return "[-";
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "collection (indent)";
      }
    }
  }
  private class SMP_Action_le0q3j_g extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587151329"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        SNode result = SNodeFactoryOperations.createNewNode(_context.getModel(), CONCEPTS.CellModel_RefNodeList$Uo, _context.getCurrentTargetNode());
        SLinkOperations.setTarget(result, LINKS.cellLayout$ZXkU, SNodeFactoryOperations.createNewNode(CONCEPTS.CellLayout_Indent$Dl, null));
        return result;
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return "child node cell list (indent)";
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "";
      }
    }
  }
  private class SMP_Action_le0q3j_h extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587151411"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        SNode result = SNodeFactoryOperations.createNewNode(_context.getModel(), CONCEPTS.CellModel_RefNodeList$Uo, _context.getCurrentTargetNode());
        SLinkOperations.setTarget(result, LINKS.cellLayout$ZXkU, SNodeFactoryOperations.createNewNode(CONCEPTS.CellLayout_Indent$Dl, null));
        return result;
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return "(-";
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "child node cell (indent)";
      }
    }
  }
  private class SMP_Action_le0q3j_i extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587151493"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        SNode result = SNodeFactoryOperations.createNewNode(_context.getModel(), CONCEPTS.CellModel_RefNodeList$Uo, _context.getCurrentTargetNode());
        SLinkOperations.setTarget(result, LINKS.cellLayout$ZXkU, SNodeFactoryOperations.createNewNode(CONCEPTS.CellLayout_Vertical$Fs, null));
        return result;
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return "child node cell list (vertical)";
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "";
      }
    }
  }
  private class SMP_Action_le0q3j_j extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587151604"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        SNode result = SNodeFactoryOperations.createNewNode(_context.getModel(), CONCEPTS.CellModel_RefNodeList$Uo, _context.getCurrentTargetNode());
        SLinkOperations.setTarget(result, LINKS.cellLayout$ZXkU, SNodeFactoryOperations.createNewNode(CONCEPTS.CellLayout_Vertical$Fs, null));
        if (SNodeOperations.isInstanceOf(_context.getParentNode(), CONCEPTS.CellModel_Collection$Og)) {
          EditorCellModel__BehaviorDescriptor.setSelectable_idi4bRWUe.invoke(result, ((boolean) false));
        }
        return result;
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return "(/";
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "child node cell list (vertical)";
      }
    }
  }
  private class SMP_Action_le0q3j_k extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587151727"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        SNode result = SNodeFactoryOperations.createNewNode(_context.getModel(), CONCEPTS.CellModel_RefNodeList$Uo, _context.getCurrentTargetNode());
        SLinkOperations.setTarget(result, LINKS.cellLayout$ZXkU, SNodeFactoryOperations.createNewNode(CONCEPTS.CellLayout_Horizontal$43, null));
        return result;
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return "child node cell list (horizontal)";
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "";
      }
    }
  }
  private class SMP_Action_le0q3j_l extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587151838"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        SNode result = SNodeFactoryOperations.createNewNode(_context.getModel(), CONCEPTS.CellModel_RefNodeList$Uo, _context.getCurrentTargetNode());
        SLinkOperations.setTarget(result, LINKS.cellLayout$ZXkU, SNodeFactoryOperations.createNewNode(CONCEPTS.CellLayout_Horizontal$43, null));
        if (SNodeOperations.isInstanceOf(_context.getParentNode(), CONCEPTS.CellModel_Collection$Og)) {
          EditorCellModel__BehaviorDescriptor.setSelectable_idi4bRWUe.invoke(result, ((boolean) false));
        }
        return result;
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return "(>";
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "child node cell list (horizontal)";
      }
    }
  }
  private class SMP_Action_le0q3j_m extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587151961"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        return SNodeFactoryOperations.createNewNode(_context.getModel(), CONCEPTS.CellModel_RefCell$7g, _context.getCurrentTargetNode());
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return "referent node cell";
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "";
      }
    }
  }
  private class SMP_Action_le0q3j_n extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587152060"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        return SNodeFactoryOperations.createNewNode(_context.getModel(), CONCEPTS.CellModel_RefNode$8, _context.getCurrentTargetNode());
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return "child node cell";
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "";
      }
    }
  }
  private class SMP_Action_le0q3j_o extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587152159"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        return SNodeFactoryOperations.createNewNode(_context.getModel(), CONCEPTS.CellModel_Property$uh, _context.getCurrentTargetNode());
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return "property";
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "";
      }
    }
  }
  private class SMP_Action_le0q3j_p extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587152258"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        SNode result = SNodeFactoryOperations.createNewNode(_context.getModel(), CONCEPTS.CellModel_Alternation$uR, _context.getCurrentTargetNode());
        return result;
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return "if";
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "alternation";
      }
    }
  }
  private class SMP_Action_le0q3j_q extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587152361"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        SNode result = SNodeFactoryOperations.createNewNode(_context.getModel(), CONCEPTS.CellModel_Constant$4e, _context.getCurrentTargetNode());
        SPropertyOperations.set(result, PROPS.text$PIv7, NameUtil.stripQuotes(pattern, "\"", "\""));
        return result;
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return pattern;
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "constant";
      }
      @Override
      public boolean canExecute(@NotNull String pattern) {
        return canExecute_internal(pattern, false);
      }
      @Override
      public boolean canExecuteStrictly(@NotNull String pattern) {
        return canExecute_internal(pattern, true);
      }
      public boolean canExecute_internal(@NotNull String pattern, boolean strictly) {
        return pattern.startsWith("\"");
      }
    }
  }
  private class SMP_Action_le0q3j_r extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.CellModel_Constant$4e, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587152511"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        SNode constant = SNodeFactoryOperations.createNewNode(CONCEPTS.CellModel_Constant$4e, _context.getCurrentTargetNode());
        SPropertyOperations.assign(constant, PROPS.text$PIv7, NameUtil.stripQuotes(pattern, "\"", "\""));
        return constant;
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return pattern;
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "text constant";
      }
      @Override
      public boolean canExecute(@NotNull String pattern) {
        return canExecute_internal(pattern, false);
      }
      @Override
      public boolean canExecuteStrictly(@NotNull String pattern) {
        return canExecute_internal(pattern, true);
      }
      public boolean canExecute_internal(@NotNull String pattern, boolean strictly) {
        return !(pattern.equals("[-") || pattern.equals("[/") || pattern.equals("[>") || pattern.startsWith("\"") || pattern.startsWith("<choose cell model>"));
      }
    }
  }
  private class SMP_Action_le0q3j_s extends SingleItemSubstituteMenuPart {

    @Nullable
    @Override
    protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
      Item item = new Item(_context);
      item.resetTraceInfo();
      return item;
    }
    private class Item extends DefaultSubstituteMenuItem {
      private final SubstituteMenuContext _context;
      public Item(SubstituteMenuContext context) {
        super(CONCEPTS.EditorCellModel$gN, context);
        _context = context;
      }

      /*package*/ void resetTraceInfo() {
        String description = "Substitute item: " + getMatchingText("");
        updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587152685"));
      }

      @Nullable
      @Override
      public SNode createNode(@NotNull String pattern) {
        SNode result = SNodeFactoryOperations.createNewNode(CONCEPTS.CellModel_Error$UK, _context.getCurrentTargetNode());
        SPropertyOperations.set(result, PROPS.text$F9K7, NameUtil.stripQuotes(pattern, "!", "!"));
        return result;
      }

      @Nullable
      @Override
      public String getMatchingText(@NotNull String pattern) {
        return pattern;
      }
      @Nullable
      @Override
      public String getDescriptionText(@NotNull String pattern) {
        return "Error label";
      }
      @Override
      public boolean canExecute(@NotNull String pattern) {
        return canExecute_internal(pattern, false);
      }
      @Override
      public boolean canExecuteStrictly(@NotNull String pattern) {
        return canExecute_internal(pattern, true);
      }
      public boolean canExecute_internal(@NotNull String pattern, boolean strictly) {
        return pattern.startsWith("!");
      }
    }
  }
  private class SMP_Param_le0q3j_t extends ParameterizedMenuPart<SNode, SubstituteMenuItem, SubstituteMenuContext> {
    /*package*/ SMP_Param_le0q3j_t() {
      super(new EditorMenuDescriptorBase("parameterized substitute menu part", new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587152834")));
    }
    @NotNull
    @Override
    protected List<SubstituteMenuItem> createItems(SNode parameter, SubstituteMenuContext context) {
      return new SMP_Action_le0q3j_a91(parameter).createItems(context);
    }
    @Nullable
    @Override
    protected Iterable<? extends SNode> getParameters(SubstituteMenuContext _context) {
      Scope scope = Scope.getScope(_context.getParentNode(), _context.getCurrentTargetNode(), CONCEPTS.EditorComponentDeclaration$WM);
      if (scope == null) {
        return Collections.emptyList();
      }
      return Sequence.fromIterable(scope.getAvailableElements("")).select((it) -> SNodeOperations.as(it, CONCEPTS.EditorComponentDeclaration$WM)).where((it) -> it != null);
    }
    private class SMP_Action_le0q3j_a91 extends SingleItemSubstituteMenuPart {
      private final SNode myParameterObject;
      public SMP_Action_le0q3j_a91(SNode parameterObject) {
        myParameterObject = parameterObject;
      }

      @Nullable
      @Override
      protected SubstituteMenuItem createItem(SubstituteMenuContext _context) {
        Item item = new Item(_context);
        item.resetTraceInfo();
        return item;
      }
      private class Item extends DefaultSubstituteMenuItem {
        private final SubstituteMenuContext _context;
        public Item(SubstituteMenuContext context) {
          super(CONCEPTS.EditorCellModel$gN, context);
          _context = context;
        }

        /*package*/ void resetTraceInfo() {
          String description = "Substitute item: " + getMatchingText("");
          description += ". Parameter object: " + myParameterObject;
          updateTraceInfo(description, new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587152904"));
        }

        @Nullable
        @Override
        public SNode createNode(@NotNull String pattern) {
          SNode component = SNodeFactoryOperations.createNewNode(_context.getModel(), CONCEPTS.CellModel_Component$d$, null);
          SLinkOperations.setTarget(component, LINKS.editorComponent$DNa7, myParameterObject);
          return component;
        }

        @NotNull
        protected CompletionItemInformation createInformation(String pattern) {
          return new CompletionItemInformation(myParameterObject, CONCEPTS.EditorCellModel$gN, getMatchingText(pattern), getDescriptionText(pattern));
        }
        @Nullable
        @Override
        public String getDescriptionText(@NotNull String pattern) {
          return defaultDescriptionTextForParameter(myParameterObject, pattern);
        }
        @Nullable
        @Override
        public IconResource getIcon(@NotNull String pattern) {
          return defaultIconForParameter(myParameterObject, pattern);
        }
        @Nullable
        @Override
        public String getMatchingText(@NotNull String pattern) {
          return "#" + SPropertyOperations.getString(myParameterObject, PROPS.name$MnvL) + "#";
        }
      }
    }

  }
  public class SMP_Subconcepts_le0q3j_u extends ConceptMenusPart<SubstituteMenuItem, SubstituteMenuContext> {
    public SMP_Subconcepts_le0q3j_u() {
      super(new EditorMenuDescriptorBase("include menus for all the direct subconcepts of " + "EditorCellModel", new SNodePointer("r:00000000-0000-4000-0000-011c89590299(jetbrains.mps.lang.editor.editor)", "1741258697587154165")));
    }

    @Override
    protected Collection<SAbstractConcept> getConcepts(final SubstituteMenuContext _context) {
      return getDirectDescendants(_context, CONCEPTS.EditorCellModel$gN);
    }

    @Override
    protected Collection<SubstituteMenuItem> createItemsForConcept(SubstituteMenuContext context, SAbstractConcept concept) {
      return context.createItems(new DefaultSubstituteMenuLookup(LanguageRegistry.getInstance(context.getEditorContext().getRepository()), concept));
    }
  }

  private static final class CONCEPTS {
    /*package*/ static final SConcept EditorCellModel$gN = MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eafb9a39L, "jetbrains.mps.lang.editor.structure.EditorCellModel");
    /*package*/ static final SConcept CellModel_Constant$4e = MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eb01232eL, "jetbrains.mps.lang.editor.structure.CellModel_Constant");
    /*package*/ static final SConcept CellModel_Collection$Og = MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eaff2517L, "jetbrains.mps.lang.editor.structure.CellModel_Collection");
    /*package*/ static final SConcept CellLayout_Vertical$Fs = MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x10192dd4cbeL, "jetbrains.mps.lang.editor.structure.CellLayout_Vertical");
    /*package*/ static final SConcept CellLayout_Horizontal$43 = MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x10192dcf685L, "jetbrains.mps.lang.editor.structure.CellLayout_Horizontal");
    /*package*/ static final SConcept CellLayout_Indent$Dl = MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x120150bb441L, "jetbrains.mps.lang.editor.structure.CellLayout_Indent");
    /*package*/ static final SConcept CellModel_RefNodeList$Uo = MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eb0ad38eL, "jetbrains.mps.lang.editor.structure.CellModel_RefNodeList");
    /*package*/ static final SConcept CellModel_RefCell$7g = MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xfd52a2c922L, "jetbrains.mps.lang.editor.structure.CellModel_RefCell");
    /*package*/ static final SConcept CellModel_RefNode$8 = MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eb05cdc7L, "jetbrains.mps.lang.editor.structure.CellModel_RefNode");
    /*package*/ static final SConcept CellModel_Property$uh = MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eb02612eL, "jetbrains.mps.lang.editor.structure.CellModel_Property");
    /*package*/ static final SConcept CellModel_Alternation$uR = MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xfd766383e4L, "jetbrains.mps.lang.editor.structure.CellModel_Alternation");
    /*package*/ static final SConcept CellModel_Error$UK = MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xfa61615ec3L, "jetbrains.mps.lang.editor.structure.CellModel_Error");
    /*package*/ static final SConcept EditorComponentDeclaration$WM = MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xfb35c2bb47L, "jetbrains.mps.lang.editor.structure.EditorComponentDeclaration");
    /*package*/ static final SConcept CellModel_Component$d$ = MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xfb35c96896L, "jetbrains.mps.lang.editor.structure.CellModel_Component");
  }

  private static final class LINKS {
    /*package*/ static final SContainmentLink cellLayout$Of4I = MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eaff2517L, 0x10192e0d3baL, "cellLayout");
    /*package*/ static final SContainmentLink cellLayout$ZXkU = MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x1098c8cf48aL, 0x1098c8e38e8L, "cellLayout");
    /*package*/ static final SReferenceLink editorComponent$DNa7 = MetaAdapterFactory.getReferenceLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xfb35c96896L, 0xfb35c96897L, "editorComponent");
  }

  private static final class PROPS {
    /*package*/ static final SProperty text$PIv7 = MetaAdapterFactory.getProperty(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eb01232eL, 0xf9eb01232fL, "text");
    /*package*/ static final SProperty text$F9K7 = MetaAdapterFactory.getProperty(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xfa61615ec3L, 0xfa61615ec4L, "text");
    /*package*/ static final SProperty name$MnvL = MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name");
  }
}
