@eclipse-glsp/client
Version:
A sprotty-based client for GLSP
74 lines • 4.18 kB
TypeScript
/********************************************************************************
* Copyright (c) 2020-2025 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 { Action, ClientMenuItem, GIssueSeverity, GModelElement, GModelRoot, IActionDispatcher, IActionHandler, IContextMenuItemProvider, KeyListener, Point } from '@eclipse-glsp/sprotty';
import { SelectionService } from '../../base/selection-service';
import { BoundsAwareModelElement, SelectableElement } from '../../utils/gmodel-util';
import { GIssueMarker } from './issue-marker';
export interface NavigateToMarkerAction extends Action {
kind: typeof NavigateToMarkerAction.KIND;
direction: MarkerNavigationDirection;
selectedElementIds?: string[];
severities: GIssueSeverity[];
}
export type MarkerNavigationDirection = 'next' | 'previous';
export declare namespace NavigateToMarkerAction {
const KIND = "navigateToMarker";
function is(object: any): object is NavigateToMarkerAction;
function create(options: {
direction?: MarkerNavigationDirection;
selectedElementIds?: string[];
severities?: GIssueSeverity[];
}): NavigateToMarkerAction;
}
export declare class GModelElementComparator {
compare(_one: GModelElement, _other: GModelElement): number;
}
/** Specifies the order of two selectable and bounds-aware elements left-to-right and top-to-bottom. */
export declare class LeftToRightTopToBottomComparator {
compare(one: GModelElement, other: GModelElement): number;
}
/**
* Specifies the next/previous marker in a graph model.
*
* This navigator uses a `MarkerComparator` to determine the order of markers. It can also return next/previous
*/
export declare class MarkerNavigator {
static readonly ALL_SEVERITIES: GIssueSeverity[];
protected markerComparator: GModelElementComparator;
next(root: Readonly<GModelRoot>, current?: BoundsAwareModelElement, predicate?: (marker: GIssueMarker) => boolean): GIssueMarker | undefined;
previous(root: Readonly<GModelRoot>, current?: BoundsAwareModelElement, predicate?: (marker: GIssueMarker) => boolean): GIssueMarker | undefined;
protected getMarkers(root: Readonly<GModelRoot>, predicate: (marker: GIssueMarker) => boolean): GIssueMarker[];
protected getNextIndex(current: BoundsAwareModelElement, markers: GIssueMarker[]): number;
protected getPreviousIndex(current: BoundsAwareModelElement, markers: GIssueMarker[]): number;
}
export declare class NavigateToMarkerActionHandler implements IActionHandler {
protected markerComparator: GModelElementComparator;
protected markerNavigator: MarkerNavigator;
protected selectionService: SelectionService;
protected actionDispatcher: IActionDispatcher;
handle(action: NavigateToMarkerAction): void;
protected getSelectedElements(action: NavigateToMarkerAction): SelectableElement[];
protected getTarget(action: NavigateToMarkerAction, selected: GModelElement[]): GIssueMarker | undefined;
protected matchesSeverities(action: NavigateToMarkerAction, marker: GIssueMarker): boolean;
}
export declare class MarkerNavigatorContextMenuItemProvider implements IContextMenuItemProvider {
protected selectionService: SelectionService;
getItems(root: Readonly<GModelRoot>, lastMousePosition?: Point): Promise<ClientMenuItem[]>;
}
export declare class MarkerNavigatorKeyListener extends KeyListener {
keyDown(_element: GModelElement, event: KeyboardEvent): Action[];
}
//# sourceMappingURL=marker-navigator.d.ts.map