|
3 | 3 | * Licensed under the MIT License. See License.txt in the project root for license information. |
4 | 4 | *--------------------------------------------------------------------------------------------*/ |
5 | 5 |
|
6 | | -import * as nls from 'vs/nls'; |
7 | 6 | import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; |
8 | 7 | import { IThemeService } from 'vs/platform/theme/common/themeService'; |
9 | 8 | import { BaseWebviewEditor } from 'vs/workbench/browser/parts/editor/webviewEditor'; |
10 | 9 | import { IStorageService } from 'vs/platform/storage/common/storage'; |
11 | 10 |
|
12 | | -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; |
13 | | -import { Command, ICommandOptions } from 'vs/editor/browser/editorExtensions'; |
14 | | -import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; |
15 | 11 | import { IContextKey, RawContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; |
16 | 12 |
|
17 | 13 | import { Webview } from './webview'; |
18 | 14 | import { Builder } from 'vs/base/browser/builder'; |
19 | | -import { Action } from 'vs/base/common/actions'; |
20 | | -import { TPromise } from 'vs/base/common/winjs.base'; |
21 | 15 |
|
22 | 16 | /** A context key that is set when a webview editor has focus. */ |
23 | 17 | export const KEYBINDING_CONTEXT_WEBVIEWEDITOR_FOCUS = new RawContextKey<boolean>('webviewEditorFocus', false); |
@@ -93,73 +87,3 @@ export abstract class WebviewEditor extends BaseWebviewEditor { |
93 | 87 | protected abstract createEditor(parent: Builder): void; |
94 | 88 | } |
95 | 89 |
|
96 | | -export class ShowWebViewEditorFindWidgetAction extends Action { |
97 | | - public static readonly ID = 'editor.action.webvieweditor.showFind'; |
98 | | - public static readonly LABEL = nls.localize('editor.action.webvieweditor.showFind', "Focus Find Widget"); |
99 | | - |
100 | | - public constructor( |
101 | | - id: string, |
102 | | - label: string, |
103 | | - @IWorkbenchEditorService private workbenchEditorService: IWorkbenchEditorService |
104 | | - ) { |
105 | | - super(id, label); |
106 | | - } |
107 | | - |
108 | | - public run(): TPromise<any> { |
109 | | - const webViewEditor = this.getWebViewEditor(); |
110 | | - if (webViewEditor) { |
111 | | - webViewEditor.showFind(); |
112 | | - } |
113 | | - return null; |
114 | | - } |
115 | | - |
116 | | - private getWebViewEditor(): WebviewEditor { |
117 | | - const activeEditor = this.workbenchEditorService.getActiveEditor() as WebviewEditor; |
118 | | - if (activeEditor.isWebviewEditor) { |
119 | | - return activeEditor; |
120 | | - } |
121 | | - return null; |
122 | | - } |
123 | | -} |
124 | | - |
125 | | -export class HideWebViewEditorFindCommand extends Command { |
126 | | - public runCommand(accessor: ServicesAccessor, args: any): void { |
127 | | - const webViewEditor = this.getWebViewEditor(accessor); |
128 | | - if (webViewEditor) { |
129 | | - webViewEditor.hideFind(); |
130 | | - } |
131 | | - } |
132 | | - |
133 | | - private getWebViewEditor(accessor: ServicesAccessor): WebviewEditor { |
134 | | - const activeEditor = accessor.get(IWorkbenchEditorService).getActiveEditor() as WebviewEditor; |
135 | | - if (activeEditor.isWebviewEditor) { |
136 | | - return activeEditor; |
137 | | - } |
138 | | - return null; |
139 | | - } |
140 | | -} |
141 | | - |
142 | | -export class ShowWebViewEditorFindTermCommand extends Command { |
143 | | - constructor(opts: ICommandOptions, private _next: boolean) { |
144 | | - super(opts); |
145 | | - } |
146 | | - |
147 | | - public runCommand(accessor: ServicesAccessor, args: any): void { |
148 | | - const webViewEditor = this.getWebViewEditor(accessor); |
149 | | - if (webViewEditor) { |
150 | | - if (this._next) { |
151 | | - webViewEditor.showNextFindTerm(); |
152 | | - } else { |
153 | | - webViewEditor.showPreviousFindTerm(); |
154 | | - } |
155 | | - } |
156 | | - } |
157 | | - |
158 | | - private getWebViewEditor(accessor: ServicesAccessor): WebviewEditor { |
159 | | - const activeEditor = accessor.get(IWorkbenchEditorService).getActiveEditor() as WebviewEditor; |
160 | | - if (activeEditor.isWebviewEditor) { |
161 | | - return activeEditor; |
162 | | - } |
163 | | - return null; |
164 | | - } |
165 | | -} |
0 commit comments