Search in sources :

Example 1 with CvsTabbedWindow

use of com.intellij.cvsSupport2.ui.CvsTabbedWindow 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 2 with CvsTabbedWindow

use of com.intellij.cvsSupport2.ui.CvsTabbedWindow 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 3 with CvsTabbedWindow

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

Example 4 with CvsTabbedWindow

use of com.intellij.cvsSupport2.ui.CvsTabbedWindow in project intellij-community by JetBrains.

the class CvsOperationExecutor method performActionSync.

public void performActionSync(final CvsHandler handler, final CvsOperationExecutorCallback callback) {
    final CvsTabbedWindow tabbedWindow = myIsQuietOperation ? null : openTabbedWindow(handler);
    final Runnable finish = () -> {
        try {
            myResult.addAllErrors(handler.getErrorsExceptAborted());
            handler.finish();
            if (myProject == null || !myProject.isDisposed()) {
                showErrors(handler, tabbedWindow);
            }
        } finally {
            try {
                if (myResult.finishedUnsuccessfully(handler)) {
                    callback.executionFinished(false);
                } else {
                    if (handler.getErrors().isEmpty())
                        callback.executionFinishedSuccessfully();
                    callback.executionFinished(true);
                }
            } finally {
                if (myProject != null && handler != CvsHandler.NULL) {
                    ApplicationManager.getApplication().invokeLater(() -> StatusBar.Info.set(getStatusMessage(handler), myProject));
                }
            }
        }
    };
    final Runnable cvsAction = () -> {
        try {
            if (handler == CvsHandler.NULL)
                return;
            setText(CvsBundle.message("progress.text.preparing.for.login"));
            handler.beforeLogin();
            if (myResult.finishedUnsuccessfully(handler))
                return;
            setText(CvsBundle.message("progress.text.preparing.for.action", handler.getTitle()));
            handler.run(myProject, myExecutor);
            if (myResult.finishedUnsuccessfully(handler))
                return;
        } catch (ProcessCanceledException ex) {
            myResult.setIsCanceled();
        } finally {
            callback.executeInProgressAfterAction(myExecutor);
        }
    };
    if (doNotShowProgress()) {
        cvsAction.run();
        if (myIsQuietOperation) {
            finish.run();
        } else {
            myExecutor.runInDispatchThread(finish, myProject);
        }
    } else {
        final PerformInBackgroundOption backgroundOption = handler.getBackgroundOption(myProject);
        if (backgroundOption != null) {
            final Task.Backgroundable task = new Task.Backgroundable(myProject, handler.getTitle(), handler.canBeCanceled(), backgroundOption) {

                @Override
                public void run(@NotNull final ProgressIndicator indicator) {
                    cvsAction.run();
                }

                @Override
                public void onSuccess() {
                    finish.run();
                }
            };
            ProgressManager.getInstance().run(task);
        } else {
            if (ProgressManager.getInstance().runProcessWithProgressSynchronously(cvsAction, handler.getTitle(), handler.canBeCanceled(), myProject)) {
                finish.run();
            }
        }
    }
}
Also used : CvsTabbedWindow(com.intellij.cvsSupport2.ui.CvsTabbedWindow) NotNull(org.jetbrains.annotations.NotNull)

Example 5 with CvsTabbedWindow

use of com.intellij.cvsSupport2.ui.CvsTabbedWindow in project intellij-community by JetBrains.

the class ViewWatchersAction method onActionPerformed.

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

Aggregations

CvsTabbedWindow (com.intellij.cvsSupport2.ui.CvsTabbedWindow)4 Project (com.intellij.openapi.project.Project)4 CvsContext (com.intellij.cvsSupport2.actions.cvsContext.CvsContext)3 CvsHandler (com.intellij.cvsSupport2.cvshandlers.CvsHandler)3 VcsContext (com.intellij.openapi.vcs.actions.VcsContext)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 CvsBundle (com.intellij.CvsBundle)1 CvsRootConfiguration (com.intellij.cvsSupport2.config.CvsRootConfiguration)1 ImportConfiguration (com.intellij.cvsSupport2.config.ImportConfiguration)1 SelectCvsConfigurationDialog (com.intellij.cvsSupport2.config.ui.SelectCvsConfigurationDialog)1 CvsEnvironment (com.intellij.cvsSupport2.connections.CvsEnvironment)1 BrowserPanel (com.intellij.cvsSupport2.cvsBrowser.ui.BrowserPanel)1 CommandCvsHandler (com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler)1 FileSetToBeUpdated (com.intellij.cvsSupport2.cvshandlers.FileSetToBeUpdated)1 LoginPerformer (com.intellij.cvsSupport2.cvsoperations.common.LoginPerformer)1 EditorInfo (com.intellij.cvsSupport2.cvsoperations.cvsEdit.EditorInfo)1 EditorsPanel (com.intellij.cvsSupport2.cvsoperations.cvsEdit.ui.EditorsPanel)1 WatcherInfo (com.intellij.cvsSupport2.cvsoperations.cvsWatch.WatcherInfo)1 WatchersPanel (com.intellij.cvsSupport2.cvsoperations.cvsWatch.ui.WatchersPanel)1 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1