Search in sources :

Example 11 with CvsContext

use of com.intellij.cvsSupport2.actions.cvsContext.CvsContext in project intellij-community by JetBrains.

the class CvsGlobalAction method update.

public void update(AnActionEvent e) {
    final CvsContext cvsContext = CvsContextWrapper.createInstance(e);
    final Presentation presentation = e.getPresentation();
    if (cvsContext.cvsIsActive()) {
        presentation.setVisible(true);
        presentation.setEnabled(true);
    } else {
        presentation.setVisible(false);
        presentation.setEnabled(false);
    }
}
Also used : CvsContext(com.intellij.cvsSupport2.actions.cvsContext.CvsContext) Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 12 with CvsContext

use of com.intellij.cvsSupport2.actions.cvsContext.CvsContext in project intellij-community by JetBrains.

the class AbstractAction method performAction.

protected void performAction(final Project project, final CvsHandler handler, final CvsContext context) {
    final CvsOperationExecutor executor = new CvsOperationExecutor(project);
    executor.performActionSync(handler, new MyCvsOperationExecutorCallback(context, handler, executor));
}
Also used : CvsOperationExecutor(com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor)

Example 13 with CvsContext

use of com.intellij.cvsSupport2.actions.cvsContext.CvsContext in project intellij-community by JetBrains.

the class AbstractWatchAction method getCvsHandler.

protected CvsHandler getCvsHandler(CvsContext context) {
    CvsConfiguration configuration = CvsConfiguration.getInstance(context.getProject());
    WatcherDialog dialog = createDialog(configuration, context);
    if (!dialog.showAndGet()) {
        return CvsHandler.NULL;
    }
    Watch watch = dialog.getWatch();
    saveWatch(configuration, watch);
    WatchOperation watchOperation = new WatchOperation(getWatchOperation(), watch);
    VirtualFile[] files = context.getSelectedFiles();
    for (int i = 0; i < files.length; i++) {
        watchOperation.addFile(files[i]);
    }
    return new CommandCvsHandler(getTitle(context), watchOperation);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) CvsConfiguration(com.intellij.cvsSupport2.config.CvsConfiguration) WatcherDialog(com.intellij.cvsSupport2.cvsoperations.cvsWatch.ui.WatcherDialog) Watch(org.netbeans.lib.cvsclient.command.Watch) CommandCvsHandler(com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler) WatchOperation(com.intellij.cvsSupport2.cvsoperations.cvsWatch.WatchOperation)

Example 14 with CvsContext

use of com.intellij.cvsSupport2.actions.cvsContext.CvsContext in project intellij-community by JetBrains.

the class AbstractWatchOnOffAction method getCvsHandler.

protected CvsHandler getCvsHandler(CvsContext context) {
    WatchOperation watchOperation = new WatchOperation(getMode());
    VirtualFile[] files = context.getSelectedFiles();
    for (VirtualFile file : files) {
        watchOperation.addFile(file);
    }
    return new CommandCvsHandler(getTitle(context), watchOperation);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) CommandCvsHandler(com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler) WatchOperation(com.intellij.cvsSupport2.cvsoperations.cvsWatch.WatchOperation)

Example 15 with CvsContext

use of com.intellij.cvsSupport2.actions.cvsContext.CvsContext 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)

Aggregations

CvsContext (com.intellij.cvsSupport2.actions.cvsContext.CvsContext)10 VirtualFile (com.intellij.openapi.vfs.VirtualFile)10 Project (com.intellij.openapi.project.Project)9 FilePath (com.intellij.openapi.vcs.FilePath)5 CommandCvsHandler (com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler)3 CvsHandler (com.intellij.cvsSupport2.cvshandlers.CvsHandler)3 CvsTabbedWindow (com.intellij.cvsSupport2.ui.CvsTabbedWindow)3 Presentation (com.intellij.openapi.actionSystem.Presentation)3 UpdateSettingsOnCvsConfiguration (com.intellij.cvsSupport2.actions.update.UpdateSettingsOnCvsConfiguration)2 CvsConfiguration (com.intellij.cvsSupport2.config.CvsConfiguration)2 SelectCvsConfigurationDialog (com.intellij.cvsSupport2.config.ui.SelectCvsConfigurationDialog)2 CvsConnectionSettings (com.intellij.cvsSupport2.connections.CvsConnectionSettings)2 CreateTagDialog (com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.ui.CreateTagDialog)2 WatchOperation (com.intellij.cvsSupport2.cvsoperations.cvsWatch.WatchOperation)2 VcsContext (com.intellij.openapi.vcs.actions.VcsContext)2 File (java.io.File)2 CvsBundle (com.intellij.CvsBundle)1 CvsContextAdapter (com.intellij.cvsSupport2.actions.cvsContext.CvsContextAdapter)1 CvsLightweightFile (com.intellij.cvsSupport2.actions.cvsContext.CvsLightweightFile)1 CvsEntriesManager (com.intellij.cvsSupport2.application.CvsEntriesManager)1