@eclipse-glsp/client
Version:
A sprotty-based client for GLSP
52 lines • 2.85 kB
TypeScript
/********************************************************************************
* Copyright (c) 2023-2025 Business Informatics Group (TU Wien) 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 { Action, Bounds, DOMHelper, GModelElement, GModelRoot, IActionDispatcher, IActionHandler, ICommand, MoveViewportAction, Point, Viewport } from '@eclipse-glsp/sprotty';
import { EditorContextService } from '../../base/editor-context-service';
import { FocusTracker } from '../../base/focus/focus-tracker';
import { IDiagramStartup } from '../../base/model/diagram-loader';
import { SelectableBoundsAware } from '../../utils/gmodel-util';
import { ZoomAction } from './zoom-viewport-action';
/**
* Focuses the graph on different actions.
*/
export declare class RestoreViewportHandler implements IActionHandler, IDiagramStartup {
protected domHelper: DOMHelper;
protected focusTracker: FocusTracker;
protected editorContext: EditorContextService;
handle(action: Action): void | Action;
get graphSelector(): string;
postRequestModel(): Promise<void>;
protected focusGraph(): void;
protected waitForElement(selector: string): Promise<Element | null>;
}
/**
* Handles moving the viewport.
*/
export declare class MoveViewportHandler implements IActionHandler {
protected readonly editorContextService: EditorContextService;
handle(action: MoveViewportAction): void | Action | ICommand;
protected handleMoveViewport(action: MoveViewportAction): Action | undefined;
}
export declare class ZoomHandler implements IActionHandler {
protected readonly editorContextService: EditorContextService;
protected readonly actionDispatcher: IActionDispatcher;
handle(action: ZoomAction): Action | void;
protected handleZoomViewport(zoomFactor: number): Action | undefined;
protected handleZoomElement(elementIds: string[], zoomFactor: number): Action | undefined;
protected getCenter(viewport: GModelRoot & Viewport, selectedElements: SelectableBoundsAware[]): Point;
protected boundsInViewport(viewport: GModelRoot & Viewport, element: GModelElement, bounds: Bounds): Bounds;
}
//# sourceMappingURL=viewport-handler.d.ts.map