package jetbrains.mps.lang.behavior.editor;

/*Generated by MPS */

import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuComponent;
import jetbrains.mps.nodeEditor.cellMenu.SubstituteInfoPartExt;
import jetbrains.mps.lang.editor.generator.internal.AbstractCellMenuPart_Generic_Group;
import java.util.List;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.openapi.editor.EditorContext;
import jetbrains.mps.lang.structure.behavior.AbstractConceptDeclaration__BehaviorDescriptor;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import org.jetbrains.mps.openapi.model.SModel;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations;
import jetbrains.mps.openapi.editor.menus.EditorMenuDescriptor;
import jetbrains.mps.lang.editor.menus.EditorMenuDescriptorBase;
import jetbrains.mps.smodel.SNodePointer;
import org.jetbrains.mps.openapi.language.SConcept;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import org.jetbrains.mps.openapi.language.SReferenceLink;
import org.jetbrains.mps.openapi.language.SContainmentLink;
import org.jetbrains.mps.openapi.language.SProperty;

public class ConceptMethodDeclaration_Menu extends AbstractCellMenuComponent {
  public ConceptMethodDeclaration_Menu() {
    super(new SubstituteInfoPartExt[]{new ConceptMethodDeclaration_generic_cellMenu_v7l746_a0()});
  }
  public static class ConceptMethodDeclaration_generic_cellMenu_v7l746_a0 extends AbstractCellMenuPart_Generic_Group {
    public ConceptMethodDeclaration_generic_cellMenu_v7l746_a0() {
    }

    protected List<?> createParameterObjects(SNode node, EditorContext editorContext) {
      return (List<SNode>) AbstractConceptDeclaration__BehaviorDescriptor.getVirtualConceptMethods_idhEwILHM.invoke(SLinkOperations.getTarget(SNodeOperations.getNodeAncestor(node, CONCEPTS.ConceptBehavior$2, false, false), LINKS.concept$u6dL));

    }
    protected void handleAction(Object parameterObject, SNode node, SModel model, EditorContext editorContext) {
      this.handleAction_impl((SNode) parameterObject, node, model, editorContext);
    }
    private void handleAction_impl(SNode parameterObject, SNode node, SModel model, EditorContext editorContext) {
      SLinkOperations.setTarget(node, LINKS.overriddenMethod$quKH, parameterObject);
      SLinkOperations.setTarget(node, LINKS.visibility$Yyua, SNodeOperations.copyNode(SLinkOperations.getTarget(parameterObject, LINKS.visibility$Yyua)));
      SPropertyOperations.set(node, PROPS.isStatic$JhJe, SPropertyOperations.getBoolean(parameterObject, PROPS.isStatic$JhJe));
    }
    protected boolean isReferentPresentation() {
      return false;
    }

    @Override
    protected EditorMenuDescriptor getEditorMenuDescriptor(Object parameterObject) {
      return new EditorMenuDescriptorBase("generic group with parameter: " + ((parameterObject == null ? "null" : parameterObject.toString())), new SNodePointer("r:dc79d042-ba38-4e91-9392-42f38106ae44(jetbrains.mps.lang.behavior.editor)", "1225202142300"));
    }
  }

  private static final class CONCEPTS {
    /*package*/ static final SConcept ConceptBehavior$2 = MetaAdapterFactory.getConcept(0xaf65afd8f0dd4942L, 0x87d963a55f2a9db1L, 0x11d43447b1aL, "jetbrains.mps.lang.behavior.structure.ConceptBehavior");
  }

  private static final class LINKS {
    /*package*/ static final SReferenceLink concept$u6dL = MetaAdapterFactory.getReferenceLink(0xaf65afd8f0dd4942L, 0x87d963a55f2a9db1L, 0x11d43447b1aL, 0x11d43447b1fL, "concept");
    /*package*/ static final SReferenceLink overriddenMethod$quKH = MetaAdapterFactory.getReferenceLink(0xaf65afd8f0dd4942L, 0x87d963a55f2a9db1L, 0x11d4348057eL, 0x11d4348057fL, "overriddenMethod");
    /*package*/ static final SContainmentLink visibility$Yyua = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x112670d273fL, 0x112670d886aL, "visibility");
  }

  private static final class PROPS {
    /*package*/ static final SProperty isStatic$JhJe = MetaAdapterFactory.getProperty(0xaf65afd8f0dd4942L, 0x87d963a55f2a9db1L, 0x11d4348057eL, 0x51613f7fe129b24dL, "isStatic");
  }
}
