EditorCell cell = ...; if (cell.getRole() == EditorCell.Role.LEAF) { // Do something }
EditorCell cell = ...; if (cell.getRole() == EditorCell.Role.COMPOSITE) { // Do something }In this example, we check if the role of the `cell` object is `COMPOSITE`. If it is, we can assume that the cell is a root node in the editor. Package library: `jetbrains.mps.openapi.editor.cells`