"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.WorkflowDiagramModule = exports.WorkflowServerModule = void 0;
/********************************************************************************
 * Copyright (c) 2022-2023 STMicroelectronics and others.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * This Source Code may also be made available under the following Secondary
 * Licenses when the conditions for such availability set forth in the Eclipse
 * Public License v. 2.0 are satisfied: GNU General Public License, version 2
 * with the GNU Classpath Exception which is available at
 * https://www.gnu.org/software/classpath/license.html.
 *
 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
 ********************************************************************************/
const server_1 = require("@eclipse-glsp/server");
const inversify_1 = require("inversify");
const create_automated_task_handler_1 = require("./handler/create-automated-task-handler");
const create_category_handler_1 = require("./handler/create-category-handler");
const create_decision_node_handler_1 = require("./handler/create-decision-node-handler");
const create_edge_handler_1 = require("./handler/create-edge-handler");
const create_fork_node_handler_1 = require("./handler/create-fork-node-handler");
const create_join_node_handler_1 = require("./handler/create-join-node-handler");
const create_manual_task_handler_1 = require("./handler/create-manual-task-handler");
const create_merge_node_handler_1 = require("./handler/create-merge-node-handler");
const create_weighted_edge_handler_1 = require("./handler/create-weighted-edge-handler");
const workflow_label_edit_validator_1 = require("./labeledit/workflow-label-edit-validator");
const workflow_model_validator_1 = require("./marker/workflow-model-validator");
const workflow_navigation_target_resolver_1 = require("./model/workflow-navigation-target-resolver");
const next_node_navigation_target_provider_1 = require("./provider/next-node-navigation-target-provider");
const node_documentation_navigation_target_provider_1 = require("./provider/node-documentation-navigation-target-provider");
const previous_node_navigation_target_provider_1 = require("./provider/previous-node-navigation-target-provider");
const workflow_command_palette_action_provider_1 = require("./provider/workflow-command-palette-action-provider");
const workflow_context_menu_item_provider_1 = require("./provider/workflow-context-menu-item-provider");
const edit_task_operation_handler_1 = require("./taskedit/edit-task-operation-handler");
const task_edit_context_provider_1 = require("./taskedit/task-edit-context-provider");
const task_edit_validator_1 = require("./taskedit/task-edit-validator");
const workflow_diagram_configuration_1 = require("./workflow-diagram-configuration");
const workflow_glsp_server_1 = require("./workflow-glsp-server");
const workflow_popup_factory_1 = require("./workflow-popup-factory");
let WorkflowServerModule = class WorkflowServerModule extends server_1.ServerModule {
    bindGLSPServer() {
        return workflow_glsp_server_1.WorkflowGLSPServer;
    }
};
WorkflowServerModule = __decorate([
    (0, inversify_1.injectable)()
], WorkflowServerModule);
exports.WorkflowServerModule = WorkflowServerModule;
let WorkflowDiagramModule = class WorkflowDiagramModule extends server_1.GModelDiagramModule {
    constructor(bindSourceModelStorage) {
        super();
        this.bindSourceModelStorage = bindSourceModelStorage;
    }
    get diagramType() {
        return 'workflow-diagram';
    }
    configureOperationHandlers(binding) {
        super.configureOperationHandlers(binding);
        binding.add(create_automated_task_handler_1.CreateAutomatedTaskHandler);
        binding.add(create_manual_task_handler_1.CreateManualTaskHandler);
        binding.add(create_join_node_handler_1.CreateJoinNodeHandler);
        binding.add(create_fork_node_handler_1.CreateForkNodeHandler);
        binding.add(create_edge_handler_1.CreateEdgeHandler);
        binding.add(create_weighted_edge_handler_1.CreateWeightedEdgeHandler);
        binding.add(create_merge_node_handler_1.CreateMergeNodeHandler);
        binding.add(create_decision_node_handler_1.CreateDecisionNodeHandler);
        binding.add(create_category_handler_1.CreateCategoryHandler);
        binding.add(edit_task_operation_handler_1.EditTaskOperationHandler);
    }
    bindDiagramConfiguration() {
        return workflow_diagram_configuration_1.WorkflowDiagramConfiguration;
    }
    bindNavigationTargetResolver() {
        return workflow_navigation_target_resolver_1.WorkflowNavigationTargetResolver;
    }
    bindContextMenuItemProvider() {
        return workflow_context_menu_item_provider_1.WorkflowContextMenuItemProvider;
    }
    bindCommandPaletteActionProvider() {
        return workflow_command_palette_action_provider_1.WorkflowCommandPaletteActionProvider;
    }
    bindLabelEditValidator() {
        return workflow_label_edit_validator_1.WorkflowLabelEditValidator;
    }
    bindPopupModelFactory() {
        return workflow_popup_factory_1.WorkflowPopupFactory;
    }
    bindModelValidator() {
        return workflow_model_validator_1.WorkflowModelValidator;
    }
    configureNavigationTargetProviders(binding) {
        super.configureNavigationTargetProviders(binding);
        binding.add(next_node_navigation_target_provider_1.NextNodeNavigationTargetProvider);
        binding.add(previous_node_navigation_target_provider_1.PreviousNodeNavigationTargetProvider);
        binding.add(node_documentation_navigation_target_provider_1.NodeDocumentationNavigationTargetProvider);
    }
    configureContextActionProviders(binding) {
        super.configureContextActionProviders(binding);
        binding.add(task_edit_context_provider_1.TaskEditContextActionProvider);
    }
    configureContextEditValidators(binding) {
        super.configureContextEditValidators(binding);
        binding.add(task_edit_validator_1.TaskEditValidator);
    }
};
WorkflowDiagramModule = __decorate([
    (0, inversify_1.injectable)(),
    __metadata("design:paramtypes", [Function])
], WorkflowDiagramModule);
exports.WorkflowDiagramModule = WorkflowDiagramModule;
//# sourceMappingURL=workflow-diagram-module.js.map