void (AnActionButton button) { stopEditing(); TodoPattern pattern = new TodoPattern(TodoAttributesUtil.createDefault()); PatternDialog dialog = new PatternDialog(myPanel, pattern, -1, myPatterns); if (!dialog.showAndGet()) { return; } myPatterns.add(pattern); int index = myPatterns.size() - 1; myPatternsModel.fireTableRowsInserted(index, index); myPatternsTable.getSelectionModel().setSelectionInterval(index, index); myPatternsTable.scrollRectToVisible(myPatternsTable.getCellRect(index, 0, true)); }