XLineBreakpoint<JavaCollectionBreakpointProperties> (final Project project, JComponent parentComponent) { final Ref<XLineBreakpoint<JavaCollectionBreakpointProperties>> result = Ref.create(null); AddFieldBreakpointDialog dialog = new AddFieldBreakpointDialog(project) { @Override protected boolean validateData() { final String className = getClassName(); if (className.isEmpty()) { return false; } final String fieldName = getFieldName(); if (fieldName.isEmpty()) { return false; } PsiClass psiClass = JavaPsiFacade.getInstance(project).findClass(className, GlobalSearchScope.allScope(project)); if (psiClass != null) { final PsiFile psiFile = psiClass.getContainingFile(); Document document = psiFile.getViewProvider().getDocument(); if (document != null) { PsiField field = psiClass.findFieldByName(fieldName, false); if (field != null) { final int line = document.getLineNumber(field.getTextOffset()); WriteAction.run(() -> { XLineBreakpoint<JavaCollectionBreakpointProperties> fieldBreakpoint = XDebuggerManager.getInstance(project).getBreakpointManager() .addLineBreakpoint(JavaCollectionBreakpointType.this, psiFile.getVirtualFile().getUrl(), line, new JavaCollectionBreakpointProperties(fieldName, className)); result.set(fieldBreakpoint); }); return true; } } } return false; } }; dialog.show(); return result.get(); }