src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts/WhenColumnRenderer/renderTemplate
class WhenColumnRenderer:	renderTemplate(container: HTMLElement): IWhenColumnTemplateData {
		const element = DOM.append(container, $('.when'));

		const whenContainer = DOM.append(element, $('div.when-label'));
		const whenLabel = new HighlightedLabel(whenContainer);
		const whenInput = new InputBox(element, this.contextViewService, {
			validationOptions: {
				validation: (value) => {
					try {
						ContextKeyExpr.deserialize(value, true);
					} catch (error) {
						return {
							content: error.message,
							formatContent: true,
							type: MessageType.ERROR
						};
					}
					return null;
				}
			},
			ariaLabel: localize('whenContextInputAriaLabel', "Type when context. Press Enter to confirm or Escape to cancel.")
		});

		const disposables = new DisposableStore();
		disposables.add(attachInputBoxStyler(whenInput, this.themeService));

		const _onDidAccept: Emitter<void> = disposables.add(new Emitter<void>());
		const onDidAccept: Event<void> = _onDidAccept.event;

		const _onDidReject: Emitter<void> = disposables.add(new Emitter<void>());
		const onDidReject: Event<void> = _onDidReject.event;

		const hideInputBox = () => {
			element.classList.remove('input-mode');
			container.style.paddingLeft = '10px';
		};

		disposables.add(DOM.addStandardDisposableListener(whenInput.inputElement, DOM.EventType.KEY_DOWN, e => {
			let handled = false;
			if (e.equals(KeyCode.Enter)) {
				hideInputBox();
				_onDidAccept.fire();
				handled = true;
			} else if (e.equals(KeyCode.Escape)) {
				hideInputBox();
				_onDidReject.fire();
				handled = true;
			}
			if (handled) {
				e.preventDefault();
				e.stopPropagation();
			}
		}));
		disposables.add((DOM.addDisposableListener(whenInput.inputElement, DOM.EventType.FOCUS, () => {
			this.whenFocusContextKey.set(true);
		})));
		disposables.add((DOM.addDisposableListener(whenInput.inputElement, DOM.EventType.BLUR, () => {
			this.whenFocusContextKey.set(false);
			hideInputBox();
			_onDidReject.fire();
		})));

		const renderDisposables = disposables.add(new DisposableStore());

		return {
			element,
			whenContainer,
			whenLabel,
			whenInput,
			onDidAccept,
			onDidReject,
			renderDisposables,
			disposables,
		};
	}