Search in sources :

Example 1 with FunctionAppCreationDialog

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

the class CreateFunctionAppAction method openDialog.

@AzureOperation(name = "function.open_creation_dialog", type = AzureOperation.Type.ACTION)
private void openDialog(final Project project, @Nullable final FunctionAppConfig data) {
    final FunctionAppCreationDialog dialog = new FunctionAppCreationDialog(project);
    if (Objects.nonNull(data)) {
        dialog.setData(data);
    }
    dialog.setOkActionListener((config) -> {
        dialog.close();
        this.createFunctionApp(config).subscribe(functionApp -> {
        }, (error) -> {
            final String title = String.format("Reopen dialog \"%s\"", dialog.getTitle());
            final Consumer<Object> act = t -> AzureTaskManager.getInstance().runLater("open dialog", () -> this.openDialog(project, config));
            final Action<?> action = new Action<>(act, new ActionView.Builder(title));
            AzureMessager.getMessager().error(error, null, action);
        });
    });
    dialog.show();
}
Also used : FunctionAppCreationDialog(com.microsoft.azure.toolkit.intellij.function.FunctionAppCreationDialog) AzureOperation(com.microsoft.azure.toolkit.lib.common.operation.AzureOperation) AzureBundle.message(com.microsoft.intellij.ui.messages.AzureBundle.message) AzureUIRefreshCore(com.microsoft.azuretools.utils.AzureUIRefreshCore) IntellijAzureMessager(com.microsoft.azure.toolkit.intellij.common.messager.IntellijAzureMessager) AzureTask(com.microsoft.azure.toolkit.lib.common.task.AzureTask) Single(rx.Single) AzureOperationBundle.title(com.microsoft.azure.toolkit.lib.common.operation.AzureOperationBundle.title) Project(com.intellij.openapi.project.Project) AzureString(com.microsoft.azure.toolkit.lib.common.bundle.AzureString) FunctionAppService(com.microsoft.azure.toolkit.lib.function.FunctionAppService) ProgressManager(com.intellij.openapi.progress.ProgressManager) AzureActionEnum(com.microsoft.tooling.msservices.serviceexplorer.AzureActionEnum) NodeActionListener(com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener) AzureMessager(com.microsoft.azure.toolkit.lib.common.messager.AzureMessager) Nullable(com.microsoft.azuretools.azurecommons.helpers.Nullable) IAzureMessage(com.microsoft.azure.toolkit.lib.common.messager.IAzureMessage) AzureUIRefreshEvent(com.microsoft.azuretools.utils.AzureUIRefreshEvent) Operation(com.microsoft.azuretools.telemetrywrapper.Operation) AzureSignInAction(com.microsoft.intellij.actions.AzureSignInAction) Name(com.microsoft.tooling.msservices.helpers.Name) FunctionAppConfig(com.microsoft.azure.toolkit.lib.function.FunctionAppConfig) AzureTelemetry(com.microsoft.azure.toolkit.lib.common.telemetry.AzureTelemetry) Objects(java.util.Objects) Consumer(java.util.function.Consumer) ProgressIndicator(com.intellij.openapi.progress.ProgressIndicator) FunctionModule(com.microsoft.tooling.msservices.serviceexplorer.azure.function.FunctionModule) ActionView(com.microsoft.azure.toolkit.lib.common.action.ActionView) TelemetryConstants(com.microsoft.azuretools.telemetry.TelemetryConstants) IFunctionApp(com.microsoft.azure.toolkit.lib.appservice.service.IFunctionApp) Action(com.microsoft.azure.toolkit.lib.common.action.Action) TelemetryManager(com.microsoft.azuretools.telemetrywrapper.TelemetryManager) NodeActionEvent(com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent) AzureTaskManager(com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager) AzureSignInAction(com.microsoft.intellij.actions.AzureSignInAction) Action(com.microsoft.azure.toolkit.lib.common.action.Action) ActionView(com.microsoft.azure.toolkit.lib.common.action.ActionView) AzureString(com.microsoft.azure.toolkit.lib.common.bundle.AzureString) FunctionAppCreationDialog(com.microsoft.azure.toolkit.intellij.function.FunctionAppCreationDialog) AzureOperation(com.microsoft.azure.toolkit.lib.common.operation.AzureOperation)

Aggregations

ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 ProgressManager (com.intellij.openapi.progress.ProgressManager)1 Project (com.intellij.openapi.project.Project)1 IntellijAzureMessager (com.microsoft.azure.toolkit.intellij.common.messager.IntellijAzureMessager)1 FunctionAppCreationDialog (com.microsoft.azure.toolkit.intellij.function.FunctionAppCreationDialog)1 IFunctionApp (com.microsoft.azure.toolkit.lib.appservice.service.IFunctionApp)1 Action (com.microsoft.azure.toolkit.lib.common.action.Action)1 ActionView (com.microsoft.azure.toolkit.lib.common.action.ActionView)1 AzureString (com.microsoft.azure.toolkit.lib.common.bundle.AzureString)1 AzureMessager (com.microsoft.azure.toolkit.lib.common.messager.AzureMessager)1 IAzureMessage (com.microsoft.azure.toolkit.lib.common.messager.IAzureMessage)1 AzureOperation (com.microsoft.azure.toolkit.lib.common.operation.AzureOperation)1 AzureOperationBundle.title (com.microsoft.azure.toolkit.lib.common.operation.AzureOperationBundle.title)1 AzureTask (com.microsoft.azure.toolkit.lib.common.task.AzureTask)1 AzureTaskManager (com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager)1 AzureTelemetry (com.microsoft.azure.toolkit.lib.common.telemetry.AzureTelemetry)1 FunctionAppConfig (com.microsoft.azure.toolkit.lib.function.FunctionAppConfig)1 FunctionAppService (com.microsoft.azure.toolkit.lib.function.FunctionAppService)1 Nullable (com.microsoft.azuretools.azurecommons.helpers.Nullable)1 TelemetryConstants (com.microsoft.azuretools.telemetry.TelemetryConstants)1