void () { if (myTable.isEditing()) { TableCellEditor editor = myTable.getCellEditor(); if (editor != null) { editor.stopCellEditing(); } } String errorString = validateData(); if (errorString != null) { // were errors CommonRefactoringUtil.showErrorMessage(getRefactoringName(), errorString, HelpID.ENCAPSULATE_FIELDS, myProject); return; } if (getCheckedRows().length == 0) { String noTargetMessage = JavaRefactoringBundle.message("encapsulate.fields.no.target"); CommonRefactoringUtil.showErrorMessage(getRefactoringName(), noTargetMessage, HelpID.ENCAPSULATE_FIELDS, myProject); return; } EncapsulateFieldsProcessor processor = ActionUtil.underModalProgress(myProject, CodeInsightBundle.message("progress.title.resolving.reference"), () -> new EncapsulateFieldsProcessor(myProject, this)); invokeRefactoring(processor); JavaRefactoringSettings settings = JavaRefactoringSettings.getInstance(); settings.ENCAPSULATE_FIELDS_USE_ACCESSORS_WHEN_ACCESSIBLE = myCbUseAccessorsWhenAccessible.isSelected(); }