use of com.intellij.openapi.vcs.EditFileProvider in project intellij-community by JetBrains.
the class VcsHandleType method processFiles.
public void processFiles(final Collection<VirtualFile> files, @Nullable final String changelist) {
try {
EditFileProvider provider = myVcs.getEditFileProvider();
assert provider != null;
provider.editFiles(VfsUtil.toVirtualFileArray(files));
} catch (VcsException e) {
Messages.showErrorDialog(VcsBundle.message("message.text.cannot.edit.file", e.getLocalizedMessage()), VcsBundle.message("message.title.edit.files"));
}
ApplicationManager.getApplication().runWriteAction(new Runnable() {
public void run() {
for (final VirtualFile file : files) {
file.refresh(false, false);
}
}
});
if (changelist != null) {
myChangeListManager.invokeAfterUpdate(new Runnable() {
@Override
public void run() {
LocalChangeList list = myChangeListManager.findChangeList(changelist);
if (list != null) {
List<Change> changes = ContainerUtil.mapNotNull(files, myChangeFunction);
myChangeListManager.moveChangesTo(list, changes.toArray(new Change[changes.size()]));
}
}
}, InvokeAfterUpdateMode.SILENT, "", ModalityState.NON_MODAL);
}
}
Aggregations