use of org.jetbrains.idea.svn.dialogs.SetPropertyDialog in project intellij-community by JetBrains.
the class SetPropertyAction method batchPerform.
@Override
protected void batchPerform(@NotNull SvnVcs vcs, @NotNull VirtualFile[] files, @NotNull DataContext context) throws VcsException {
File[] ioFiles = toIoFiles(files);
SetPropertyDialog dialog = new SetPropertyDialog(vcs.getProject(), ioFiles, null, true);
if (dialog.showAndGet()) {
String name = dialog.getPropertyName();
String value = dialog.getPropertyValue();
boolean recursive = dialog.isRecursive();
for (File ioFile : ioFiles) {
PropertyClient client = vcs.getFactory(ioFile).createPropertyClient();
// TODO: most likely SVNDepth.getInfinityOrEmptyDepth should be used instead of SVNDepth.fromRecursive - to have either "infinity"
// TODO: or "empty" depth, and not "infinity" or "files" depth. But previous logic used SVNDepth.fromRecursive implicitly
client.setProperty(ioFile, name, PropertyValue.create(value), Depth.allOrFiles(recursive), false);
}
for (VirtualFile file : files) {
if (recursive && file.isDirectory()) {
VcsDirtyScopeManager.getInstance(vcs.getProject()).dirDirtyRecursively(file, true);
} else {
VcsDirtyScopeManager.getInstance(vcs.getProject()).fileDirty(file);
}
}
}
}
Aggregations