JComponent () { final JPanel panel = new JPanel(new BorderLayout()); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 5, 0)); final MemberSelectionPanel selectionPanel = new MemberSelectionPanel( JavaRareRefactoringsBundle.message("remove.middleman.methods.to.inline.title"), delegateMethods, JavaRareRefactoringsBundle.message("remove.middleman.column.header")); final MemberSelectionTable table = selectionPanel.getTable(); table.setMemberInfoModel(new DelegatingMemberInfoModel<>(table.getMemberInfoModel()) { @Override public int checkForProblems(@NotNull final MemberInfo member) { return hasSuperMethods(member) ? ERROR : OK; } @Override public String getTooltipText(final MemberInfo member) { if (hasSuperMethods(member)) return JavaRareRefactoringsBundle.message("remove.middleman.tooltip.warning"); return super.getTooltipText(member); } private static boolean hasSuperMethods(final MemberInfo member) { if (member.isChecked() && member.isToAbstract()) { final PsiMember psiMember = member.getMember(); if (psiMember instanceof PsiMethod && ((PsiMethod)psiMember).findDeepestSuperMethods().length > 0) { return true; } } return false; } }); panel.add(selectionPanel, BorderLayout.CENTER); return panel; }