void () { String idString = Messages.showInputDialog(myProject, JavaDebuggerBundle.message("add.instance.filter.dialog.prompt"), JavaDebuggerBundle.message("add.instance.filter.dialog.title"), Messages.getQuestionIcon(), null, new InputValidatorEx() { @Nullable @Override public String getErrorText(String inputString) { try { Long.parseLong(inputString); return null; } catch (NumberFormatException e) { return JavaDebuggerBundle .message("add.instance.filter.dialog.error.numeric.value.expected"); } } @Override public boolean canClose(String inputString) { return getErrorText(inputString) == null; } }); if (idString != null) { ClassFilter filter = createFilter(idString); myTableModel.addRow(filter); int row = myTableModel.getRowCount() - 1; myTable.getSelectionModel().setSelectionInterval(row, row); myTable.scrollRectToVisible(myTable.getCellRect(row, 0, true)); IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(myTable, true)); } }