Search in sources :

Example 1 with AzureStorageAccount

use of com.microsoft.azure.toolkit.lib.storage.service.AzureStorageAccount in project azure-tools-for-java by Microsoft.

the class StorageExplorerContributor method getModuleNode.

@Override
public Node<?> getModuleNode() {
    final AzureActionManager am = AzureActionManager.getInstance();
    final IAzureMessager messager = AzureMessager.getDefaultMessager();
    final AzureStorageAccount service = az(AzureStorageAccount.class);
    return new Node<>(service).view(new AzureServiceLabelView<>(service, NAME, ICON)).actions(StorageActionsContributor.SERVICE_ACTIONS).addChildren(AzureStorageAccount::list, (account, storageNode) -> new Node<>(account).view(new AzureResourceLabelView<>(account)).actions(StorageActionsContributor.ACCOUNT_ACTIONS));
}
Also used : IAzureMessager(com.microsoft.azure.toolkit.lib.common.messager.IAzureMessager) AzureStorageAccount(com.microsoft.azure.toolkit.lib.storage.service.AzureStorageAccount) AzureActionManager(com.microsoft.azure.toolkit.lib.common.action.AzureActionManager)

Example 2 with AzureStorageAccount

use of com.microsoft.azure.toolkit.lib.storage.service.AzureStorageAccount 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();
    }));
}
Also used : AzureActionManager(com.microsoft.azure.toolkit.lib.common.action.AzureActionManager) AzureServiceResource(com.microsoft.azure.toolkit.intellij.connector.AzureServiceResource) CreateStorageAccountAction(com.microsoft.azure.toolkit.intellij.storage.creation.CreateStorageAccountAction) AzureStorageAccount(com.microsoft.azure.toolkit.lib.storage.service.AzureStorageAccount) StorageAccountResourceDefinition(com.microsoft.azure.toolkit.intellij.storage.connection.StorageAccountResourceDefinition) BiPredicate(java.util.function.BiPredicate) IActionsContributor(com.microsoft.azure.toolkit.ide.common.IActionsContributor) ResourceCommonActionsContributor(com.microsoft.azure.toolkit.ide.common.action.ResourceCommonActionsContributor) StorageAccount(com.microsoft.azure.toolkit.lib.storage.service.StorageAccount) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) BiConsumer(java.util.function.BiConsumer) ConnectorDialog(com.microsoft.azure.toolkit.intellij.connector.ConnectorDialog) IAzureResource(com.microsoft.azure.toolkit.lib.common.entity.IAzureResource) AzureTaskManager(com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager) ConnectorDialog(com.microsoft.azure.toolkit.intellij.connector.ConnectorDialog) AzureStorageAccount(com.microsoft.azure.toolkit.lib.storage.service.AzureStorageAccount) AzureServiceResource(com.microsoft.azure.toolkit.intellij.connector.AzureServiceResource) AzureStorageAccount(com.microsoft.azure.toolkit.lib.storage.service.AzureStorageAccount) StorageAccount(com.microsoft.azure.toolkit.lib.storage.service.StorageAccount) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) IAzureResource(com.microsoft.azure.toolkit.lib.common.entity.IAzureResource)

Aggregations

AzureActionManager (com.microsoft.azure.toolkit.lib.common.action.AzureActionManager)2 AzureStorageAccount (com.microsoft.azure.toolkit.lib.storage.service.AzureStorageAccount)2 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1 IActionsContributor (com.microsoft.azure.toolkit.ide.common.IActionsContributor)1 ResourceCommonActionsContributor (com.microsoft.azure.toolkit.ide.common.action.ResourceCommonActionsContributor)1 AzureServiceResource (com.microsoft.azure.toolkit.intellij.connector.AzureServiceResource)1 ConnectorDialog (com.microsoft.azure.toolkit.intellij.connector.ConnectorDialog)1 StorageAccountResourceDefinition (com.microsoft.azure.toolkit.intellij.storage.connection.StorageAccountResourceDefinition)1 CreateStorageAccountAction (com.microsoft.azure.toolkit.intellij.storage.creation.CreateStorageAccountAction)1 IAzureResource (com.microsoft.azure.toolkit.lib.common.entity.IAzureResource)1 IAzureMessager (com.microsoft.azure.toolkit.lib.common.messager.IAzureMessager)1 AzureTaskManager (com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager)1 StorageAccount (com.microsoft.azure.toolkit.lib.storage.service.StorageAccount)1 BiConsumer (java.util.function.BiConsumer)1 BiPredicate (java.util.function.BiPredicate)1