package jetbrains.mps.lang.core.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;
import jetbrains.mps.editor.runtime.impl.cellActions.CellAction_Uncomment;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
public class BaseConcept_comment_Actions {
public static void setCellActions(EditorCell editorCell, SNode node, EditorContext context) {
editorCell.setAction(CellActionType.BACKSPACE, new BaseConcept_comment_Actions.BaseConcept_comment_Actions_BACKSPACE(node));
editorCell.setAction(CellActionType.DELETE, new BaseConcept_comment_Actions.BaseConcept_comment_Actions_DELETE(node));
}
public static class BaseConcept_comment_Actions_BACKSPACE extends AbstractCellAction {
/*package*/ SNode myNode;
public BaseConcept_comment_Actions_BACKSPACE(SNode node) {
this.myNode = node;
}
public void execute(EditorContext editorContext) {
this.execute_internal(editorContext, this.myNode);
}
public void execute_internal(EditorContext editorContext, SNode node) {
new CellAction_Uncomment(SNodeOperations.getParent(node)).execute(editorContext);
}
@Override
public boolean canExecute(EditorContext editorContext) {
return this.canExecute_internal(editorContext, this.myNode);
}
public boolean canExecute_internal(EditorContext editorContext, SNode node) {
return SNodeOperations.isInstanceOf(SNodeOperations.getParent(node), MetaAdapterFactory.getConcept(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x3dcc194340c24debL, "jetbrains.mps.lang.core.structure.BaseCommentAttribute"));
}
}
public static class BaseConcept_comment_Actions_DELETE extends AbstractCellAction {
/*package*/ SNode myNode;
public BaseConcept_comment_Actions_DELETE(SNode node) {
this.myNode = node;
}
public void execute(EditorContext editorContext) {
this.execute_internal(editorContext, this.myNode);
}
public void execute_internal(EditorContext editorContext, SNode node) {
new CellAction_Uncomment(SNodeOperations.getParent(node)).execute(editorContext);
}
@Override
public boolean canExecute(EditorContext editorContext) {
return this.canExecute_internal(editorContext, this.myNode);
}
public boolean canExecute_internal(EditorContext editorContext, SNode node) {
return SNodeOperations.isInstanceOf(SNodeOperations.getParent(node), MetaAdapterFactory.getConcept(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x3dcc194340c24debL, "jetbrains.mps.lang.core.structure.BaseCommentAttribute"));
}
}
}