// 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.ide.BrowserUtil;
import com.intellij.ide.DataManager;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.impl.SimpleDataContext;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.FileEditorManagerEvent;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.MessageDialogBuilder;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.ui.popup.ListPopup;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.openapi.wm.StatusBar;
import com.intellij.openapi.wm.StatusBarWidget;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.openapi.wm.impl.status.EditorBasedWidget;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.ui.popup.PopupFactoryImpl;
import com.intellij.util.Consumer;
import com.intellij.openapi.vcs.VcsRoot;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import git4idea.GitBranch;
import gitflow.*;
import gitflow.actions.GitflowPopupGroup;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.awt.*;
import java.awt.event.MouseEvent;
import javax.swing.JFrame;
import git4idea.GitUtil;
import git4idea.branch.GitBranchUtil;
import git4idea.repo.GitRepository;
import git4idea.repo.GitRepositoryChangeListener;
import git4idea.ui.branch.GitBranchWidget;
import git4idea.GitVcs;
/*
 * Copyright 2000-2010 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package gitflow.ui;






/**
 * Status bar widget which displays actions for git flow
 *
 * @author Kirill Likhodedov, Opher Vishnia, Alexander von Bremen-Kühne
 */
public class GitflowWidget extends GitBranchWidget implements GitRepositoryChangeListener, StatusBarWidget.TextPresentation {
    private volatile String myText = "";
    private volatile String myTooltip = "";

// 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/ui/GitflowWidget.java
import com.intellij.ide.BrowserUtil;
import com.intellij.ide.DataManager;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.impl.SimpleDataContext;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.FileEditorManagerEvent;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.MessageDialogBuilder;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.ui.popup.ListPopup;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.openapi.wm.StatusBar;
import com.intellij.openapi.wm.StatusBarWidget;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.openapi.wm.impl.status.EditorBasedWidget;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.ui.popup.PopupFactoryImpl;
import com.intellij.util.Consumer;
import com.intellij.openapi.vcs.VcsRoot;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import git4idea.GitBranch;
import gitflow.*;
import gitflow.actions.GitflowPopupGroup;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.awt.*;
import java.awt.event.MouseEvent;
import javax.swing.JFrame;
import git4idea.GitUtil;
import git4idea.branch.GitBranchUtil;
import git4idea.repo.GitRepository;
import git4idea.repo.GitRepositoryChangeListener;
import git4idea.ui.branch.GitBranchWidget;
import git4idea.GitVcs;

/*
 * Copyright 2000-2010 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package gitflow.ui;






/**
 * Status bar widget which displays actions for git flow
 *
 * @author Kirill Likhodedov, Opher Vishnia, Alexander von Bremen-Kühne
 */
public class GitflowWidget extends GitBranchWidget implements GitRepositoryChangeListener, StatusBarWidget.TextPresentation {
    private volatile String myText = "";
    private volatile String myTooltip = "";

    private GitflowPopupGroup popupGroup;