Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some dead code in base/parts/tree/ #70867

Merged
merged 1 commit into from
Mar 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions src/vs/base/parts/quickopen/browser/quickOpenModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { URI } from 'vs/base/common/uri';
import { ITree, IActionProvider } from 'vs/base/parts/tree/browser/tree';
import { IconLabel, IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel';
import { IQuickNavigateConfiguration, IModel, IDataSource, IFilter, IAccessiblityProvider, IRenderer, IRunner, Mode, IEntryRunContext } from 'vs/base/parts/quickopen/common/quickOpen';
import { Action, IAction, IActionRunner, IActionItem } from 'vs/base/common/actions';
import { IAction, IActionRunner } from 'vs/base/common/actions';
import { compareAnything } from 'vs/base/common/comparers';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';
Expand Down Expand Up @@ -291,18 +291,6 @@ class NoActionProvider implements IActionProvider {
getActions(tree: ITree, element: any): IAction[] | null {
return null;
}

hasSecondaryActions(tree: ITree, element: any): boolean {
return false;
}

getSecondaryActions(tree: ITree, element: any): IAction[] | null {
return null;
}

getActionItem(tree: ITree, element: any, action: Action): IActionItem | undefined {
return undefined;
}
}

export interface IQuickOpenEntryTemplateData {
Expand Down
115 changes: 1 addition & 114 deletions src/vs/base/parts/tree/browser/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as Keyboard from 'vs/base/browser/keyboardEvent';
import { INavigator } from 'vs/base/common/iterator';
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
import { Event } from 'vs/base/common/event';
import { IAction, IActionItem } from 'vs/base/common/actions';
import { IAction } from 'vs/base/common/actions';
import { Color } from 'vs/base/common/color';
import { IItemCollapseEvent, IItemExpandEvent } from 'vs/base/parts/tree/browser/treeModel';
import { IDragAndDropData } from 'vs/base/browser/dnd';
Expand Down Expand Up @@ -169,81 +169,21 @@ export interface ITree {
*/
getHighlight(includeHidden?: boolean): any;

/**
* Returns whether an element is highlighted or not.
*/
isHighlighted(element: any): boolean;

/**
* Clears the highlight.
*/
clearHighlight(eventPayload?: any): void;

/**
* Selects an element.
*/
select(element: any, eventPayload?: any): void;

/**
* Selects a range of elements.
*/
selectRange(fromElement: any, toElement: any, eventPayload?: any): void;

/**
* Deselects a range of elements.
*/
deselectRange(fromElement: any, toElement: any, eventPayload?: any): void;

/**
* Selects several elements.
*/
selectAll(elements: any[], eventPayload?: any): void;

/**
* Deselects an element.
*/
deselect(element: any, eventPayload?: any): void;

/**
* Deselects several elements.
*/
deselectAll(elements: any[], eventPayload?: any): void;

/**
* Replaces the current selection with the given elements.
*/
setSelection(elements: any[], eventPayload?: any): void;

/**
* Toggles the element's selection.
*/
toggleSelection(element: any, eventPayload?: any): void;

/**
* Returns the currently selected elements.
*/
getSelection(includeHidden?: boolean): any[];

/**
* Returns whether an element is selected or not.
*/
isSelected(element: any): boolean;

/**
* Selects the next `count`-nth element, in visible order.
*/
selectNext(count?: number, clearSelection?: boolean, eventPayload?: any): void;

/**
* Selects the previous `count`-nth element, in visible order.
*/
selectPrevious(count?: number, clearSelection?: boolean, eventPayload?: any): void;

/**
* Selects the currently selected element's parent.
*/
selectParent(clearSelection?: boolean, eventPayload?: any): void;

/**
* Clears the selection.
*/
Expand All @@ -254,11 +194,6 @@ export interface ITree {
*/
setFocus(element?: any, eventPayload?: any): void;

/**
* Returns whether an element is focused or not.
*/
isFocused(element: any): boolean;

/**
* Returns focused element.
*/
Expand Down Expand Up @@ -316,26 +251,6 @@ export interface ITree {
*/
clearFocus(eventPayload?: any): void;

/**
* Adds the trait to elements.
*/
addTraits(trait: string, elements: any[]): void;

/**
* Removes the trait from elements.
*/
removeTraits(trait: string, elements: any[]): void;

/**
* Toggles the element's trait.
*/
toggleTrait(trait: string, element: any): void;

/**
* Returns whether the element has the trait or not.
*/
hasTrait(trait: string, element: any): boolean;

/**
* Returns a navigator which allows to discover the visible and
* expanded elements in the tree.
Expand Down Expand Up @@ -582,13 +497,6 @@ export interface IDragOverReaction {
autoExpand?: boolean;
}

export const DRAG_OVER_REJECT: IDragOverReaction = { accept: false };
export const DRAG_OVER_ACCEPT: IDragOverReaction = { accept: true };
export const DRAG_OVER_ACCEPT_BUBBLE_UP: IDragOverReaction = { accept: true, bubble: DragOverBubble.BUBBLE_UP };
export const DRAG_OVER_ACCEPT_BUBBLE_DOWN = (autoExpand = false) => ({ accept: true, bubble: DragOverBubble.BUBBLE_DOWN, autoExpand });
export const DRAG_OVER_ACCEPT_BUBBLE_UP_COPY: IDragOverReaction = { accept: true, bubble: DragOverBubble.BUBBLE_UP, effect: DragOverEffect.COPY };
export const DRAG_OVER_ACCEPT_BUBBLE_DOWN_COPY = (autoExpand = false) => ({ accept: true, bubble: DragOverBubble.BUBBLE_DOWN, effect: DragOverEffect.COPY, autoExpand });

export interface IDragAndDrop {

/**
Expand Down Expand Up @@ -627,12 +535,6 @@ export interface IFilter {
isVisible(tree: ITree, element: any): boolean;
}

export interface IElementCallback {
(tree: ITree, element: any): void;
}

export type ICallback = () => void;

export interface ISorter {

/**
Expand Down Expand Up @@ -722,19 +624,4 @@ export interface IActionProvider {
* Returns a promise of an array with the actions of the element that should show up in place right to the element in the tree.
*/
getActions(tree: ITree | null, element: any): IAction[] | null;

/**
* Returns whether or not the element has secondary actions. These show up once the user has expanded the element's action bar.
*/
hasSecondaryActions(tree: ITree, element: any): boolean;

/**
* Returns a promise of an array with the secondary actions of the element that should show up once the user has expanded the element's action bar.
*/
getSecondaryActions(tree: ITree, element: any): IAction[] | null;

/**
* Returns an action item to render an action.
*/
getActionItem(tree: ITree, element: any, action: IAction): IActionItem | undefined;
}
69 changes: 0 additions & 69 deletions src/vs/base/parts/tree/browser/treeImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,50 +230,14 @@ export class Tree implements _.ITree {
return this.model.getHighlight();
}

public isHighlighted(element: any): boolean {
return this.model.isFocused(element);
}

public clearHighlight(eventPayload?: any): void {
this.model.setHighlight(null, eventPayload);
}

public select(element: any, eventPayload?: any): void {
this.model.select(element, eventPayload);
}

public selectRange(fromElement: any, toElement: any, eventPayload?: any): void {
this.model.selectRange(fromElement, toElement, eventPayload);
}

public deselectRange(fromElement: any, toElement: any, eventPayload?: any): void {
this.model.deselectRange(fromElement, toElement, eventPayload);
}

public selectAll(elements: any[], eventPayload?: any): void {
this.model.selectAll(elements, eventPayload);
}

public deselect(element: any, eventPayload?: any): void {
this.model.deselect(element, eventPayload);
}

public deselectAll(elements: any[], eventPayload?: any): void {
this.model.deselectAll(elements, eventPayload);
}

public setSelection(elements: any[], eventPayload?: any): void {
this.model.setSelection(elements, eventPayload);
}

public toggleSelection(element: any, eventPayload?: any): void {
this.model.toggleSelection(element, eventPayload);
}

public isSelected(element: any): boolean {
return this.model.isSelected(element);
}

public getSelection(): any[] {
return this.model.getSelection();
}
Expand All @@ -282,26 +246,10 @@ export class Tree implements _.ITree {
this.model.setSelection([], eventPayload);
}

public selectNext(count?: number, clearSelection?: boolean, eventPayload?: any): void {
this.model.selectNext(count, clearSelection, eventPayload);
}

public selectPrevious(count?: number, clearSelection?: boolean, eventPayload?: any): void {
this.model.selectPrevious(count, clearSelection, eventPayload);
}

public selectParent(clearSelection?: boolean, eventPayload?: any): void {
this.model.selectParent(clearSelection, eventPayload);
}

public setFocus(element?: any, eventPayload?: any): void {
this.model.setFocus(element, eventPayload);
}

public isFocused(element: any): boolean {
return this.model.isFocused(element);
}

public getFocus(): any {
return this.model.getFocus();
}
Expand Down Expand Up @@ -346,23 +294,6 @@ export class Tree implements _.ITree {
this.model.setFocus(null, eventPayload);
}

public addTraits(trait: string, elements: any[]): void {
this.model.addTraits(trait, elements);
}

public removeTraits(trait: string, elements: any[]): void {
this.model.removeTraits(trait, elements);
}

public toggleTrait(trait: string, element: any): void {
this.model.hasTrait(trait, element) ? this.model.removeTraits(trait, [element])
: this.model.addTraits(trait, [element]);
}

public hasTrait(trait: string, element: any): boolean {
return this.model.hasTrait(trait, element);
}

getNavigator(fromElement?: any, subTreeOnly?: boolean): INavigator<any> {
return new MappedNavigator(this.model.getNavigator(fromElement, subTreeOnly), i => i && i.getElement());
}
Expand Down
Loading