Search in sources :

Example 6 with CvsElement

use of com.intellij.cvsSupport2.cvsBrowser.CvsElement 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) {
        }
    });
}
Also used : CvsHandler(com.intellij.cvsSupport2.cvshandlers.CvsHandler) CommandCvsHandler(com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler) CvsOperationExecutor(com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor) CvsElement(com.intellij.cvsSupport2.cvsBrowser.CvsElement) ModalityContext(com.intellij.cvsSupport2.cvsExecution.ModalityContext) File(java.io.File) CvsOperationExecutorCallback(com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutorCallback) CheckoutWizard(com.intellij.cvsSupport2.ui.experts.checkout.CheckoutWizard)

Example 7 with CvsElement

use of com.intellij.cvsSupport2.cvsBrowser.CvsElement in project intellij-community by JetBrains.

the class CvsCheckoutProvider method collectCheckoutPaths.

private static String[] collectCheckoutPaths(final CvsElement[] mySelectedElements) {
    final String[] checkoutPaths = new String[mySelectedElements.length];
    for (int i = 0; i < mySelectedElements.length; i++) {
        final CvsElement selectedElement = mySelectedElements[i];
        checkoutPaths[i] = selectedElement.getCheckoutPath();
    }
    return checkoutPaths;
}
Also used : CvsElement(com.intellij.cvsSupport2.cvsBrowser.CvsElement)

Aggregations

CvsElement (com.intellij.cvsSupport2.cvsBrowser.CvsElement)7 File (java.io.File)3 CvsFile (com.intellij.cvsSupport2.cvsBrowser.CvsFile)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 Nullable (org.jetbrains.annotations.Nullable)2 CvsOperationExecutor (com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor)1 CvsOperationExecutorCallback (com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutorCallback)1 ModalityContext (com.intellij.cvsSupport2.cvsExecution.ModalityContext)1 CommandCvsHandler (com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler)1 CvsHandler (com.intellij.cvsSupport2.cvshandlers.CvsHandler)1 ImportDetails (com.intellij.cvsSupport2.cvsoperations.cvsImport.ImportDetails)1 CheckoutWizard (com.intellij.cvsSupport2.ui.experts.checkout.CheckoutWizard)1 CvsModule (com.intellij.openapi.cvsIntegration.CvsModule)1 CvsRepository (com.intellij.openapi.cvsIntegration.CvsRepository)1 VcsVirtualFile (com.intellij.openapi.vcs.vfs.VcsVirtualFile)1 HashSet (com.intellij.util.containers.HashSet)1 ArrayList (java.util.ArrayList)1