package jetbrains.mps.lang.test.runtime; /*Generated by MPS */ import javax.swing.JComponent; import jetbrains.mps.openapi.editor.cells.EditorCell; import jetbrains.mps.nodeEditor.EditorComponent; import jetbrains.mps.nodeEditor.EditorCell_WithComponent; public class EditorUtil { public static JComponent getEventTargetComponent(EditorCell currentCell, EditorComponent editorComponent) { while (currentCell != null) { if (currentCell instanceof EditorCell_WithComponent) { return ((EditorCell_WithComponent) currentCell).getComponent(); } currentCell = currentCell.getParent(); } return editorComponent; } }