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

    A contract for widgets that want to store and restore their inner state, between sessions.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    Methods

    activate addClass addClipboardListener addEventListener addKeyListener addUpdateListener applyFontStyles children clearFlag close contains createContainerAttributes createNodeAttributes createNodeClassNames createNodeStyle decorateCaption decorateIcon decorateNodeStyle deflateForStorage disableScrollBarFocus dispose doFocus doHandleExpansionToggleDblClickEvent doRenderNodeRow doToggle doUpdateDecorations doUpdateRows findCommands fit getCaptionAttributes getCaptionChildren getContainerTreeNode getDecorationData getDecorations getDefaultNodeStyle getDepthForNode getDepthPadding getIconClass getLinkClassName getNodeToFocus getPaddingLeft getPreviewNode getScrollContainer getScrollToRow getVirtualizedScrollState handleAuxClickEvent handleClickEvent handleContextMenuEvent handleDblClickEvent handleDown handleDragEnd handleDragEnter handleDragLeave handleDragOver handleDragStartEvent handleDropEvent handleEnter handleEscape handleGlobalSelectionOnDisposal handleGlobalSelectionOnFocusIn handleGlobalSelectionOnFocusServiceFocusChange handleGlobalSelectionOnModelSelectionChange handleLeft handleMiddleClickEvent handleRight handleSpace handleUp handleViewWelcomeContentChange handleVisiblityChanged handleWelcomeContextChange hasClass hasCtrlCmdMask hasShiftMask hasTrailingSuffixes hide inflateFromStorage init isEnabledClick isExpandable isScrolledToBottom needsActiveIndentGuideline needsExpansionTogglePadding notifyLayout onActivateRequest onAfterAttach onAfterDetach onAfterHide onAfterShow onBeforeAttach onBeforeDetach onBeforeHide onBeforeShow onChildAdded onChildRemoved onCloseRequest onFitRequest onResize onUpdateRequest parseLinkedText processMessage refresh registerGlobalSelectionHandlers removeClass render renderButtonNode renderCaption renderCaptionAffixes renderCheckbox renderExpansionToggle renderIcon renderIndent renderInlineCommand renderLinkNode renderNode renderSearchInfo renderTailDecorations renderTailDecorationsForNode renderTextNode renderTree renderViewWelcome resolveKeybindingForCommand restoreState rowIsSelected scrollToSelected setFlag setHidden shouldDisplayNode shouldRenderIndent shouldShowWelcomeView shouldUpdateGlobalSelection show storeState tapNode testFlag toContextMenuArgs toggleChecked toggleClass toNodeDescription toNodeIcon toNodeName toNodeRow toReactNode toTreeViewItemReference tryExecuteCommand tryExecuteCommandMap update updateGlobalSelection updateScrollToRow updateViewWelcomeNodes

    Constructors

    Properties

    _contextSelection: boolean = false
    applicationShell: ApplicationShell
    colorRegistry: ColorRegistry
    commands: CommandRegistry
    contextKeys: ContextKeyService
    contextKeyService: ContextKeyService
    contextMenuRenderer: ContextMenuRenderer
    contextService: ContextKeyService
    corePreferences: CorePreferences
    decorations: Map<string, WidgetDecoration.Data[]>
    decoratorService: TreeDecoratorService
    defaultItem: undefined | IItem
    dndFileContentStore: DnDFileContentStore
    expansionTimeouts: Map<string, number> = ...
    focusService: TreeFocusService
    handleExpansionToggleDblClickEvent: (event: MouseEvent<HTMLElement>) => void

    Handle the double-click mouse event on the expansion toggle.

    hoverService: HoverService
    items: IItem[]
    keybindings: KeybindingRegistry
    labelParser: LabelParser
    labelProvider: LabelProvider
    lastScrollState: undefined | { scrollLeft: number; scrollTop: number }

    Store the last scroll state.

    Type Declaration

    • undefined
    • { scrollLeft: number; scrollTop: number }
      • scrollLeft: number

        The scroll left value.

      • scrollTop: number

        The scroll top value.

    node: HTMLElement

    Get the DOM node owned by the widget.

    nodeRoot: Root
    onDidChangeVisibility: Event<boolean>
    onDidChangeVisibilityEmitter: Emitter<boolean>
    onDidDispose: Event<void>
    onDidDisposeEmitter: Emitter<void>
    onScrollEmitter: Emitter<TreeScrollEvent>
    onScrollUp: Event<void>
    onScrollUpEmitter: Emitter<void>
    onScrollYReachEnd: Event<void>
    onScrollYReachEndEmitter: Emitter<void>
    openerService: OpenerService
    openLinkOrCommand: (event: MouseEvent, value: string) => void
    preferenceService: PreferenceService
    props: TreeProps
    renderNodeRow: (row: NodeRow) => ReactNode

    Render the node row.

    rows: Map<string, NodeRow>
    scheduleUpdateScrollToRow: any
    scrollArea: Element
    scrollBar?: PerfectScrollbar
    ScrollingRowRenderer: FC<{ rows: NodeRow[] }>
    scrollOptions?: Options
    scrollToRow: undefined | number

    Row index to ensure visibility.

    • Used to forcefully scroll if necessary.
    searchBox: SearchBox
    searchBoxFactory: SearchBoxFactory
    searchHighlights: Map<string, WidgetDecoration.CaptionHighlight>
    selectionService: SelectionService
    shouldScrollToRow: boolean
    toDisposeBeforeUpdateViewWelcomeNodes: DisposableCollection
    toDisposeOnDetach: DisposableCollection
    toggle: (event: MouseEvent<HTMLElement>) => void

    Toggle the node.

    treeDragType: string
    treeIndent: number
    treeSearch: TreeSearch
    updateDecorations: any

    Update tree decorations.

    • Updating decorations are debounced in order to limit the number of expensive updates.
    updateRows: any
    view: undefined | TreeWidget.View
    viewWelcomeNodes: ReactNode[]
    windowService: WindowService

    Accessors

    • get dataset(): DOMStringMap

      The dataset for the widget's DOM node.

      Returns DOMStringMap

    • get disposed(): ISignal<this, void>

      A signal emitted when the widget is disposed.

      Returns ISignal<this, void>

    • get hiddenMode(): HiddenMode

      Get the method for hiding the widget.

      Returns HiddenMode

    • set hiddenMode(value: HiddenMode): void

      Set the method for hiding the widget.

      Parameters

      Returns void

    • get id(): string

      Get the id of the widget's DOM node.

      Returns string

    • set id(value: string): void

      Set the id of the widget's DOM node.

      Parameters

      • value: string

      Returns void

    • get isAttached(): boolean

      Test whether the widget's node is attached to the DOM.

      Returns boolean

    • get isDisposed(): boolean

      Test whether the widget has been disposed.

      Returns boolean

    • get isHidden(): boolean

      Test whether the widget is explicitly hidden.

      Returns boolean

    • get isVisible(): boolean

      Test whether the widget is visible.

      A widget is visible when it is attached to the DOM, is not explicitly hidden, and has no explicitly hidden ancestors.

      Returns boolean

    • get layout(): null | Layout

      Get the layout for the widget.

      Returns null | Layout

    • set layout(value: null | Layout): void

      Set the layout for the widget.

      The layout is single-use only. It cannot be changed after the first assignment.

      The layout is disposed automatically when the widget is disposed.

      Parameters

      Returns void

    • get parent(): null | Widget

      Get the parent of the widget.

      Returns null | Widget

    • set parent(value: null | Widget): void

      Set the parent of the widget.

      Children are typically added to a widget by using a layout, which means user code will not normally set the parent widget directly.

      The widget will be automatically removed from its old parent.

      This is a no-op if there is no effective parent change.

      Parameters

      Returns void

    • get title(): Title<Widget>

      The title object for the widget.

      The title object is used by some container widgets when displaying the widget alongside some title, such as a tab panel or side bar.

      Since not all widgets will use the title, it is created on demand.

      The owner property of the title is set to this widget.

      Returns Title<Widget>

    • get visibleItems(): ViewWelcome[]

      Returns ViewWelcome[]

    Methods

    • Post an 'activate-request' message to the widget.

      This is a simple convenience method for posting the message.

      Returns void

    • Add a class name to the widget's DOM node.

      Parameters

      • name: string

        The class name to add to the node.

        If the class name is already added to the node, this is a no-op.

        The class name must not contain whitespace.

      Returns void

    • Type Parameters

      • K extends keyof HTMLElementEventMap

      Parameters

      • element: HTMLElement
      • type: K
      • OptionaluseCapture: boolean

      Returns void

    • Apply font styles to the tree.

      Parameters

      • original: CSSProperties

        the original css properties.

      • fontData: undefined | FontData

        the optional fontData.

      Returns CSSProperties

    • Create an iterator over the widget's children.

      Returns IterableIterator<Widget>

      A new iterator over the children of the widget.

      The widget must have a populated layout in order to have children.

      If a layout is not installed, the returned iterator will be empty.

    • Send a 'close-request' message to the widget.

      This is a simple convenience method for sending the message.

      Returns void

    • Test whether a widget is a descendant of this widget.

      Parameters

      • widget: Widget

        The descendant widget of interest.

      Returns boolean

      true if the widget is a descendant, false otherwise.

    • Decorate the tree caption.

      Parameters

      • node: TreeNode

        the tree node.

      • attrs: HTMLAttributes<HTMLElement>

        the additional attributes.

      Returns Attributes & HTMLAttributes<HTMLElement>

    • Decorate the tree node icon.

      Parameters

      • node: TreeNode

        the tree node.

      • icon: ReactNode

        the icon.

      Returns ReactNode

    • Decorate the node style.

      Parameters

      • node: TreeNode

        the tree node.

      • style: undefined | CSSProperties

        the optional CSS properties.

      Returns undefined | CSSProperties

      the CSS styles if available.

    • Parameters

      • scrollContainer: HTMLElement

      Returns void

    • Dispose of the widget and its descendant widgets.

      It is unsafe to use the widget after it has been disposed.

      All calls made to this method after the first are a no-op.

      Returns void

    • Actually focus the tree node.

      Returns void

    • Actually handle the double-click mouse event on the expansion toggle.

      Parameters

      • event: MouseEvent<HTMLElement>

        the double-click mouse event.

      Returns void

    • Actually render the node row.

      Parameters

      Returns ReactNode

    • Actually toggle the tree node.

      Parameters

      • event: MouseEvent<HTMLElement>

        the mouse click event.

      Returns void

    • Post a 'fit-request' message to the widget.

      This is a simple convenience method for posting the message.

      Returns void

    • Parameters

      • depth: number

      Returns number

    • Determine the classes to use for an icon

      • Assumes a Font Awesome name when passed a single string, otherwise uses the passed string array

      Parameters

      • iconName: string | string[]

        the icon name or list of icon names.

      • OptionaladditionalClasses: string[]

        additional CSS classes.

      Returns string

      the icon class name.

    • Parameters

      • href: string
      • enablement: undefined | string

      Returns string

    • Get the scrollToRow.

      Returns undefined | number

      the scrollToRow if available.

    • Handle the middle-click mouse event.

      Parameters

      • node: undefined | TreeNode

        the tree node if available.

      • event: MouseEvent<HTMLElement>

        the middle-click mouse event.

      Returns void

    • Handle the single-click mouse event.

      Parameters

      • node: undefined | TreeNode

        the tree node if available.

      • event: MouseEvent<HTMLElement>

        the mouse single-click event.

      Returns void

    • Handle the double-click mouse event.

      Parameters

      • node: undefined | TreeNode

        the tree node if available.

      • event: MouseEvent<HTMLElement>

        the double-click mouse event.

      Returns void

    • Handle the down arrow keyboard event.

      Parameters

      • event: KeyboardEvent

        the down arrow keyboard event.

      Returns void

    • Parameters

      • event: KeyboardEvent

      Returns void

    • Handle the left arrow keyboard event.

      Parameters

      • event: KeyboardEvent

        the left arrow keyboard event.

      Returns Promise<void>

    • Handle the middle-click mouse event.

      Parameters

      • event: MouseEvent

        the middle-click mouse event.

      Returns void

    • Handle the right arrow keyboard event.

      Parameters

      • event: KeyboardEvent

        the right arrow keyboard event.

      Returns Promise<void>

    • Handle the space key keyboard event.

      • If the element has a checkbox, it will be toggled.
      • Otherwise, it should be similar to a single-click action.

      Parameters

      • event: KeyboardEvent

        the space key keyboard event.

      Returns void

    • Handle the up arrow keyboard event.

      Parameters

      • event: KeyboardEvent

        the up arrow keyboard event.

      Returns void

    • Parameters

      • isNowVisible: boolean

      Returns void

    • Test whether the widget's DOM node has the given class name.

      Parameters

      • name: string

        The class name of interest.

      Returns boolean

      true if the node has the class, false otherwise.

    • Determine if the tree modifier aware event has a ctrlcmd mask.

      Parameters

      Returns boolean

      true if the tree modifier aware event contains the ctrlcmd mask.

    • Determine if the tree modifier aware event has a shift mask.

      Parameters

      Returns boolean

      true if the tree modifier aware event contains the shift mask.

    • Determine if the tree node contains trailing suffixes.

      Parameters

      Returns boolean

      true if the tree node contains trailing suffices.

    • Hide the widget and make it hidden to its parent widget.

      This causes the isHidden property to be true.

      If the widget is explicitly hidden, this is a no-op.

      Returns void

    • Parameters

      • enablement: undefined | string

      Returns boolean

    • Check if the tree is scrolled to the bottom. Works with both virtualized and non-virtualized trees.

      Returns boolean

    • If the node is a composite, a toggle will be rendered. Otherwise we need to add the width and the left, right padding => 18px

      Parameters

      Returns boolean

    • Invoke the message processing routine of the widget's layout.

      Parameters

      • msg: Message

        The message to dispatch to the layout.

        This is a no-op if the widget does not have a layout.

        This will not typically be called directly by user code.

      Returns void

    • A message handler invoked on an 'activate-request' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on an 'after-attach' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on an 'after-detach' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on an 'after-hide' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on an 'after-show' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on a 'before-attach' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on a 'before-detach' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on a 'before-hide' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on a 'before-show' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on a 'child-added' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on a 'child-removed' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on a 'close-request' message.

      The default implementation unparents or detaches the widget.

      Parameters

      Returns void

    • A message handler invoked on a 'fit-request' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on an 'update-request' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • Parameters

      • text: string

      Returns LinkedTextItem[]

    • Process a message sent to the widget.

      Parameters

      • msg: Message

        The message sent to the widget.

        Subclasses may reimplement this method as needed.

      Returns void

    • Remove a class name from the widget's DOM node.

      Parameters

      • name: string

        The class name to remove from the node.

        If the class name is not yet added to the node, this is a no-op.

        The class name must not contain whitespace.

      Returns void

    • Parameters

      • node: ILink
      • lineKey: string | number
      • enablement: undefined | string

      Returns ReactNode

    • Render caption affixes for the given tree node.

      Parameters

      • node: TreeNode

        the tree node.

      • props: NodeProps

        the node properties.

      • affixKey: "captionPrefixes" | "captionSuffixes"

        the affix key.

      Returns ReactNode

    • Parameters

      • node: ILink
      • linkKey: string | number
      • enablement: undefined | string

      Returns ReactNode

    • Parameters

      • node: string
      • textKey: string | number

      Returns ReactNode

    • Restore the state.

      Parameters

      • oldState: object

        the old state object.

      Returns void

    • Scroll to the selected tree node.

      Returns void

    • Show or hide the widget according to a boolean value.

      Parameters

      • hidden: boolean

        true to hide the widget, or false to show it.

        This is a convenience method for hide() and show().

      Returns void

    • Determines whether an indentation div should be rendered for the specified tree node. If there are multiple tree nodes inside of a single rendered row, this method should only return true for the first node.

      Parameters

      Returns boolean

    • Show the widget and make it visible to its parent widget.

      This causes the isHidden property to be false.

      If the widget is not explicitly hidden, this is a no-op.

      Returns void

    • Store the tree state.

      Returns object

    • Test whether the given widget flag is set.

      This will not typically be called directly by user code.

      Parameters

      Returns boolean

    • Parameters

      • event: MouseEvent<HTMLElement>

      Returns void

    • Toggle a class name on the widget's DOM node.

      Parameters

      • name: string

        The class name to toggle on the node.

      • Optionalforce: boolean

        Whether to force add the class (true) or force remove the class (false). If not provided, the presence of the class will be toggled from its current state.

      Returns boolean

      true if the class is now present, false otherwise.

      The class name must not contain whitespace.

    • Post an 'update-request' message to the widget.

      This is a simple convenience method for posting the message.

      Returns void