JComponent () { final JPanel panel = new JPanel(new BorderLayout()); String asEnumColumnTitle = RefactorJBundle.message("extract.class.as.enum.column.title"); final MemberSelectionTable table = new MemberSelectionTable(memberInfo, asEnumColumnTitle) { @Nullable @Override protected Object getAbstractColumnValue(MemberInfo memberInfo) { if (isExtractAsEnum()) { final PsiMember member = memberInfo.getMember(); if (isConstantField(member)) { return Boolean.valueOf(enumConstants.contains(memberInfo)); } } return null; } @Override protected boolean isAbstractColumnEditable(int rowIndex) { final MemberInfo info = memberInfo.get(rowIndex); if (info.isChecked()) { final PsiMember member = info.getMember(); if (isConstantField(member)) { if (enumConstants.isEmpty()) return true; final MemberInfo currentEnumConstant = enumConstants.get(0); if (((PsiField)currentEnumConstant.getMember()).getType().equals(((PsiField)member).getType())) return true; } } return false; } }; table.setMemberInfoModel(new DelegatingMemberInfoModel<>(table.getMemberInfoModel()) { @Override public int checkForProblems(@NotNull final MemberInfo member) { final PsiMember cause = getCause(member); if (member.isChecked() && cause != null) return ERROR; if (!member.isChecked() && cause != null) return WARNING; return OK; } @Override public String getTooltipText(final MemberInfo member) { final PsiMember cause = getCause(member); if (cause != null) { final String presentation = SymbolPresentationUtil.getSymbolPresentableText(cause); if (member.isChecked()) { return RefactorJBundle.message("extract.class.depends.on.0.from.1.tooltip", presentation, sourceClass.getName()); } else { final String className = getClassName(); return RefactorJBundle.message("extract.class.depends.on.0.from.new.class", presentation, className); } } return null; } private PsiMember getCause(final MemberInfo member) { PsiMember cause = myMember2CauseMap.get(member); if (cause != null) return cause; final BackpointerUsageVisitor visitor; if (member.isChecked()) { visitor = new BackpointerUsageVisitor(getFieldsToExtract(), getClassesToExtract(), getMethodsToExtract(), sourceClass); } else { visitor = new BackpointerUsageVisitor(getMembersToExtract(false, PsiField.class), getMembersToExtract(false, PsiClass.class), getMembersToExtract(false, PsiMethod.class), sourceClass, false); } member.getMember().accept(visitor); cause = visitor.getCause(); myMember2CauseMap.put(member, cause); return cause; } }); final MemberSelectionPanelBase<PsiMember, MemberInfo, MemberSelectionTable> memberSelectionPanel = new MemberSelectionPanelBase<>(RefactorJBundle.message("members.to.extract.label"), table); panel.add(memberSelectionPanel, BorderLayout.CENTER); table.addMemberInfoChangeListener(this); extractAsEnum.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (extractAsEnum.isSelected()) { preselectOneTypeEnumConstants(); } table.repaint(); } }); createInner.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final boolean isCreateInner = createInner.isSelected(); packageTextField.setEnabled(!isCreateInner); myDestinationFolderComboBox.setEnabled(!isCreateInner); } }); myGenerateAccessorsCb = new JCheckBox(JavaRefactoringBundle.message("extract.delegate.generate.accessors.checkbox")); panel.add(myGenerateAccessorsCb, BorderLayout.SOUTH); panel.add(myVisibilityPanel, BorderLayout.EAST); return panel; }