@Override
    public void apply() throws IOException {
      if (!myContent.isAvailable()) return;

      boolean isReadOnly = !myFile.isWritable();
      ReadOnlyAttributeUtil.setReadOnlyAttribute(myFile, false);

      Document doc = FileDocumentManager.getInstance().getCachedDocument(myFile);
      DocumentUndoProvider.startDocumentUndo(doc);
      try {
        myFile.setBinaryContent(myContent.getBytes());
      }
      finally {
        DocumentUndoProvider.finishDocumentUndo(doc);
      }

      ReadOnlyAttributeUtil.setReadOnlyAttribute(myFile, isReadOnly);
    }
@Override
    public void apply()