use of com.microsoft.azure.toolkit.intellij.connector.AzureServiceResource in project azure-tools-for-java by Microsoft.
the class IntellijStorageActionsContributor method registerHandlers.
@Override
public void registerHandlers(AzureActionManager am) {
final BiPredicate<Object, AnActionEvent> condition = (r, e) -> r instanceof AzureStorageAccount;
final BiConsumer<Object, AnActionEvent> handler = (c, e) -> CreateStorageAccountAction.createStorageAccount((e.getProject()));
am.registerHandler(ResourceCommonActionsContributor.CREATE, condition, handler);
am.<IAzureResource<?>, AnActionEvent>registerHandler(ResourceCommonActionsContributor.CONNECT, (r, e) -> r instanceof StorageAccount, (r, e) -> AzureTaskManager.getInstance().runLater(() -> {
final ConnectorDialog dialog = new ConnectorDialog(e.getProject());
dialog.setResource(new AzureServiceResource<>(((StorageAccount) r), StorageAccountResourceDefinition.INSTANCE));
dialog.show();
}));
}
Aggregations