Search in sources :

Example 1 with CheckoutWizard

use of com.intellij.cvsSupport2.ui.experts.checkout.CheckoutWizard in project intellij-community by JetBrains.

the class CheckoutAction method getCvsHandler.

protected CvsHandler getCvsHandler(CvsContext context) {
    final Project project = context.getProject();
    CheckoutWizard checkoutWizard = new CheckoutWizard(project);
    if (!checkoutWizard.showAndGet()) {
        return CvsHandler.NULL;
    }
    myUseAlternativeCheckoutPath = checkoutWizard.useAlternativeCheckoutLocation();
    myCheckoutDirectory = checkoutWizard.getCheckoutDirectory();
    mySelectedElements = checkoutWizard.getSelectedElements();
    return CommandCvsHandler.createCheckoutHandler(checkoutWizard.getSelectedConfiguration(), collectCheckoutPaths(), myCheckoutDirectory, myUseAlternativeCheckoutPath, CvsApplicationLevelConfiguration.getInstance().MAKE_CHECKED_OUT_FILES_READONLY, project == null ? null : VcsConfiguration.getInstance(project).getCheckoutOption());
}
Also used : Project(com.intellij.openapi.project.Project) CheckoutWizard(com.intellij.cvsSupport2.ui.experts.checkout.CheckoutWizard)

Example 2 with CheckoutWizard

use of com.intellij.cvsSupport2.ui.experts.checkout.CheckoutWizard 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)

Aggregations

CheckoutWizard (com.intellij.cvsSupport2.ui.experts.checkout.CheckoutWizard)2 CvsElement (com.intellij.cvsSupport2.cvsBrowser.CvsElement)1 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 Project (com.intellij.openapi.project.Project)1 File (java.io.File)1