import { inject } from 'inversify'; import { SingleTextInputDialog, SingleTextInputDialogProps } from '@gedit/application/lib/browser'; import { URI } from '@gedit/utils'; export class NavigatorInputDialogProps extends SingleTextInputDialogProps { parentUri: URI; } export class NavigatorInputDialog extends SingleTextInputDialog { constructor( @inject(NavigatorInputDialogProps) protected readonly props: NavigatorInputDialogProps, ) { super(props); this.appendParentPath(); } /** * Append the human-readable parent `path` to the dialog. * When possible, display the relative path, else display the full path (ex: workspace root). */ protected appendParentPath(): void { const element = document.createElement('div'); // Create the `folder` icon. const icon = document.createElement('i'); icon.classList.add('fa', 'fa-folder'); icon.style.marginRight = '0.5em'; element.appendChild(icon); element.appendChild(document.createTextNode(this.props.parentUri.displayName)); // Add the path and icon div before the `inputField`. this.contentNode.insertBefore(element, this.inputField); } }