File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
example/workflow/extension
packages/vscode-integration-webview/src Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 150
150
},
151
151
{
152
152
"command" : " workflow.goToPreviousNode" ,
153
- "group" : " " ,
153
+ "group" : " navigation " ,
154
154
"when" : " activeCustomEditorId == 'workflow.glspDiagram' && workflow.editorSelectedElementsAmount == 1"
155
155
},
156
156
{
Original file line number Diff line number Diff line change 18
18
import {
19
19
DiagramLoader ,
20
20
DiagramLoadingOptions ,
21
+ FocusStateChangedAction ,
21
22
IActionDispatcher ,
22
23
IDiagramOptions ,
23
24
ModelSource ,
24
25
TYPES ,
25
26
ViewerOptions
26
27
} from '@eclipse-glsp/client' ;
27
28
import { inject , injectable , postConstruct } from 'inversify' ;
28
-
29
29
export const GLSPDiagramWidgetFactory = Symbol ( 'GLSPDiagramWidgetFactory' ) ;
30
30
export type GLSPDiagramWidgetFactory = ( ) => GLSPDiagramWidget ;
31
31
@@ -71,6 +71,8 @@ export abstract class GLSPDiagramWidget {
71
71
this . containerDiv = containerDiv ;
72
72
containerDiv . addEventListener ( 'mouseenter' , e => this . handleMouseEnter ( e ) ) ;
73
73
containerDiv . addEventListener ( 'mouseleave' , e => this . handleMouseLeave ( e ) ) ;
74
+ window . addEventListener ( 'focus' , e => this . handleFocusChange ( e , true ) ) ;
75
+ window . addEventListener ( 'blur' , e => this . handleFocusChange ( e , false ) ) ;
74
76
}
75
77
}
76
78
@@ -84,6 +86,10 @@ export abstract class GLSPDiagramWidget {
84
86
this . containerDiv ?. classList . remove ( 'mouse-enter' ) ;
85
87
}
86
88
89
+ handleFocusChange ( e : FocusEvent , hasFocus : boolean ) : void {
90
+ this . actionDispatcher . dispatch ( FocusStateChangedAction . create ( hasFocus ) ) ;
91
+ }
92
+
87
93
protected createDiagramLoadingOptions ( ) : DiagramLoadingOptions | undefined {
88
94
return undefined ;
89
95
}
You can’t perform that action at this time.
0 commit comments