Search in sources :

Example 1 with CvsHandler

use of com.intellij.cvsSupport2.cvshandlers.CvsHandler in project intellij-community by JetBrains.

the class GetFileFromRepositoryAction method getCvsHandler.

protected CvsHandler getCvsHandler(CvsContext context) {
    CvsLightweightFile[] cvsLightweightFiles = context.getSelectedLightweightFiles();
    Project project = context.getProject();
    if (cvsLightweightFiles != null) {
        boolean makeNewFilesReadOnly = project != null && CvsConfiguration.getInstance(project).MAKE_NEW_FILES_READONLY;
        return CommandCvsHandler.createGetFileFromRepositoryHandler(cvsLightweightFiles, makeNewFilesReadOnly);
    }
    final FilePath[] filePaths = context.getSelectedFilePaths();
    if (filePaths != null) {
        CvsConfiguration cvsConfiguration = CvsConfiguration.getInstance(project);
        // do not use -j's
        final UpdateSettingsOnCvsConfiguration updateSettings = new UpdateSettingsOnCvsConfiguration(cvsConfiguration, cvsConfiguration.CLEAN_COPY, cvsConfiguration.RESET_STICKY);
        return CommandCvsHandler.createUpdateHandler(filePaths, updateSettings, project, UpdatedFiles.create());
    }
    return CvsHandler.NULL;
}
Also used : FilePath(com.intellij.openapi.vcs.FilePath) Project(com.intellij.openapi.project.Project) CvsConfiguration(com.intellij.cvsSupport2.config.CvsConfiguration) UpdateSettingsOnCvsConfiguration(com.intellij.cvsSupport2.actions.update.UpdateSettingsOnCvsConfiguration) CvsLightweightFile(com.intellij.cvsSupport2.actions.cvsContext.CvsLightweightFile) UpdateSettingsOnCvsConfiguration(com.intellij.cvsSupport2.actions.update.UpdateSettingsOnCvsConfiguration)

Example 2 with CvsHandler

use of com.intellij.cvsSupport2.cvshandlers.CvsHandler in project intellij-community by JetBrains.

the class ImportAction method getCvsHandler.

protected CvsHandler getCvsHandler(CvsContext context) {
    final VirtualFile selectedFile = context.getSelectedFile();
    final ImportWizard importWizard = new ImportWizard(context.getProject(), selectedFile);
    if (!importWizard.showAndGet()) {
        return CvsHandler.NULL;
    }
    myImportDetails = importWizard.createImportDetails();
    if (myImportDetails == null)
        return CvsHandler.NULL;
    return CommandCvsHandler.createImportHandler(myImportDetails);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) ImportWizard(com.intellij.cvsSupport2.ui.experts.importToCvs.ImportWizard)

Example 3 with CvsHandler

use of com.intellij.cvsSupport2.cvshandlers.CvsHandler in project intellij-community by JetBrains.

the class ImportAction method onActionPerformed.

protected void onActionPerformed(CvsContext context, CvsTabbedWindow tabbedWindow, boolean successfully, CvsHandler handler) {
    super.onActionPerformed(context, tabbedWindow, successfully, handler);
    final ImportConfiguration importConfiguration = ImportConfiguration.getInstance();
    if (successfully && importConfiguration.CHECKOUT_AFTER_IMPORT) {
        createCheckoutAction(importConfiguration.MAKE_NEW_FILES_READ_ONLY).actionPerformed(context);
    }
}
Also used : ImportConfiguration(com.intellij.cvsSupport2.config.ImportConfiguration)

Example 4 with CvsHandler

use of com.intellij.cvsSupport2.cvshandlers.CvsHandler in project intellij-community by JetBrains.

the class ViewEditorsAction method onActionPerformed.

protected void onActionPerformed(CvsContext context, CvsTabbedWindow tabbedWindow, boolean successfully, CvsHandler handler) {
    super.onActionPerformed(context, tabbedWindow, successfully, handler);
    if (successfully) {
        List<EditorInfo> editors = myEditorsOperation.getEditors();
        String filePath = CvsVfsUtil.getFileFor(context.getSelectedFile()).getAbsolutePath();
        final Project project = context.getProject();
        if (project == null) {
            return;
        }
        if (editors.isEmpty()) {
            VcsBalloonProblemNotifier.showOverChangesView(project, CvsBundle.message("message.error.no.editors.for.file", filePath), MessageType.INFO);
        } else {
            tabbedWindow.addTab(CvsBundle.message("message.editors.for.file", filePath), new EditorsPanel(project, editors), true, true, true, true, null, "cvs.editors");
        }
    }
}
Also used : Project(com.intellij.openapi.project.Project) EditorInfo(com.intellij.cvsSupport2.cvsoperations.cvsEdit.EditorInfo) EditorsPanel(com.intellij.cvsSupport2.cvsoperations.cvsEdit.ui.EditorsPanel)

Example 5 with CvsHandler

use of com.intellij.cvsSupport2.cvshandlers.CvsHandler in project intellij-community by JetBrains.

the class BranchAction method getCvsHandler.

protected CvsHandler getCvsHandler(CvsContext context) {
    final FilePath[] selectedFiles = context.getSelectedFilePaths();
    final Project project = context.getProject();
    final CreateTagDialog dialog = new CreateTagDialog(selectedFiles, project, false);
    if (!dialog.showAndGet()) {
        return CvsHandler.NULL;
    }
    final boolean makeNewFilesReadOnly = CvsConfiguration.getInstance(project).MAKE_NEW_FILES_READONLY;
    return CommandCvsHandler.createBranchHandler(selectedFiles, dialog.getTagName(), dialog.switchToThisBranch(), dialog.getOverrideExisting(), makeNewFilesReadOnly, project);
}
Also used : FilePath(com.intellij.openapi.vcs.FilePath) Project(com.intellij.openapi.project.Project) CreateTagDialog(com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.ui.CreateTagDialog)

Aggregations

VirtualFile (com.intellij.openapi.vfs.VirtualFile)11 CommandCvsHandler (com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler)10 CvsHandler (com.intellij.cvsSupport2.cvshandlers.CvsHandler)10 CvsOperationExecutor (com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor)9 Project (com.intellij.openapi.project.Project)9 FilePath (com.intellij.openapi.vcs.FilePath)9 File (java.io.File)7 CvsLightweightFile (com.intellij.cvsSupport2.actions.cvsContext.CvsLightweightFile)4 CvsTabbedWindow (com.intellij.cvsSupport2.ui.CvsTabbedWindow)4 CvsContext (com.intellij.cvsSupport2.actions.cvsContext.CvsContext)3 CvsConfiguration (com.intellij.cvsSupport2.config.CvsConfiguration)3 SelectCvsConfigurationDialog (com.intellij.cvsSupport2.config.ui.SelectCvsConfigurationDialog)2 TagOperation (com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.TagOperation)2 CreateTagDialog (com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.ui.CreateTagDialog)2 UpdateOperation (com.intellij.cvsSupport2.cvsoperations.cvsUpdate.UpdateOperation)2 WatchOperation (com.intellij.cvsSupport2.cvsoperations.cvsWatch.WatchOperation)2 CheckoutWizard (com.intellij.cvsSupport2.ui.experts.checkout.CheckoutWizard)2 VcsException (com.intellij.openapi.vcs.VcsException)2 VcsContext (com.intellij.openapi.vcs.actions.VcsContext)2 ArrayList (java.util.ArrayList)2