Example #1
0
 public static boolean isCellOrSelectionReadOnlyInEditor(
     jetbrains.mps.openapi.editor.EditorComponent editorComponent,
     @Nullable jetbrains.mps.openapi.editor.cells.EditorCell cell) {
   if (editorComponent.isReadOnly()) {
     return true;
   }
   if (cell == null) {
     return isSelectionReadOnlyInEditor(editorComponent);
   }
   return isCellReadOnly(cell);
 }
Example #2
0
 public static boolean isCellsReadOnlyInEditor(
     jetbrains.mps.openapi.editor.EditorComponent editorComponent,
     Iterable<jetbrains.mps.openapi.editor.cells.EditorCell> cells) {
   if (editorComponent.isReadOnly()) {
     return true;
   }
   for (jetbrains.mps.openapi.editor.cells.EditorCell cell : cells) {
     if (isCellOrSelectionReadOnlyInEditor(editorComponent, cell)) {
       return true;
     }
   }
   return false;
 }