Search in sources :

Example 1 with ConnectorDialog

use of com.microsoft.azure.toolkit.intellij.connector.ConnectorDialog in project azure-tools-for-java by Microsoft.

the class ConnectToSQLAction method actionPerformed.

@Override
public void actionPerformed(NodeActionEvent e) {
    final ConnectorDialog dialog = new ConnectorDialog(project);
    final SqlServer server = this.node.getServer();
    final Database database = new Database(server.id(), null);
    final DatabaseResource resource = new DatabaseResource(database, DatabaseResource.Definition.SQL_SERVER);
    dialog.setResource(resource);
    dialog.show();
}
Also used : ConnectorDialog(com.microsoft.azure.toolkit.intellij.connector.ConnectorDialog) SqlServer(com.microsoft.azure.toolkit.lib.sqlserver.SqlServer)

Example 2 with ConnectorDialog

use of com.microsoft.azure.toolkit.intellij.connector.ConnectorDialog in project azure-tools-for-java by Microsoft.

the class ConnectToMySQLAction method actionPerformed.

@Override
public void actionPerformed(NodeActionEvent e) {
    AzureSignInAction.requireSignedIn(project, () -> {
        final ConnectorDialog dialog = new ConnectorDialog(project);
        final MySqlServer server = this.node.getServer();
        final Database database = new Database(server.id(), null);
        final DatabaseResource resource = new DatabaseResource(database, DatabaseResource.Definition.AZURE_MYSQL);
        dialog.setResource(resource);
        dialog.show();
    });
}
Also used : ConnectorDialog(com.microsoft.azure.toolkit.intellij.connector.ConnectorDialog) MySqlServer(com.microsoft.azure.toolkit.lib.mysql.MySqlServer)

Example 3 with ConnectorDialog

use of com.microsoft.azure.toolkit.intellij.connector.ConnectorDialog 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

ConnectorDialog (com.microsoft.azure.toolkit.intellij.connector.ConnectorDialog)3 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 StorageAccountResourceDefinition (com.microsoft.azure.toolkit.intellij.storage.connection.StorageAccountResourceDefinition)1 CreateStorageAccountAction (com.microsoft.azure.toolkit.intellij.storage.creation.CreateStorageAccountAction)1 AzureActionManager (com.microsoft.azure.toolkit.lib.common.action.AzureActionManager)1 IAzureResource (com.microsoft.azure.toolkit.lib.common.entity.IAzureResource)1 AzureTaskManager (com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager)1 MySqlServer (com.microsoft.azure.toolkit.lib.mysql.MySqlServer)1 SqlServer (com.microsoft.azure.toolkit.lib.sqlserver.SqlServer)1 AzureStorageAccount (com.microsoft.azure.toolkit.lib.storage.service.AzureStorageAccount)1 StorageAccount (com.microsoft.azure.toolkit.lib.storage.service.StorageAccount)1 BiConsumer (java.util.function.BiConsumer)1 BiPredicate (java.util.function.BiPredicate)1