Theia API Documentation v1.68.0
    Preparing search index...

    Interface InputBox

    A concrete QuickInput to let the user input a text value.

    Note that in many cases the more convenient window.showInputBox is easier to use. window.createInputBox should be used when window.showInputBox does not offer the required flexibility.

    interface InputBox {
        busy: boolean;
        buttons: readonly QuickInputButton[];
        enabled: boolean;
        ignoreFocusOut: boolean;
        onDidAccept: Event<void>;
        onDidChangeValue: Event<string>;
        onDidHide: Event<void>;
        onDidTriggerButton: Event<QuickInputButton>;
        password: boolean;
        placeholder: undefined | string;
        prompt: undefined | string;
        step: undefined | number;
        title: undefined | string;
        totalSteps: undefined | number;
        validationMessage: undefined | string | InputBoxValidationMessage;
        value: string;
        valueSelection: undefined | readonly [number, number];
        dispose(): void;
        hide(): void;
        show(): void;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    busy: boolean

    Determines if the UI should show a progress indicator. Defaults to false.

    Change this to true, for example, while loading more data or validating user input.

    buttons: readonly QuickInputButton[]

    Buttons for actions in the UI.

    enabled: boolean

    Determines if the UI should allow for user input. Defaults to true.

    Change this to false, for example, while validating user input or loading data for the next step in user input.

    ignoreFocusOut: boolean

    Determines if the UI should stay open even when losing UI focus. Defaults to false. This setting is ignored on iPad and is always false.

    onDidAccept: Event<void>

    An event signaling when the user indicated acceptance of the input value.

    onDidChangeValue: Event<string>

    An event signaling when the value has changed.

    onDidHide: Event<void>

    An event signaling when this input UI is hidden.

    There are several reasons why this UI might have to be hidden and the extension will be notified through onDidHide. Examples include: an explicit call to hide, the user pressing Esc, some other input UI opening, etc.

    onDidTriggerButton: Event<QuickInputButton>

    An event signaling when a button was triggered.

    password: boolean

    Determines if the input value should be hidden. Defaults to false.

    placeholder: undefined | string

    Optional placeholder text shown when no value has been input.

    prompt: undefined | string

    An optional prompt text providing some ask or explanation to the user.

    step: undefined | number

    An optional current step count for multi-step input flows.

    title: undefined | string

    An optional title for the input UI.

    totalSteps: undefined | number

    An optional total step count for multi-step input flows.

    validationMessage: undefined | string | InputBoxValidationMessage

    An optional validation message indicating a problem with the current input value.

    By setting a string, the InputBox will use a default InputBoxValidationSeverity of Error. Returning undefined clears the validation message.

    value: string

    The current input value.

    valueSelection: undefined | readonly [number, number]

    Selection range in the input value.

    Defined as tuple of two numbers where the first is the inclusive start index and the second the exclusive end index. When undefined the whole pre-filled value will be selected, when empty (start equals end) only the cursor will be set, otherwise the defined range will be selected.

    This property does not get updated when the user types or makes a selection, but it can be updated by the extension.

    Methods

    • Dispose of this input UI and any associated resources.

      If it is still visible, it is first hidden. After this call the input UI is no longer functional and no additional methods or properties on it should be accessed. Instead a new input UI should be created.

      Returns void