protected EditorCell getCellInBothWays(final EditorComponent editor) { return new ModelAccessHelper(editor.getRepository()) .runReadAction( () -> { EditorCell editorCell = getCell(editor); if (editorCell != null) { return editorCell; } return getCellForParentNodeInMainEditor(editor); }); }
@Override public EditorCell getCellForParentNodeInMainEditor(final EditorComponent editor) { return new ModelAccessHelper(editor.getRepository()) .runReadAction( () -> { if (getNode() == null) { return null; } if (editor instanceof InspectorEditorComponent) { return null; } SNode parent = getNode().getParent(); while (parent != null) { EditorCell result = editor.getBigValidCellForNode(parent); if (result != null) { return result; } parent = parent.getParent(); } return null; }); }