boolean (final VirtualFile virtualFile, final Project project) { final boolean[] success = new boolean[1]; CommandProcessor.getInstance().executeCommand(project, () -> { Runnable action = () -> { try { ReadOnlyAttributeUtil.setReadOnlyAttribute(virtualFile, false); success[0] = true; } catch (IOException e1) { Messages.showMessageDialog(project, e1.getMessage(), CommonBundle.getErrorTitle(), Messages.getErrorIcon()); } }; ApplicationManager.getApplication().runWriteAction(action); }, "", null); return success[0]; }