void (@NotNull ArrangementMatchingRuleEditor editor, int rowToEdit) { if (myEditorRow == rowToEdit + 1) { return; } if (myEditorRow >= 0) { if (myEditorRow < rowToEdit) { rowToEdit--; } hideEditor(); } myEditorRow = rowToEdit + 1; ArrangementEditorComponent editorComponent = new ArrangementEditorComponent(this, myEditorRow, editor); editorComponent.applyAvailableWidth(getWidth()); editor.reset(rowToEdit); mySkipSelectionChange = true; try { getModel().insertRow(myEditorRow, new Object[]{editorComponent}); } finally { mySkipSelectionChange = false; } Rectangle bounds = getRowsBounds(rowToEdit, myEditorRow); myRepresentationCallback.ensureVisible(bounds); // We can't just subscribe to the model modification events and update cached renderers automatically because we need to use // the cached renderer on atom condition removal (via click on 'close' button). The model is modified immediately then but // corresponding cached renderer is used for animation. editorComponent.expand(); repaintRows(rowToEdit, getModel().getRowCount() - 1, false); editCellAt(myEditorRow, 0); }