|
28 | 28 | import com.microsoft.azure.toolkit.intellij.azuresdk.model.AzureSdkServiceEntity; |
29 | 29 | import com.microsoft.azure.toolkit.intellij.azuresdk.service.AzureSdkLibraryService; |
30 | 30 | import com.microsoft.azure.toolkit.intellij.common.TextDocumentListenerAdapter; |
| 31 | +import com.microsoft.azure.toolkit.lib.common.operation.AzureOperation; |
31 | 32 | import com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager; |
32 | 33 | import com.microsoft.azure.toolkit.lib.common.utils.TailingDebouncer; |
33 | 34 | import lombok.Getter; |
@@ -70,16 +71,22 @@ private void initEventListeners() { |
70 | 71 | this.tree.addTreeSelectionListener(e -> { |
71 | 72 | final DefaultMutableTreeNode node = (DefaultMutableTreeNode) this.tree.getLastSelectedPathComponent(); |
72 | 73 | if (Objects.nonNull(node) && node.isLeaf() && node.getUserObject() instanceof AzureSdkFeatureEntity) { |
73 | | - this.onSdkFeatureNodeSelected.accept((AzureSdkFeatureEntity) node.getUserObject()); |
| 74 | + selectFeature((AzureSdkFeatureEntity) node.getUserObject()); |
74 | 75 | } |
75 | 76 | }); |
76 | 77 | } |
77 | 78 |
|
| 79 | + @AzureOperation(name = "sdk|reference_book.select_feature", params = "feature.getName()", type = AzureOperation.Type.ACTION) |
| 80 | + private void selectFeature(final AzureSdkFeatureEntity feature) { |
| 81 | + this.onSdkFeatureNodeSelected.accept(feature); |
| 82 | + } |
| 83 | + |
78 | 84 | @Override |
79 | 85 | public void onDocumentChanged() { |
80 | 86 | this.filter.debounce(); |
81 | 87 | } |
82 | 88 |
|
| 89 | + @AzureOperation(name = "sdk|reference_book.search", params = "text", type = AzureOperation.Type.ACTION) |
83 | 90 | private void filter(final String text) { |
84 | 91 | final String[] filters = Arrays.stream(text.split("\\s+")).filter(StringUtils::isNoneBlank).map(String::toLowerCase).toArray(String[]::new); |
85 | 92 | this.loadData(this.services, filters); |
|
0 commit comments