use of com.intellij.cvsSupport2.cvsExecution.ModalityContext in project intellij-community by JetBrains.
the class UpdateHandler method onOperationFinished.
@Override
protected void onOperationFinished(ModalityContext modalityContext) {
if (myUpdateSettings.getPruneEmptyDirectories()) {
final IOFilesBasedDirectoryPruner pruner = new IOFilesBasedDirectoryPruner(ProgressManager.getInstance().getProgressIndicator());
for (FilePath file : myFiles) {
pruner.addFile(file.getIOFile());
}
pruner.execute();
}
if (!myCorruptedFiles.isEmpty()) {
final int showOptions = CvsConfiguration.getInstance(myProject).SHOW_CORRUPTED_PROJECT_FILES;
if (showOptions == Options.PERFORM_ACTION_AUTOMATICALLY) {
for (final MergedWithConflictProjectOrModuleFile myCorruptedFile : myCorruptedFiles) {
myCorruptedFile.setShouldBeCheckedOut();
}
} else if (showOptions == Options.SHOW_DIALOG) {
modalityContext.runInDispatchThread(() -> new CorruptedProjectFilesDialog(myProject, myCorruptedFiles).show(), myProject);
}
final VcsKey vcsKey = CvsVcs2.getKey();
for (final MergedWithConflictProjectOrModuleFile myCorruptedFile : myCorruptedFiles) {
if (myCorruptedFile.shouldBeCheckedOut()) {
addFileToCheckout(myCorruptedFile.getOriginal());
} else {
myUpdatedFiles.getGroupById(FileGroup.MODIFIED_ID).add(myCorruptedFile.getOriginal().getPath(), vcsKey, null);
}
}
}
}
use of com.intellij.cvsSupport2.cvsExecution.ModalityContext in project intellij-community by JetBrains.
the class CvsCheckoutProvider method doCheckout.
public void doCheckout(@NotNull final Project project, final CheckoutProvider.Listener listener) {
final CheckoutWizard checkoutWizard = new CheckoutWizard(project);
if (!checkoutWizard.showAndGet()) {
return;
}
final boolean useAlternateCheckoutPath = checkoutWizard.useAlternativeCheckoutLocation();
final File checkoutDirectory = checkoutWizard.getCheckoutDirectory();
final CvsElement[] selectedElements = checkoutWizard.getSelectedElements();
final CvsHandler checkoutHandler = CommandCvsHandler.createCheckoutHandler(checkoutWizard.getConfigurationWithDateOrRevisionSettings(), collectCheckoutPaths(selectedElements), checkoutDirectory, useAlternateCheckoutPath, CvsApplicationLevelConfiguration.getInstance().MAKE_CHECKED_OUT_FILES_READONLY, VcsConfiguration.getInstance(project).getCheckoutOption());
final CvsOperationExecutor executor = new CvsOperationExecutor(null);
executor.performActionSync(checkoutHandler, new CvsOperationExecutorCallback() {
public void executionFinished(boolean successfully) {
if (!executor.hasNoErrors()) {
Messages.showErrorDialog(CvsBundle.message("message.error.checkout", executor.getResult().composeError().getLocalizedMessage()), CvsBundle.message("operation.name.check.out.project"));
}
refreshAfterCheckout(listener, selectedElements, checkoutDirectory, useAlternateCheckoutPath);
}
public void executionFinishedSuccessfully() {
}
public void executeInProgressAfterAction(ModalityContext modaityContext) {
}
});
}
Aggregations