Search in sources :

Example 1 with ReplaceFileConfirmationDialog

use of com.intellij.openapi.vcs.ui.ReplaceFileConfirmationDialog in project intellij-community by JetBrains.

the class GetVersionAction method doGet.

public static void doGet(@NotNull Project project, @NotNull VcsFileRevision revision, @NotNull FilePath filePath) {
    VirtualFile virtualFile = filePath.getVirtualFile();
    if (virtualFile != null) {
        ReplaceFileConfirmationDialog confirmationDialog = new ReplaceFileConfirmationDialog(project, VcsBundle.message("acton.name.get.revision"));
        if (!confirmationDialog.confirmFor(new VirtualFile[] { virtualFile })) {
            return;
        }
    }
    new MyWriteVersionTask(project, filePath, revision).queue();
    refreshFile(filePath, revision, project);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) ReplaceFileConfirmationDialog(com.intellij.openapi.vcs.ui.ReplaceFileConfirmationDialog)

Example 2 with ReplaceFileConfirmationDialog

use of com.intellij.openapi.vcs.ui.ReplaceFileConfirmationDialog in project intellij-community by JetBrains.

the class CheckoutFileAction method getCvsHandler.

protected CvsHandler getCvsHandler(CvsContext context) {
    if (myModifiedFiles != null) {
        if (!myModifiedFiles.isEmpty()) {
            if (!new ReplaceFileConfirmationDialog(context.getProject(), CvsBundle.getCheckoutOperationName()).requestConfirmation(myModifiedFiles)) {
                return CvsHandler.NULL;
            }
        }
    }
    myModifiedFiles = null;
    Project project = context.getProject();
    FilePath[] filesArray = context.getSelectedFilePaths();
    List<FilePath> files = Arrays.asList(filesArray);
    if (CvsVcs2.getInstance(project).getCheckoutOptions().getValue() || OptionsDialog.shiftIsPressed(context.getModifiers())) {
        CheckoutFileDialog checkoutFileDialog = new CheckoutFileDialog(project, files);
        if (!checkoutFileDialog.showAndGet()) {
            return CvsHandler.NULL;
        }
    }
    return CommandCvsHandler.createCheckoutFileHandler(filesArray, CvsConfiguration.getInstance(project), VcsConfiguration.getInstance(project).getCheckoutOption());
}
Also used : ReplaceFileConfirmationDialog(com.intellij.openapi.vcs.ui.ReplaceFileConfirmationDialog) FilePath(com.intellij.openapi.vcs.FilePath) Project(com.intellij.openapi.project.Project) CheckoutFileDialog(com.intellij.cvsSupport2.cvsoperations.cvsCheckOut.ui.CheckoutFileDialog)

Aggregations

ReplaceFileConfirmationDialog (com.intellij.openapi.vcs.ui.ReplaceFileConfirmationDialog)2 CheckoutFileDialog (com.intellij.cvsSupport2.cvsoperations.cvsCheckOut.ui.CheckoutFileDialog)1 Project (com.intellij.openapi.project.Project)1 FilePath (com.intellij.openapi.vcs.FilePath)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1