Skip to content

Commit 73e767e

Browse files
Flanker-MSFTFlanker-MSFT
authored andcommitted
Diff click action and menu action in project explorer in telemetry
1 parent 59a7b8f commit 73e767e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-facet/src/main/java/com/microsoft/azure/toolkit/intellij/facet/projectexplorer/ActionNode.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import com.intellij.ide.projectView.PresentationData;
99
import com.intellij.ide.util.treeView.AbstractTreeNode;
10+
import com.intellij.openapi.actionSystem.AnActionEvent;
1011
import com.intellij.openapi.util.Disposer;
1112
import com.intellij.ui.SimpleTextAttributes;
1213
import com.microsoft.azure.toolkit.intellij.common.action.IntellijAzureActionManager;
@@ -76,6 +77,10 @@ protected void update(@Nonnull PresentationData presentation) {
7677

7778
@Override
7879
public void onClicked(Object event) {
80+
final Action<T> value = getValue();
81+
if (event instanceof AnActionEvent) {
82+
value.getContext().setTelemetryProperty(Action.PLACE, ((AnActionEvent) event).getPlace());
83+
}
7984
this.getValue().handle(this.source, event);
8085
}
8186

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-facet/src/main/java/com/microsoft/azure/toolkit/intellij/facet/projectexplorer/AzureFacetTreeStructureProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public void mousePressed(MouseEvent e) {
125125
if (SwingUtilities.isLeftMouseButton(e) && currentTreeNode instanceof IAzureFacetNode) {
126126
final IAzureFacetNode node = (IAzureFacetNode) currentTreeNode;
127127
final DataContext context = DataManager.getInstance().getDataContext(tree);
128-
final AnActionEvent event = AnActionEvent.createFromAnAction(new EmptyAction(), e, ActionPlaces.PROJECT_VIEW_POPUP, context);
128+
final AnActionEvent event = AnActionEvent.createFromAnAction(new EmptyAction(), e, ActionPlaces.PROJECT_VIEW_POPUP + ".click", context);
129129
if (e.getClickCount() == 1) {
130130
node.onClicked(event);
131131
} else if (e.getClickCount() == 2) {

0 commit comments

Comments
 (0)