コード例 #1
0
ファイル: ReadOnlyUtil.java プロジェクト: rkrijgsheld/MPS
 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);
 }
コード例 #2
0
ファイル: ReadOnlyUtil.java プロジェクト: rkrijgsheld/MPS
 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;
 }