Search in sources :

Example 6 with CvsContext

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

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

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

Example 9 with CvsContext

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

the class BrowseCvsRepositoryAction method getCvsHandler.

@Override
protected CvsHandler getCvsHandler(CvsContext context) {
    final SelectCvsConfigurationDialog selectCvsConfigurationDialog = new SelectCvsConfigurationDialog(context.getProject());
    if (!selectCvsConfigurationDialog.showAndGet()) {
        return CvsHandler.NULL;
    }
    mySelectedConfiguration = selectCvsConfigurationDialog.getSelectedConfiguration();
    return new MyCvsHandler();
}
Also used : SelectCvsConfigurationDialog(com.intellij.cvsSupport2.config.ui.SelectCvsConfigurationDialog)

Example 10 with CvsContext

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

the class BrowseCvsRepositoryAction method onActionPerformed.

@Override
protected void onActionPerformed(CvsContext context, CvsTabbedWindow tabbedWindow, boolean successfully, CvsHandler handler) {
    if (mySelectedConfiguration == null)
        return;
    final Project project = context.getProject();
    if (!loginImpl(context.getProject(), e -> VcsBalloonProblemNotifier.showOverChangesView(project, e.getMessage(), MessageType.WARNING)))
        return;
    super.onActionPerformed(context, tabbedWindow, successfully, handler);
    if (successfully) {
        LOG.assertTrue(project != null);
        LOG.assertTrue(mySelectedConfiguration != null);
        final BrowserPanel browserPanel = new BrowserPanel(mySelectedConfiguration, project, e -> VcsBalloonProblemNotifier.showOverChangesView(project, e.getMessage(), MessageType.ERROR));
        tabbedWindow.addTab(TITLE, browserPanel, true, true, true, true, browserPanel.getActionGroup(), "cvs.browse");
    }
}
Also used : CvsTabbedWindow(com.intellij.cvsSupport2.ui.CvsTabbedWindow) MessageType(com.intellij.openapi.ui.MessageType) FileSetToBeUpdated(com.intellij.cvsSupport2.cvshandlers.FileSetToBeUpdated) VcsContext(com.intellij.openapi.vcs.actions.VcsContext) Presentation(com.intellij.openapi.actionSystem.Presentation) CvsHandler(com.intellij.cvsSupport2.cvshandlers.CvsHandler) CvsBundle(com.intellij.CvsBundle) VcsBalloonProblemNotifier(com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier) CvsContext(com.intellij.cvsSupport2.actions.cvsContext.CvsContext) BrowserPanel(com.intellij.cvsSupport2.cvsBrowser.ui.BrowserPanel) LoginPerformer(com.intellij.cvsSupport2.cvsoperations.common.LoginPerformer) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) SelectCvsConfigurationDialog(com.intellij.cvsSupport2.config.ui.SelectCvsConfigurationDialog) Project(com.intellij.openapi.project.Project) CommonDataKeys(com.intellij.openapi.actionSystem.CommonDataKeys) DumbAware(com.intellij.openapi.project.DumbAware) VcsException(com.intellij.openapi.vcs.VcsException) Collections(java.util.Collections) CvsRootConfiguration(com.intellij.cvsSupport2.config.CvsRootConfiguration) Consumer(com.intellij.util.Consumer) CvsEnvironment(com.intellij.cvsSupport2.connections.CvsEnvironment) Project(com.intellij.openapi.project.Project) BrowserPanel(com.intellij.cvsSupport2.cvsBrowser.ui.BrowserPanel)

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