Search in sources :

Example 1 with ExternalSystemViewGearAction

use of com.intellij.openapi.externalSystem.action.ExternalSystemViewGearAction in project intellij-community by JetBrains.

the class ExternalProjectsViewImpl method createAdditionalGearActionsGroup.

private ActionGroup createAdditionalGearActionsGroup() {
    ActionManager actionManager = ActionManager.getInstance();
    DefaultActionGroup group = new DefaultActionGroup();
    String[] ids = new String[] { "ExternalSystem.GroupTasks", "ExternalSystem.ShowInheritedTasks", "ExternalSystem.ShowIgnored" };
    for (String id : ids) {
        final AnAction gearAction = actionManager.getAction(id);
        if (gearAction instanceof ExternalSystemViewGearAction) {
            ((ExternalSystemViewGearAction) gearAction).setView(this);
            group.add(gearAction);
            Disposer.register(myProject, new Disposable() {

                @Override
                public void dispose() {
                    ((ExternalSystemViewGearAction) gearAction).setView(null);
                }
            });
        }
    }
    return group;
}
Also used : Disposable(com.intellij.openapi.Disposable) ExternalSystemViewGearAction(com.intellij.openapi.externalSystem.action.ExternalSystemViewGearAction)

Aggregations

Disposable (com.intellij.openapi.Disposable)1 ExternalSystemViewGearAction (com.intellij.openapi.externalSystem.action.ExternalSystemViewGearAction)1