parent
1410d77f6f
commit
a3261eae42
|
@ -947,7 +947,7 @@ interface IAbstractFindControllerOptions extends IFindWidgetOptions {
|
||||||
showNotFoundMessage?: boolean;
|
showNotFoundMessage?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IFindControllerOptions extends IAbstractFindControllerOptions {
|
export interface IFindControllerOptions extends IAbstractFindControllerOptions {
|
||||||
defaultFindMode?: TreeFindMode;
|
defaultFindMode?: TreeFindMode;
|
||||||
defaultFindMatchType?: TreeFindMatchType;
|
defaultFindMatchType?: TreeFindMatchType;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { IDragAndDropData } from '../../dnd.js';
|
||||||
import { IIdentityProvider, IKeyboardNavigationLabelProvider, IListDragAndDrop, IListDragOverReaction, IListVirtualDelegate } from '../list/list.js';
|
import { IIdentityProvider, IKeyboardNavigationLabelProvider, IListDragAndDrop, IListDragOverReaction, IListVirtualDelegate } from '../list/list.js';
|
||||||
import { ElementsDragAndDropData, ListViewTargetSector } from '../list/listView.js';
|
import { ElementsDragAndDropData, ListViewTargetSector } from '../list/listView.js';
|
||||||
import { IListStyles } from '../list/listWidget.js';
|
import { IListStyles } from '../list/listWidget.js';
|
||||||
import { ComposedTreeDelegate, TreeFindMode as TreeFindMode, IAbstractTreeOptions, IAbstractTreeOptionsUpdate, TreeFindMatchType, AbstractTreePart, LabelFuzzyScore, FindFilter, FindController, ITreeFindToggleChangeEvent } from './abstractTree.js';
|
import { ComposedTreeDelegate, TreeFindMode as TreeFindMode, IAbstractTreeOptions, IAbstractTreeOptionsUpdate, TreeFindMatchType, AbstractTreePart, LabelFuzzyScore, FindFilter, FindController, ITreeFindToggleChangeEvent, IFindControllerOptions } from './abstractTree.js';
|
||||||
import { ICompressedTreeElement, ICompressedTreeNode } from './compressedObjectTreeModel.js';
|
import { ICompressedTreeElement, ICompressedTreeNode } from './compressedObjectTreeModel.js';
|
||||||
import { getVisibleState, isFilterResult } from './indexTreeModel.js';
|
import { getVisibleState, isFilterResult } from './indexTreeModel.js';
|
||||||
import { CompressibleObjectTree, ICompressibleKeyboardNavigationLabelProvider, ICompressibleObjectTreeOptions, ICompressibleTreeRenderer, IObjectTreeOptions, IObjectTreeSetChildrenOptions, ObjectTree } from './objectTree.js';
|
import { CompressibleObjectTree, ICompressibleKeyboardNavigationLabelProvider, ICompressibleObjectTreeOptions, ICompressibleTreeRenderer, IObjectTreeOptions, IObjectTreeSetChildrenOptions, ObjectTree } from './objectTree.js';
|
||||||
|
@ -629,7 +629,12 @@ export class AsyncDataTree<TInput, T, TFilterData = void> implements IDisposable
|
||||||
this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState, this, this.disposables);
|
this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState, this, this.disposables);
|
||||||
|
|
||||||
if (asyncFindEnabled) {
|
if (asyncFindEnabled) {
|
||||||
const findOptions = { styles: options.findWidgetStyles, showNotFoundMessage: options.showNotFoundMessage };
|
const findOptions: IFindControllerOptions = {
|
||||||
|
styles: options.findWidgetStyles,
|
||||||
|
showNotFoundMessage: options.showNotFoundMessage,
|
||||||
|
defaultFindMatchType: options.defaultFindMatchType,
|
||||||
|
defaultFindMode: options.defaultFindMode,
|
||||||
|
};
|
||||||
this.findController = this.disposables.add(new AsyncFindController(this.tree, options.findProvider!, findFilter!, this.tree.options.contextViewProvider!, findOptions));
|
this.findController = this.disposables.add(new AsyncFindController(this.tree, options.findProvider!, findFilter!, this.tree.options.contextViewProvider!, findOptions));
|
||||||
|
|
||||||
this.focusNavigationFilter = node => this.findController!.shouldFocusWhenNavigating(node);
|
this.focusNavigationFilter = node => this.findController!.shouldFocusWhenNavigating(node);
|
||||||
|
@ -657,8 +662,18 @@ export class AsyncDataTree<TInput, T, TFilterData = void> implements IDisposable
|
||||||
return new ObjectTree(user, container, objectTreeDelegate, objectTreeRenderers, objectTreeOptions);
|
return new ObjectTree(user, container, objectTreeDelegate, objectTreeRenderers, objectTreeOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateOptions(options: IAsyncDataTreeOptionsUpdate = {}): void {
|
updateOptions(optionsUpdate: IAsyncDataTreeOptionsUpdate = {}): void {
|
||||||
this.tree.updateOptions(options);
|
if (this.findController) {
|
||||||
|
if (optionsUpdate.defaultFindMode !== undefined) {
|
||||||
|
this.findController.mode = optionsUpdate.defaultFindMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (optionsUpdate.defaultFindMatchType !== undefined) {
|
||||||
|
this.findController.matchType = optionsUpdate.defaultFindMatchType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.tree.updateOptions(optionsUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
get options(): IAsyncDataTreeOptions<T, TFilterData> {
|
get options(): IAsyncDataTreeOptions<T, TFilterData> {
|
||||||
|
@ -1513,10 +1528,6 @@ export class CompressibleAsyncDataTree<TInput, T, TFilterData = void> extends As
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
override updateOptions(options: ICompressibleAsyncDataTreeOptionsUpdate = {}): void {
|
|
||||||
this.tree.updateOptions(options);
|
|
||||||
}
|
|
||||||
|
|
||||||
override getViewState(): IAsyncDataTreeViewState {
|
override getViewState(): IAsyncDataTreeViewState {
|
||||||
if (!this.identityProvider) {
|
if (!this.identityProvider) {
|
||||||
throw new TreeError(this.user, 'Can\'t get tree view state without an identity provider');
|
throw new TreeError(this.user, 'Can\'t get tree view state without an identity provider');
|
||||||
|
|
Loading…
Reference in New Issue