()
| 114 | } |
| 115 | |
| 116 | private initializePanel(): void { |
| 117 | if (!this.panel) { |
| 118 | return; |
| 119 | } |
| 120 | this.panel.iconPath = new UriIcon('help'); |
| 121 | // virtual uris used to access local files |
| 122 | this.webviewScriptUri = this.panel.webview.asWebviewUri(this.webviewScriptFile); |
| 123 | this.webviewStyleUri = this.panel.webview.asWebviewUri(this.webviewStyleFile); |
| 124 | |
| 125 | // called e.g. when the webview panel is closed by the user |
| 126 | this.panel.onDidDispose(() => { |
| 127 | this.panel = undefined; |
| 128 | this.history = []; |
| 129 | this.forwardHistory = []; |
| 130 | this.currentEntry = undefined; |
| 131 | this.webviewScriptUri = undefined; |
| 132 | this.webviewStyleUri = undefined; |
| 133 | void this.setContextValues(); |
| 134 | }); |
| 135 | |
| 136 | // sent by javascript added to the help pages, e.g. when a link or mouse button is clicked |
| 137 | this.panel.webview.onDidReceiveMessage((e: OutMessage) => { |
| 138 | void this.handleMessage(e); |
| 139 | }); |
| 140 | |
| 141 | // set context variable to show forward/backward buttons |
| 142 | this.panel.onDidChangeViewState(() => { |
| 143 | void this.setContextValues(); |
| 144 | }); |
| 145 | } |
| 146 | |
| 147 | |
| 148 | public async setContextValues(): Promise<void> { |
no test coverage detected