package jetbrains.mps.lang.editor.editor; /*Generated by MPS */ import jetbrains.mps.editor.runtime.cells.KeyMapImpl; import jetbrains.mps.openapi.editor.cells.KeyMapAction; import jetbrains.mps.editor.runtime.cells.KeyMapActionImpl; import jetbrains.mps.openapi.editor.EditorContext; import jetbrains.mps.openapi.editor.cells.EditorCell; import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import java.util.List; import jetbrains.mps.smodel.action.SNodeFactoryOperations; public class ConceptEditor_DefaultContextHintLabel extends KeyMapImpl { public ConceptEditor_DefaultContextHintLabel() { this.setApplicableToEveryModel(false); KeyMapAction action; action = new ConceptEditor_DefaultContextHintLabel.ConceptEditor_DefaultContextHintLabel_Action0(); this.putAction("any", "letter or digit", action); } public static class ConceptEditor_DefaultContextHintLabel_Action0 extends KeyMapActionImpl { public ConceptEditor_DefaultContextHintLabel_Action0() { this.setShownInPopupMenu(false); } public boolean isMenuAlwaysShown() { return false; } public boolean canExecute(final EditorContext editorContext) { EditorCell contextCell = editorContext.getContextCell(); if ((contextCell == null)) { return false; } SNode contextNode = contextCell.getSNode(); if (contextNode == null) { return false; } if (!(SNodeOperations.isInstanceOf(contextNode, MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9845363abL, "jetbrains.mps.lang.editor.structure.ConceptEditorDeclaration")))) { return false; } return true; } public void execute(final EditorContext editorContext) { EditorCell contextCell = editorContext.getContextCell(); this.execute_internal(editorContext, contextCell.getSNode(), this.getSelectedNodes(editorContext)); } private void execute_internal(final EditorContext editorContext, final SNode node, final List<SNode> selectedNodes) { SNodeFactoryOperations.addNewChild(node, MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9845363abL, 0x240ba2de0c6c0b6eL, "contextHints"), SNodeFactoryOperations.asInstanceConcept(MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x5eadaecad41188dcL, "jetbrains.mps.lang.editor.structure.ConceptEditorHintDeclarationReference"))); } public String getKeyStroke() { return " letter or digit"; } } }