@eclipse-glsp/theia-integration
Version:
Glue code to integrate GLSP clients into Eclipse Theia
57 lines • 3.59 kB
TypeScript
/********************************************************************************
* Copyright (c) 2018-2026 TypeFox and others.
* Modifications: (c) 2019-2024 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
********************************************************************************/
import { IDiagramOptions } from '@eclipse-glsp/client';
import { URI } from '@theia/core';
import { OpenWithHandler, OpenWithService, WidgetFactory, WidgetOpenerOptions, WidgetOpenHandler } from '@theia/core/lib/browser';
import { interfaces } from '@theia/core/shared/inversify';
import { EditorManager } from '@theia/editor/lib/browser';
import { DiagramServiceProvider } from '../diagram-service-provider';
import { TheiaOpenerOptionsNavigationService } from '../theia-opener-options-navigation-service';
import { DiagramConfiguration } from './glsp-diagram-configuration';
import { GLSPDiagramContextKeyService } from './glsp-diagram-context-key-service';
import { GLSPDiagramWidget, GLSPDiagramWidgetOptions } from './glsp-diagram-widget';
export declare function registerDiagramManager(bind: interfaces.Bind, diagramManagerServiceId: interfaces.ServiceIdentifier<GLSPDiagramManager>, bindToSelf?: boolean): void;
export declare abstract class GLSPDiagramManager extends WidgetOpenHandler<GLSPDiagramWidget> implements WidgetFactory, OpenWithHandler {
protected readonly diagramNavigationService: TheiaOpenerOptionsNavigationService;
protected readonly contextKeyService: GLSPDiagramContextKeyService;
protected readonly diagramServiceProvider: DiagramServiceProvider;
protected readonly editorManager: EditorManager;
protected openWithService: OpenWithService;
abstract get fileExtensions(): string[];
abstract get diagramType(): string;
abstract get contributionId(): string;
protected widgetCount: number;
protected registerOpenWithHandler: boolean;
protected init(): void;
doOpen(widget: GLSPDiagramWidget, uri: URI, maybeOptions?: WidgetOpenerOptions): Promise<void>;
protected attachWidget(widget: GLSPDiagramWidget, options?: WidgetOpenerOptions): void;
protected handleNavigations(widget: GLSPDiagramWidget, options?: WidgetOpenerOptions): boolean;
createWidget(options?: any): Promise<GLSPDiagramWidget>;
protected createDiagramOptions(options: GLSPDiagramWidgetOptions): IDiagramOptions;
protected createClientId(): string;
protected createWidgetOptions(uri: URI, options?: GLSPWidgetOpenerOptions): GLSPDiagramWidgetOptions;
protected getDiagramConfiguration(options: GLSPDiagramWidgetOptions): DiagramConfiguration;
canHandle(uri: URI, _options?: WidgetOpenerOptions | undefined): number;
get id(): string;
get iconClass(): string;
get providerName(): string | undefined;
}
export interface GLSPWidgetOpenerOptions extends WidgetOpenerOptions {
editMode?: string;
}
export declare function deriveDiagramManagerId(diagramType: string): string;
//# sourceMappingURL=glsp-diagram-manager.d.ts.map