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);
}
}
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");
}
}
}
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");
}
}
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();
}
}
}
}
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");
}
}
}
Aggregations