package jetbrains.mps.baseLanguage.editor; /*Generated by MPS */ import jetbrains.mps.openapi.editor.cells.EditorCell; import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.openapi.editor.EditorContext; import jetbrains.mps.openapi.editor.cells.CellActionType; import jetbrains.mps.editor.runtime.cells.AbstractCellAction; public class HandleInsert { public static void setCellActions(EditorCell editorCell, SNode node, EditorContext context) { editorCell.setAction(CellActionType.INSERT_BEFORE, new HandleInsert.HandleInsert_INSERT_BEFORE(node)); editorCell.setAction(CellActionType.INSERT, new HandleInsert.HandleInsert_INSERT(node)); } public static class HandleInsert_INSERT_BEFORE extends AbstractCellAction { /*package*/ SNode myNode; public HandleInsert_INSERT_BEFORE(SNode node) { this.myNode = node; } public void execute(EditorContext editorContext) { this.execute_internal(editorContext, this.myNode); } public void execute_internal(EditorContext editorContext, SNode node) { SingleLineCommentUtil.divideSingleLineCommentText(node, editorContext); editorContext.selectWRTFocusPolicy(node); } } public static class HandleInsert_INSERT extends AbstractCellAction { /*package*/ SNode myNode; public HandleInsert_INSERT(SNode node) { this.myNode = node; } public void execute(EditorContext editorContext) { this.execute_internal(editorContext, this.myNode); } public void execute_internal(EditorContext editorContext, SNode node) { SingleLineCommentUtil.divideSingleLineCommentText(node, editorContext); editorContext.selectWRTFocusPolicy(node); } } }