Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 8 additions & 24 deletions src/main/java/gitflow/ui/GitflowTaskDialogPanelProvider.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package gitflow.ui;
import com.intellij.openapi.project.Project;
import com.intellij.tasks.LocalTask;
import com.intellij.tasks.Task;
import com.intellij.tasks.TaskManager;
import com.intellij.tasks.actions.vcs.VcsTaskDialogPanelProvider;
import com.intellij.tasks.ui.TaskDialogPanel;
import com.intellij.tasks.ui.TaskDialogPanelProvider;
import git4idea.branch.GitBranchUtil;
import git4idea.repo.GitRepository;
import gitflow.GitflowBranchUtil;
Expand All @@ -13,40 +12,25 @@
import org.jetbrains.annotations.Nullable;


public class GitflowTaskDialogPanelProvider extends TaskDialogPanelProvider {

@Deprecated
@Nullable
@Override
public TaskDialogPanel getOpenTaskPanel(@NotNull Project project, @NotNull Task task) {
return null;
}

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);
if (branchUtil.hasGitflow()) {
return TaskManager.getManager(project).isVcsEnabled() ? new GitflowOpenTaskPanel(project, task, currentRepo) : null;
}
else{
return null;
}
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);

if (branchUtil.hasGitflow()) {
return TaskManager.getManager(project).isVcsEnabled() ? new GitflowCloseTaskPanel(project, task, currentRepo) : null;
}
else{
return null;
}
return branchUtil != null && branchUtil.hasGitflow() && TaskManager.getManager(project).isVcsEnabled()
? new GitflowCloseTaskPanel(project, task, currentRepo)
: null;
}

}