UNPKG

@eclipse-glsp/theia-integration

Version:

Glue code to integrate GLSP clients into Eclipse Theia

58 lines 3.19 kB
"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 CopyPasteMenuContribution_1; Object.defineProperty(exports, "__esModule", { value: true }); exports.CopyPasteMenuContribution = void 0; exports.registerCopyPasteContextMenu = registerCopyPasteContextMenu; /******************************************************************************** * Copyright (c) 2020-2023 EclipseSource 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 client_1 = require("@eclipse-glsp/client"); const core_1 = require("@theia/core"); const browser_1 = require("@theia/core/lib/browser"); const inversify_1 = require("@theia/core/shared/inversify"); const theia_glsp_context_menu_service_1 = require("./theia-glsp-context-menu-service"); function registerCopyPasteContextMenu(context) { if (!context.isBound(CopyPasteMenuContribution)) { (0, client_1.bindAsService)(context, core_1.MenuContribution, CopyPasteMenuContribution); } } let CopyPasteMenuContribution = CopyPasteMenuContribution_1 = class CopyPasteMenuContribution { registerMenus(menus) { menus.registerMenuAction(CopyPasteMenuContribution_1.COPY_PASTE, { commandId: browser_1.CommonCommands.CUT.id, order: '0' }); menus.registerMenuAction(CopyPasteMenuContribution_1.COPY_PASTE, { commandId: browser_1.CommonCommands.COPY.id, order: '1' }); menus.registerMenuAction(CopyPasteMenuContribution_1.COPY_PASTE, { commandId: browser_1.CommonCommands.PASTE.id, order: '2' }); } }; exports.CopyPasteMenuContribution = CopyPasteMenuContribution; CopyPasteMenuContribution.COPY_PASTE = theia_glsp_context_menu_service_1.TheiaGLSPContextMenu.CONTEXT_MENU.concat('copy-paste'); exports.CopyPasteMenuContribution = CopyPasteMenuContribution = CopyPasteMenuContribution_1 = __decorate([ (0, inversify_1.injectable)() ], CopyPasteMenuContribution); //# sourceMappingURL=copy-paste-context-menu-contribution.js.map