mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Provide tw toolbar actions data context with the systemId (IDEA-198453)
This commit is contained in:
+4
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -78,7 +78,6 @@ public class RefreshAllExternalProjectsAction extends AnAction implements AnActi
|
||||
e.getPresentation().setEnabled(false);
|
||||
return;
|
||||
}
|
||||
ExternalSystemActionsCollector.trigger(project, null, this, e);
|
||||
|
||||
final List<ProjectSystemId> 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)
|
||||
|
||||
+2
-2
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user