diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/ExternalSystemViewGearAction.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/ExternalSystemViewGearAction.java index f750381599ae..f9ac85f6888d 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/ExternalSystemViewGearAction.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/ExternalSystemViewGearAction.java @@ -16,6 +16,7 @@ package com.intellij.openapi.externalSystem.action; import com.intellij.openapi.actionSystem.AnActionEvent; +import com.intellij.openapi.externalSystem.model.ProjectSystemId; import com.intellij.openapi.externalSystem.statistics.ExternalSystemActionsCollector; import com.intellij.openapi.externalSystem.view.ExternalProjectsViewImpl; import org.jetbrains.annotations.NotNull; @@ -44,7 +45,9 @@ public abstract class ExternalSystemViewGearAction extends ExternalSystemToggleA public void setSelected(@NotNull AnActionEvent e, boolean state) { final ExternalProjectsViewImpl view = getView(); if (view != null){ - ExternalSystemActionsCollector.trigger(getProject(e), getSystemId(e), this, e); + // es system id does not available in the action context, get it from the view + ProjectSystemId systemId = view.getSystemId(); + ExternalSystemActionsCollector.trigger(getProject(e), systemId, this, e); setSelected(view, state); } } diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/RefreshAllExternalProjectsAction.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/RefreshAllExternalProjectsAction.java index 0dc4f86917c1..8344fe09fec6 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/RefreshAllExternalProjectsAction.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/RefreshAllExternalProjectsAction.java @@ -78,7 +78,6 @@ public class RefreshAllExternalProjectsAction extends AnAction implements AnActi e.getPresentation().setEnabled(false); return; } - ExternalSystemActionsCollector.trigger(project, null, this, e); final List systemIds = getSystemIds(e); if (systemIds.isEmpty()) { @@ -90,6 +89,7 @@ public class RefreshAllExternalProjectsAction extends AnAction implements AnActi FileDocumentManager.getInstance().saveAllDocuments(); for (ProjectSystemId externalSystemId : systemIds) { + ExternalSystemActionsCollector.trigger(project, externalSystemId, this, e); ExternalSystemUtil.refreshProjects( new ImportSpecBuilder(project, externalSystemId) .forceWhenUptodate(true) diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/view/ExternalProjectsViewImpl.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/view/ExternalProjectsViewImpl.java index daba5d5d649f..ca502a1c07b0 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/view/ExternalProjectsViewImpl.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/view/ExternalProjectsViewImpl.java @@ -305,8 +305,8 @@ public class ExternalProjectsViewImpl extends SimpleToolWindowPanel implements D ActionToolbar actionToolbar = actionManager.createActionToolbar(myExternalSystemId.getReadableName() + " View Toolbar", (DefaultActionGroup)actionManager .getAction("ExternalSystemView.ActionsToolbar"), true); - - actionToolbar.setTargetComponent(myTree); + // make the view data context available for the toolbar actions + actionToolbar.setTargetComponent(this); setToolbar(actionToolbar.getComponent()); setContent(ScrollPaneFactory.createScrollPane(myTree));