Search in sources :

Example 1 with GithubSelectForkDialog

use of org.jetbrains.plugins.github.ui.GithubSelectForkDialog in project intellij-community by JetBrains.

the class GithubCreatePullRequestWorker method showTargetDialog.

@Nullable
public ForkInfo showTargetDialog() {
    if (myAvailableForks == null) {
        try {
            myAvailableForks = GithubUtil.computeValueInModal(myProject, myCurrentBranch, indicator -> getAvailableForks(indicator));
        } catch (ProcessCanceledException ignore) {
        }
    }
    Convertor<String, ForkInfo> getForkPath = user -> GithubUtil.computeValueInModal(myProject, "Access to GitHub", indicator -> findRepositoryByUser(indicator, user));
    GithubSelectForkDialog dialog = new GithubSelectForkDialog(myProject, myAvailableForks, getForkPath);
    DialogManager.show(dialog);
    if (!dialog.isOK()) {
        return null;
    }
    return dialog.getPath();
}
Also used : Change(com.intellij.openapi.vcs.changes.Change) VirtualFile(com.intellij.openapi.vfs.VirtualFile) GithubApiUtil(org.jetbrains.plugins.github.api.GithubApiUtil) Task(com.intellij.openapi.progress.Task) GitCompareBranchesDialog(git4idea.ui.branch.GitCompareBranchesDialog) GithubRepo(org.jetbrains.plugins.github.api.data.GithubRepo) Logger(com.intellij.openapi.diagnostic.Logger) VcsException(com.intellij.openapi.vcs.VcsException) GitRepository(git4idea.repo.GitRepository) GitCommit(git4idea.GitCommit) Git(git4idea.commands.Git) GithubSelectForkDialog(org.jetbrains.plugins.github.ui.GithubSelectForkDialog) CancellationException(java.util.concurrent.CancellationException) Collection(java.util.Collection) GithubFullPath(org.jetbrains.plugins.github.api.GithubFullPath) GithubPullRequest(org.jetbrains.plugins.github.api.data.GithubPullRequest) GitCommandResult(git4idea.commands.GitCommandResult) GitChangeUtils(git4idea.changes.GitChangeUtils) EmptyProgressIndicator(com.intellij.openapi.progress.EmptyProgressIndicator) VcsCommitMetadata(com.intellij.vcs.log.VcsCommitMetadata) Nullable(org.jetbrains.annotations.Nullable) GithubOperationCanceledException(org.jetbrains.plugins.github.exceptions.GithubOperationCanceledException) ProgressIndicator(com.intellij.openapi.progress.ProgressIndicator) List(java.util.List) ServiceManager(com.intellij.openapi.components.ServiceManager) ApplicationManager(com.intellij.openapi.application.ApplicationManager) NotNull(org.jetbrains.annotations.NotNull) Couple(com.intellij.openapi.util.Couple) FutureTask(java.util.concurrent.FutureTask) Callable(java.util.concurrent.Callable) ContainerUtil(com.intellij.util.containers.ContainerUtil) org.jetbrains.plugins.github.util(org.jetbrains.plugins.github.util) ArrayList(java.util.ArrayList) ProcessCanceledException(com.intellij.openapi.progress.ProcessCanceledException) GitFetcher(git4idea.update.GitFetcher) GitHistoryUtils(git4idea.history.GitHistoryUtils) Project(com.intellij.openapi.project.Project) DialogManager(git4idea.DialogManager) GitLocalBranch(git4idea.GitLocalBranch) GithubBranch(org.jetbrains.plugins.github.api.data.GithubBranch) GitRemote(git4idea.repo.GitRemote) StringUtil(com.intellij.openapi.util.text.StringUtil) Convertor(com.intellij.util.containers.Convertor) GithubRepoDetailed(org.jetbrains.plugins.github.api.data.GithubRepoDetailed) IOException(java.io.IOException) GitCommitCompareInfo(git4idea.util.GitCommitCompareInfo) ExecutionException(java.util.concurrent.ExecutionException) Pair(com.intellij.openapi.util.Pair) GitFetchResult(git4idea.update.GitFetchResult) ProcessCanceledException(com.intellij.openapi.progress.ProcessCanceledException) GithubSelectForkDialog(org.jetbrains.plugins.github.ui.GithubSelectForkDialog) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

ApplicationManager (com.intellij.openapi.application.ApplicationManager)1 ServiceManager (com.intellij.openapi.components.ServiceManager)1 Logger (com.intellij.openapi.diagnostic.Logger)1 EmptyProgressIndicator (com.intellij.openapi.progress.EmptyProgressIndicator)1 ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)1 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 Task (com.intellij.openapi.progress.Task)1 Project (com.intellij.openapi.project.Project)1 Couple (com.intellij.openapi.util.Couple)1 Pair (com.intellij.openapi.util.Pair)1 StringUtil (com.intellij.openapi.util.text.StringUtil)1 VcsException (com.intellij.openapi.vcs.VcsException)1 Change (com.intellij.openapi.vcs.changes.Change)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 ContainerUtil (com.intellij.util.containers.ContainerUtil)1 Convertor (com.intellij.util.containers.Convertor)1 VcsCommitMetadata (com.intellij.vcs.log.VcsCommitMetadata)1 DialogManager (git4idea.DialogManager)1 GitCommit (git4idea.GitCommit)1 GitLocalBranch (git4idea.GitLocalBranch)1