Search in sources :

Example 1 with SetPropertyDialog

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);
            }
        }
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) PropertyClient(org.jetbrains.idea.svn.properties.PropertyClient) SetPropertyDialog(org.jetbrains.idea.svn.dialogs.SetPropertyDialog) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File)

Aggregations

VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 File (java.io.File)1 SetPropertyDialog (org.jetbrains.idea.svn.dialogs.SetPropertyDialog)1 PropertyClient (org.jetbrains.idea.svn.properties.PropertyClient)1