use of com.intellij.cvsSupport2.cvsoperations.cvsContent.DirectoryContentProvider in project intellij-community by JetBrains.
the class AbstractVcsDataProvider method executeCommand.
private void executeCommand(final DirectoryContentProvider command, final GetContentCallback callback) {
final CvsOperationExecutor executor = new CvsOperationExecutor(false, callback.getProject(), callback.getModalityState());
executor.setIsQuietOperation(true);
final CancellableCvsHandler cvsHandler = new CancellableCvsHandler(CvsBundle.message("browse.repository.operation.name"), (CvsOperation) command);
callback.useForCancel(cvsHandler.getProgressListener());
executor.performActionSync(cvsHandler, new DefaultCvsOperationExecutorCallback() {
@Override
public void executionFinished(boolean successfully) {
if (!successfully) {
final List<VcsException> errors = cvsHandler.getErrorsExceptAborted();
if (!errors.isEmpty()) {
myErrorCallback.consume(errors.get(0));
}
}
callback.finished();
}
});
}
use of com.intellij.cvsSupport2.cvsoperations.cvsContent.DirectoryContentProvider in project intellij-community by JetBrains.
the class AbstractVcsDataProvider method fillContentFor.
@Override
public void fillContentFor(final GetContentCallback callback, Consumer<VcsException> errorCallback) {
myErrorCallback = errorCallback;
if (ApplicationManager.getApplication().isUnitTestMode()) {
executeCommand(createDirectoryContentProvider(callback.getElementPath()), callback);
} else {
final DirectoryContentProvider provider = createDirectoryContentProvider(callback.getElementPath());
provider.setStreamingListener(directoryContent -> callback.appendDirectoryContent(directoryContent));
executeCommand(provider, callback);
}
}
Aggregations