void () { stopEditing(); int selectedIndex = myPatternsTable.getSelectedRow(); if (selectedIndex < 0 || selectedIndex >= myPatternsModel.getRowCount()) { return; } TodoPattern sourcePattern = myPatterns.get(selectedIndex); TodoPattern pattern = sourcePattern.clone(); PatternDialog dialog = new PatternDialog(myPanel, pattern, selectedIndex, myPatterns); dialog.setTitle(IdeBundle.message("title.edit.todo.pattern")); if (!dialog.showAndGet()) { return; } myPatterns.set(selectedIndex, pattern); myPatternsModel.fireTableRowsUpdated(selectedIndex, selectedIndex); myPatternsTable.getSelectionModel().setSelectionInterval(selectedIndex, selectedIndex); // Update model with patterns for (int i = 0; i < myFilters.size(); i++) { TodoFilter filter = myFilters.get(i); if (filter.contains(sourcePattern)) { filter.removeTodoPattern(sourcePattern); filter.addTodoPattern(pattern); myFiltersModel.fireTableRowsUpdated(i, i); } } }