sprotty-theia
Version:
Glue code for Sprotty diagrams in a Theia IDE
50 lines • 2.56 kB
TypeScript
/********************************************************************************
* Copyright (c) 2017-2018 TypeFox 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 { ActionHandlerRegistry, DiagramServerProxy, ExportSvgAction, ICommand, ServerStatusAction } from 'sprotty';
import { Action, ActionMessage, RequestPopupModelAction, SModelElement, SModelRoot } from 'sprotty-protocol';
import { TheiaSprottyConnector } from './theia-sprotty-connector';
export declare const IRootPopupModelProvider: unique symbol;
export interface IRootPopupModelProvider {
getPopupModel(action: RequestPopupModelAction, rootElement: SModelRoot): Promise<SModelElement | undefined>;
}
/**
* A sprotty DiagramServer that integrates with the Theia workbench.
*
* This class is the sprotty side of the Theia/sprotty integration. It
* is instantiated with the DI container of the sprotty diagram. Theia
* services are available via the TheiaDiagramServerConnector.
*/
export declare abstract class TheiaDiagramServer extends DiagramServerProxy {
protected _sourceUri: string;
protected _connector: TheiaSprottyConnector | undefined;
protected rootPopupModelProvider: IRootPopupModelProvider;
connect(connector: TheiaSprottyConnector): void;
disconnect(): void;
get connector(): TheiaSprottyConnector;
get sourceUri(): string;
initialize(registry: ActionHandlerRegistry): void;
handle(action: Action): void | ICommand | Action;
handleLocally(action: Action): boolean;
handleExportSvgAction(action: ExportSvgAction): boolean;
handleRequestPopupModel(action: RequestPopupModelAction): boolean;
protected handleServerStateAction(status: ServerStatusAction): boolean;
sendMessage(message: ActionMessage): void;
/**
* made public
*/
messageReceived(message: ActionMessage): void;
}
//# sourceMappingURL=theia-diagram-server.d.ts.map