// Path: src/main/java/gitflow/actions/GitflowPopupGroup.java
// public class GitflowPopupGroup {
// 
//     Project myProject;
//     DefaultActionGroup actionGroup;
//     GitRepositoryManager myRepositoryManager;
//     List<GitRepository> gitRepositories;
// 
//     public GitflowPopupGroup(@NotNull Project project, boolean includeAdvanced) {
//         myProject = project;
// 
//         //fetch all the git repositories from the project;
//         myRepositoryManager = GitUtil.getRepositoryManager(project);
//         gitRepositories = myRepositoryManager.getRepositories();
// 
//         createActionGroup(includeAdvanced);
//     }
// 
//     /**
//      * Generates the popup actions for the widget
//      */
//     private void createActionGroup(boolean includeAdvanced){
//         actionGroup = new DefaultActionGroup(null, false);
// 
// 
//         if (gitRepositories.size() == 1){
//             ActionGroup repoActions =
//                     (new RepoActions(myProject, gitRepositories.get(0)))
//                             .getRepoActionGroup(includeAdvanced);
//             actionGroup.addAll(repoActions);
//         }
//         else{
//             Iterator gitRepositoriesIterator = gitRepositories.iterator();
//             while(gitRepositoriesIterator.hasNext()){
//                 GitRepository repo = (GitRepository) gitRepositoriesIterator.next();
//                 RepoActions repoActions = new RepoActions(myProject, repo);
//                 actionGroup.add(repoActions);
//             }
//         }
//     }
// 
//     public ActionGroup getActionGroup (){
// 
//         return actionGroup;
//     }
// }


import com.intellij.openapi.actionSystem.ActionGroup;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
import gitflow.actions.GitflowPopupGroup;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
package gitflow;


public class GitflowMenu extends ActionGroup {
    public GitflowMenu() {
        super("Gitflow", true);
    }

    @NotNull
    @Override
    public AnAction[] getChildren(@Nullable AnActionEvent anActionEvent) {
        if (anActionEvent == null) {
            return new AnAction[0];
        }

        Project project = anActionEvent.getProject();
        if (project == null) {
            return new AnAction[0];
        }

// Path: src/main/java/gitflow/actions/GitflowPopupGroup.java
// public class GitflowPopupGroup {
// 
//     Project myProject;
//     DefaultActionGroup actionGroup;
//     GitRepositoryManager myRepositoryManager;
//     List<GitRepository> gitRepositories;
// 
//     public GitflowPopupGroup(@NotNull Project project, boolean includeAdvanced) {
//         myProject = project;
// 
//         //fetch all the git repositories from the project;
//         myRepositoryManager = GitUtil.getRepositoryManager(project);
//         gitRepositories = myRepositoryManager.getRepositories();
// 
//         createActionGroup(includeAdvanced);
//     }
// 
//     /**
//      * Generates the popup actions for the widget
//      */
//     private void createActionGroup(boolean includeAdvanced){
//         actionGroup = new DefaultActionGroup(null, false);
// 
// 
//         if (gitRepositories.size() == 1){
//             ActionGroup repoActions =
//                     (new RepoActions(myProject, gitRepositories.get(0)))
//                             .getRepoActionGroup(includeAdvanced);
//             actionGroup.addAll(repoActions);
//         }
//         else{
//             Iterator gitRepositoriesIterator = gitRepositories.iterator();
//             while(gitRepositoriesIterator.hasNext()){
//                 GitRepository repo = (GitRepository) gitRepositoriesIterator.next();
//                 RepoActions repoActions = new RepoActions(myProject, repo);
//                 actionGroup.add(repoActions);
//             }
//         }
//     }
// 
//     public ActionGroup getActionGroup (){
// 
//         return actionGroup;
//     }
// }


// Path: src/main/java/gitflow/GitflowMenu.java
import com.intellij.openapi.actionSystem.ActionGroup;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
import gitflow.actions.GitflowPopupGroup;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

package gitflow;


public class GitflowMenu extends ActionGroup {
    public GitflowMenu() {
        super("Gitflow", true);
    }

    @NotNull
    @Override
    public AnAction[] getChildren(@Nullable AnActionEvent anActionEvent) {
        if (anActionEvent == null) {
            return new AnAction[0];
        }

        Project project = anActionEvent.getProject();
        if (project == null) {
            return new AnAction[0];
        }

        GitflowPopupGroup popupGroup = new GitflowPopupGroup(project, true);