-
Notifications
You must be signed in to change notification settings - Fork 141
Expand file tree
/
Copy pathGitflowTaskDialogPanelProvider.java
More file actions
36 lines (32 loc) · 1.56 KB
/
GitflowTaskDialogPanelProvider.java
File metadata and controls
36 lines (32 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package gitflow.ui;
import com.intellij.openapi.project.Project;
import com.intellij.tasks.LocalTask;
import com.intellij.tasks.TaskManager;
import com.intellij.tasks.actions.vcs.VcsTaskDialogPanelProvider;
import com.intellij.tasks.ui.TaskDialogPanel;
import git4idea.branch.GitBranchUtil;
import git4idea.repo.GitRepository;
import gitflow.GitflowBranchUtil;
import gitflow.GitflowBranchUtilManager;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class GitflowTaskDialogPanelProvider extends VcsTaskDialogPanelProvider {
@Nullable
@Override
public TaskDialogPanel getOpenTaskPanel(@NotNull Project project, @NotNull LocalTask task) {
GitRepository currentRepo = GitBranchUtil.getCurrentRepository(project);
GitflowBranchUtil branchUtil = GitflowBranchUtilManager.getBranchUtil(currentRepo);
return branchUtil != null && branchUtil.hasGitflow() && TaskManager.getManager(project).isVcsEnabled()
? new GitflowOpenTaskPanel(project, task, currentRepo)
: null;
}
@Nullable
@Override
public TaskDialogPanel getCloseTaskPanel(@NotNull Project project, @NotNull LocalTask task) {
GitRepository currentRepo = GitBranchUtil.getCurrentRepository(project);
GitflowBranchUtil branchUtil = GitflowBranchUtilManager.getBranchUtil(currentRepo);
return branchUtil != null && branchUtil.hasGitflow() && TaskManager.getManager(project).isVcsEnabled()
? new GitflowCloseTaskPanel(project, task, currentRepo)
: null;
}
}