提交 090d29b3 编写于 作者: B Benjamin Pasero

💄 list service consumers

上级 6adbd5b2
...@@ -641,8 +641,7 @@ export class ReferenceWidget extends PeekViewWidget { ...@@ -641,8 +641,7 @@ export class ReferenceWidget extends PeekViewWidget {
var options: tree.ITreeOptions = { var options: tree.ITreeOptions = {
twistiePixels: 20, twistiePixels: 20,
ariaLabel: nls.localize('treeAriaLabel', "References"), ariaLabel: nls.localize('treeAriaLabel', "References")
keyboardSupport: false
}; };
this._tree = this._instantiationService.createInstance(WorkbenchTree, div.getHTMLElement(), config, options); this._tree = this._instantiationService.createInstance(WorkbenchTree, div.getHTMLElement(), config, options);
......
...@@ -117,11 +117,22 @@ class MultipleSelectionController<T> implements IMultipleSelectionController<T> ...@@ -117,11 +117,22 @@ class MultipleSelectionController<T> implements IMultipleSelectionController<T>
} }
} }
function handleMultiSelectSupport<T>(options: IListOptions<T>, configurationService: IConfigurationService): IListOptions<T> {
if (options.multipleSelectionSupport === true && !options.multipleSelectionController) {
options.multipleSelectionController = new MultipleSelectionController(configurationService);
}
return options;
}
export class WorkbenchList<T> extends List<T> { export class WorkbenchList<T> extends List<T> {
readonly contextKeyService: IContextKeyService; readonly contextKeyService: IContextKeyService;
private listDoubleSelection: IContextKey<boolean>; private listDoubleSelection: IContextKey<boolean>;
private _useAltAsMultipleSelectionModifier: boolean;
constructor( constructor(
container: HTMLElement, container: HTMLElement,
delegate: IDelegate<T>, delegate: IDelegate<T>,
...@@ -130,31 +141,45 @@ export class WorkbenchList<T> extends List<T> { ...@@ -130,31 +141,45 @@ export class WorkbenchList<T> extends List<T> {
@IContextKeyService contextKeyService: IContextKeyService, @IContextKeyService contextKeyService: IContextKeyService,
@IListService listService: IListService, @IListService listService: IListService,
@IThemeService themeService: IThemeService, @IThemeService themeService: IThemeService,
@IConfigurationService configurationService: IConfigurationService @IConfigurationService private configurationService: IConfigurationService
) { ) {
const multipleSelectionSupport = !(options.multipleSelectionSupport === false); super(container, delegate, renderers, mixin(handleMultiSelectSupport(options, configurationService), { keyboardSupport: false } as IListOptions<any>, false));
if (multipleSelectionSupport && !options.multipleSelectionController) {
options.multipleSelectionController = new MultipleSelectionController(configurationService);
}
super(container, delegate, renderers, mixin(options, useAltAsMultipleSelectionModifier(configurationService)));
this.contextKeyService = createScopedContextKeyService(contextKeyService, this); this.contextKeyService = createScopedContextKeyService(contextKeyService, this);
this.listDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService); this.listDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService);
this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService);
this.disposables.push(combinedDisposable([ this.disposables.push(combinedDisposable([
this.contextKeyService, this.contextKeyService,
(listService as ListService).register(this), (listService as ListService).register(this),
attachListStyler(this, themeService), attachListStyler(this, themeService),
this.onSelectionChange(() => this.listDoubleSelection.set(this.getSelection().length === 2)) this.onSelectionChange(() => this.listDoubleSelection.set(this.getSelection().length === 2))
])); ]));
this.registerListeners();
}
public get useAltAsMultipleSelectionModifier(): boolean {
return this._useAltAsMultipleSelectionModifier;
}
private registerListeners(): void {
this.disposables.push(this.configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration(multiSelectModifierSettingKey)) {
this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(this.configurationService);
}
}));
} }
} }
export class WorkbenchPagedList<T> extends PagedList<T> { export class WorkbenchPagedList<T> extends PagedList<T> {
readonly contextKeyService: IContextKeyService; readonly contextKeyService: IContextKeyService;
private disposable: IDisposable;
private disposables: IDisposable[] = [];
private _useAltAsMultipleSelectionModifier: boolean;
constructor( constructor(
container: HTMLElement, container: HTMLElement,
...@@ -164,57 +189,90 @@ export class WorkbenchPagedList<T> extends PagedList<T> { ...@@ -164,57 +189,90 @@ export class WorkbenchPagedList<T> extends PagedList<T> {
@IContextKeyService contextKeyService: IContextKeyService, @IContextKeyService contextKeyService: IContextKeyService,
@IListService listService: IListService, @IListService listService: IListService,
@IThemeService themeService: IThemeService, @IThemeService themeService: IThemeService,
@IConfigurationService configurationService: IConfigurationService @IConfigurationService private configurationService: IConfigurationService
) { ) {
const multipleSelectionSupport = !(options.multipleSelectionSupport === false); super(container, delegate, renderers, mixin(handleMultiSelectSupport(options, configurationService), { keyboardSupport: false } as IListOptions<any>, false));
if (multipleSelectionSupport && !options.multipleSelectionController) {
options.multipleSelectionController = new MultipleSelectionController(configurationService);
}
super(container, delegate, renderers, mixin(options, useAltAsMultipleSelectionModifier(configurationService)));
this.contextKeyService = createScopedContextKeyService(contextKeyService, this); this.contextKeyService = createScopedContextKeyService(contextKeyService, this);
this.disposable = combinedDisposable([ this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService);
this.disposables.push(combinedDisposable([
this.contextKeyService, this.contextKeyService,
(listService as ListService).register(this), (listService as ListService).register(this),
attachListStyler(this, themeService) attachListStyler(this, themeService)
]); ]));
this.registerListeners();
}
public get useAltAsMultipleSelectionModifier(): boolean {
return this._useAltAsMultipleSelectionModifier;
}
private registerListeners(): void {
this.disposables.push(this.configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration(multiSelectModifierSettingKey)) {
this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(this.configurationService);
}
}));
} }
dispose(): void { dispose(): void {
this.disposable.dispose(); this.disposables = dispose(this.disposables);
} }
} }
export class WorkbenchTree extends Tree { export class WorkbenchTree extends Tree {
readonly contextKeyService: IContextKeyService; readonly contextKeyService: IContextKeyService;
protected disposables: IDisposable[] = []; protected disposables: IDisposable[] = [];
private listDoubleSelection: IContextKey<boolean>; private listDoubleSelection: IContextKey<boolean>;
private _useAltAsMultipleSelectionModifier: boolean;
constructor( constructor(
container: HTMLElement, container: HTMLElement,
configuration: ITreeConfiguration, configuration: ITreeConfiguration,
options: ITreeOptions, options: ITreeOptions,
@IContextKeyService contextKeyService: IContextKeyService, @IContextKeyService contextKeyService: IContextKeyService,
@IListService listService: IListService, @IListService listService: IListService,
@IThemeService themeService: IThemeService @IThemeService themeService: IThemeService,
@IConfigurationService private configurationService: IConfigurationService
) { ) {
super(container, configuration, options); super(container, configuration, mixin(options, { keyboardSupport: false } as ITreeOptions, false));
this.contextKeyService = createScopedContextKeyService(contextKeyService, this); this.contextKeyService = createScopedContextKeyService(contextKeyService, this);
this.listDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService); this.listDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService);
this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService);
this.disposables.push( this.disposables.push(
this.contextKeyService, this.contextKeyService,
(listService as ListService).register(this), (listService as ListService).register(this),
attachListStyler(this, themeService) attachListStyler(this, themeService)
); );
this.registerListeners();
}
public get useAltAsMultipleSelectionModifier(): boolean {
return this._useAltAsMultipleSelectionModifier;
}
private registerListeners(): void {
this.disposables.push(this.onDidChangeSelection(() => { this.disposables.push(this.onDidChangeSelection(() => {
const selection = this.getSelection(); const selection = this.getSelection();
this.listDoubleSelection.set(selection && selection.length === 2); this.listDoubleSelection.set(selection && selection.length === 2);
})); }));
this.disposables.push(this.configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration(multiSelectModifierSettingKey)) {
this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(this.configurationService);
}
}));
} }
dispose(): void { dispose(): void {
......
...@@ -92,7 +92,7 @@ export class TreeView extends TreeViewsViewletPanel { ...@@ -92,7 +92,7 @@ export class TreeView extends TreeViewsViewletPanel {
const tree = this.instantiationService.createInstance(FileIconThemableWorkbenchTree, const tree = this.instantiationService.createInstance(FileIconThemableWorkbenchTree,
container.getHTMLElement(), container.getHTMLElement(),
{ dataSource, renderer, controller }, { dataSource, renderer, controller },
{ keyboardSupport: false } {}
); );
tree.contextKeyService.createKey<boolean>(this.id, true); tree.contextKeyService.createKey<boolean>(this.id, true);
......
...@@ -31,6 +31,7 @@ import { WorkbenchTree, IListService } from 'vs/platform/list/browser/listServic ...@@ -31,6 +31,7 @@ import { WorkbenchTree, IListService } from 'vs/platform/list/browser/listServic
import { IWorkbenchThemeService, IFileIconTheme } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { IWorkbenchThemeService, IFileIconTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { ITreeConfiguration, ITreeOptions } from 'vs/base/parts/tree/browser/tree'; import { ITreeConfiguration, ITreeOptions } from 'vs/base/parts/tree/browser/tree';
import Event, { Emitter } from 'vs/base/common/event'; import Event, { Emitter } from 'vs/base/common/event';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
export interface IViewOptions extends IPanelOptions { export interface IViewOptions extends IPanelOptions {
id: string; id: string;
...@@ -771,9 +772,10 @@ export class FileIconThemableWorkbenchTree extends WorkbenchTree { ...@@ -771,9 +772,10 @@ export class FileIconThemableWorkbenchTree extends WorkbenchTree {
options: ITreeOptions, options: ITreeOptions,
@IContextKeyService contextKeyService: IContextKeyService, @IContextKeyService contextKeyService: IContextKeyService,
@IListService listService: IListService, @IListService listService: IListService,
@IThemeService themeService: IWorkbenchThemeService @IThemeService themeService: IWorkbenchThemeService,
@IConfigurationService configurationService: IConfigurationService
) { ) {
super(container, configuration, { ...options, ...{ showTwistie: false, twistiePixels: 12 } }, contextKeyService, listService, themeService); super(container, configuration, { ...options, ...{ showTwistie: false, twistiePixels: 12 } }, contextKeyService, listService, themeService, configurationService);
DOM.addClass(container, 'file-icon-themable-tree'); DOM.addClass(container, 'file-icon-themable-tree');
DOM.addClass(container, 'show-file-icons'); DOM.addClass(container, 'show-file-icons');
......
...@@ -380,9 +380,9 @@ export class StackFrame implements IStackFrame { ...@@ -380,9 +380,9 @@ export class StackFrame implements IStackFrame {
return `${this.name} (${this.source.inMemory ? this.source.name : this.source.uri.fsPath}:${this.range.startLineNumber})`; return `${this.name} (${this.source.inMemory ? this.source.name : this.source.uri.fsPath}:${this.range.startLineNumber})`;
} }
public openInEditor(editorService: IWorkbenchEditorService, preserveFocus?: boolean, sideBySide?: boolean): TPromise<any> { public openInEditor(editorService: IWorkbenchEditorService, preserveFocus?: boolean, sideBySide?: boolean, pinned?: boolean): TPromise<any> {
return !this.source.available ? TPromise.as(null) : return !this.source.available ? TPromise.as(null) :
this.source.openInEditor(editorService, this.range, preserveFocus, sideBySide); this.source.openInEditor(editorService, this.range, preserveFocus, sideBySide, pinned);
} }
} }
......
...@@ -56,7 +56,7 @@ export class Source { ...@@ -56,7 +56,7 @@ export class Source {
return this.uri.scheme === DEBUG_SCHEME; return this.uri.scheme === DEBUG_SCHEME;
} }
public openInEditor(editorService: IWorkbenchEditorService, selection: IRange, preserveFocus?: boolean, sideBySide?: boolean): TPromise<any> { public openInEditor(editorService: IWorkbenchEditorService, selection: IRange, preserveFocus?: boolean, sideBySide?: boolean, pinned?: boolean): TPromise<any> {
return !this.available ? TPromise.as(null) : editorService.openEditor({ return !this.available ? TPromise.as(null) : editorService.openEditor({
resource: this.uri, resource: this.uri,
description: this.origin, description: this.origin,
...@@ -65,7 +65,7 @@ export class Source { ...@@ -65,7 +65,7 @@ export class Source {
selection, selection,
revealIfVisible: true, revealIfVisible: true,
revealInCenterIfOutsideViewport: true, revealInCenterIfOutsideViewport: true,
pinned: !preserveFocus && !this.inMemory pinned: pinned || (!preserveFocus && !this.inMemory)
} }
}, sideBySide); }, sideBySide);
} }
......
...@@ -102,8 +102,7 @@ export class CallStackView extends TreeViewsViewletPanel { ...@@ -102,8 +102,7 @@ export class CallStackView extends TreeViewsViewletPanel {
controller controller
}, { }, {
ariaLabel: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'callStackAriaLabel' }, "Debug Call Stack"), ariaLabel: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'callStackAriaLabel' }, "Debug Call Stack"),
twistiePixels, twistiePixels
keyboardSupport: false
}); });
const fileResultsNavigation = new FileResultsNavigation(this.tree); const fileResultsNavigation = new FileResultsNavigation(this.tree);
...@@ -116,7 +115,7 @@ export class CallStackView extends TreeViewsViewletPanel { ...@@ -116,7 +115,7 @@ export class CallStackView extends TreeViewsViewletPanel {
const element = e.element; const element = e.element;
if (element instanceof StackFrame) { if (element instanceof StackFrame) {
this.debugService.focusStackFrame(element, element.thread, element.thread.process, true); this.debugService.focusStackFrame(element, element.thread, element.thread.process, true);
element.openInEditor(this.editorService, e.editorOptions.preserveFocus, e.sideBySide).done(undefined, errors.onUnexpectedError); element.openInEditor(this.editorService, e.editorOptions.preserveFocus, e.sideBySide, e.editorOptions.pinned).done(undefined, errors.onUnexpectedError);
} }
if (element instanceof Thread) { if (element instanceof Thread) {
this.debugService.focusStackFrame(undefined, element, element.process, true); this.debugService.focusStackFrame(undefined, element, element.process, true);
......
...@@ -75,8 +75,7 @@ export class DebugHoverWidget implements IContentWidget { ...@@ -75,8 +75,7 @@ export class DebugHoverWidget implements IContentWidget {
}, { }, {
indentPixels: 6, indentPixels: 6,
twistiePixels: 15, twistiePixels: 15,
ariaLabel: nls.localize('treeAriaLabel', "Debug Hover"), ariaLabel: nls.localize('treeAriaLabel', "Debug Hover")
keyboardSupport: false
}); });
this.valueContainer = $('.value'); this.valueContainer = $('.value');
......
...@@ -49,8 +49,7 @@ const $ = dom.$; ...@@ -49,8 +49,7 @@ const $ = dom.$;
const replTreeOptions: ITreeOptions = { const replTreeOptions: ITreeOptions = {
twistiePixels: 20, twistiePixels: 20,
ariaLabel: nls.localize('replAriaLabel', "Read Eval Print Loop Panel"), ariaLabel: nls.localize('replAriaLabel', "Read Eval Print Loop Panel")
keyboardSupport: false
}; };
const HISTORY_STORAGE_KEY = 'debug.repl.history'; const HISTORY_STORAGE_KEY = 'debug.repl.history';
......
...@@ -90,8 +90,7 @@ export class VariablesView extends TreeViewsViewletPanel { ...@@ -90,8 +90,7 @@ export class VariablesView extends TreeViewsViewletPanel {
controller: this.instantiationService.createInstance(VariablesController, new VariablesActionProvider(this.debugService, this.keybindingService), MenuId.DebugVariablesContext) controller: this.instantiationService.createInstance(VariablesController, new VariablesActionProvider(this.debugService, this.keybindingService), MenuId.DebugVariablesContext)
}, { }, {
ariaLabel: nls.localize('variablesAriaTreeLabel', "Debug Variables"), ariaLabel: nls.localize('variablesAriaTreeLabel', "Debug Variables"),
twistiePixels, twistiePixels
keyboardSupport: false
}); });
CONTEXT_VARIABLES_FOCUSED.bindTo(this.tree.contextKeyService); CONTEXT_VARIABLES_FOCUSED.bindTo(this.tree.contextKeyService);
......
...@@ -69,8 +69,7 @@ export class WatchExpressionsView extends TreeViewsViewletPanel { ...@@ -69,8 +69,7 @@ export class WatchExpressionsView extends TreeViewsViewletPanel {
dnd: new WatchExpressionsDragAndDrop(this.debugService) dnd: new WatchExpressionsDragAndDrop(this.debugService)
}, { }, {
ariaLabel: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'watchAriaTreeLabel' }, "Debug Watch Expressions"), ariaLabel: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'watchAriaTreeLabel' }, "Debug Watch Expressions"),
twistiePixels, twistiePixels
keyboardSupport: false
}); });
CONTEXT_WATCH_EXPRESSIONS_FOCUSED.bindTo(this.tree.contextKeyService); CONTEXT_WATCH_EXPRESSIONS_FOCUSED.bindTo(this.tree.contextKeyService);
......
...@@ -526,8 +526,7 @@ export class ExtensionEditor extends BaseEditor { ...@@ -526,8 +526,7 @@ export class ExtensionEditor extends BaseEditor {
controller controller
}, { }, {
indentPixels: 40, indentPixels: 40,
twistiePixels: 20, twistiePixels: 20
keyboardSupport: false
}); });
tree.setInput(extensionDependencies); tree.setInput(extensionDependencies);
......
...@@ -78,8 +78,7 @@ export class ExtensionsListView extends ViewsViewletPanel { ...@@ -78,8 +78,7 @@ export class ExtensionsListView extends ViewsViewletPanel {
const delegate = new Delegate(); const delegate = new Delegate();
const renderer = this.instantiationService.createInstance(Renderer); const renderer = this.instantiationService.createInstance(Renderer);
this.list = this.instantiationService.createInstance(WorkbenchPagedList, this.extensionsList, delegate, [renderer], { this.list = this.instantiationService.createInstance(WorkbenchPagedList, this.extensionsList, delegate, [renderer], {
ariaLabel: localize('extensions', "Extensions"), ariaLabel: localize('extensions', "Extensions")
keyboardSupport: false
}); });
chain(this.list.onSelectionChange) chain(this.list.onSelectionChange)
...@@ -443,6 +442,7 @@ export class ExtensionsListView extends ViewsViewletPanel { ...@@ -443,6 +442,7 @@ export class ExtensionsListView extends ViewsViewletPanel {
const activeEditorInput = this.editorService.getActiveEditorInput(); const activeEditorInput = this.editorService.getActiveEditorInput();
this.editorInputService.pinEditor(activeEditor.position, activeEditorInput); this.editorInputService.pinEditor(activeEditor.position, activeEditorInput);
activeEditor.focus();
} }
......
...@@ -403,8 +403,7 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView ...@@ -403,8 +403,7 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView
accessibilityProvider accessibilityProvider
}, { }, {
autoExpandSingleChildren: true, autoExpandSingleChildren: true,
ariaLabel: nls.localize('treeAriaLabel', "Files Explorer"), ariaLabel: nls.localize('treeAriaLabel', "Files Explorer")
keyboardSupport: false
}); });
// Bind context keys // Bind context keys
......
...@@ -56,7 +56,7 @@ import { extractResources } from 'vs/workbench/browser/editor'; ...@@ -56,7 +56,7 @@ import { extractResources } from 'vs/workbench/browser/editor';
import { relative } from 'path'; import { relative } from 'path';
import { DataTransfers } from 'vs/base/browser/dnd'; import { DataTransfers } from 'vs/base/browser/dnd';
import { distinctParents } from 'vs/base/common/resources'; import { distinctParents } from 'vs/base/common/resources';
import { WorkbenchTree, multiSelectModifierSettingKey } from 'vs/platform/list/browser/listService'; import { WorkbenchTree } from 'vs/platform/list/browser/listService';
export class FileDataSource implements IDataSource { export class FileDataSource implements IDataSource {
constructor( constructor(
...@@ -330,33 +330,20 @@ export class FileController extends DefaultController implements IDisposable { ...@@ -330,33 +330,20 @@ export class FileController extends DefaultController implements IDisposable {
private contributedContextMenu: IMenu; private contributedContextMenu: IMenu;
private toDispose: IDisposable[]; private toDispose: IDisposable[];
private previousSelectionRangeStop: FileStat; private previousSelectionRangeStop: FileStat;
private useAltAsMultiSelectModifier: boolean;
constructor( constructor(
@IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService,
@IContextMenuService private contextMenuService: IContextMenuService, @IContextMenuService private contextMenuService: IContextMenuService,
@ITelemetryService private telemetryService: ITelemetryService, @ITelemetryService private telemetryService: ITelemetryService,
@IMenuService private menuService: IMenuService, @IMenuService private menuService: IMenuService,
@IContextKeyService contextKeyService: IContextKeyService, @IContextKeyService contextKeyService: IContextKeyService
@IConfigurationService private configurationService: IConfigurationService
) { ) {
super({ clickBehavior: ClickBehavior.ON_MOUSE_UP /* do not change to not break DND */, keyboardSupport: false /* handled via IListService */ }); super({ clickBehavior: ClickBehavior.ON_MOUSE_UP /* do not change to not break DND */, keyboardSupport: false /* handled via IListService */ });
this.useAltAsMultiSelectModifier = configurationService.getValue(multiSelectModifierSettingKey) === 'alt';
this.toDispose = []; this.toDispose = [];
this.registerListeners();
}
private registerListeners(): void {
this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration(multiSelectModifierSettingKey)) {
this.useAltAsMultiSelectModifier = this.configurationService.getValue(multiSelectModifierSettingKey) === 'alt';
}
}));
} }
public onLeftClick(tree: ITree, stat: FileStat | Model, event: IMouseEvent, origin: string = 'mouse'): boolean { public onLeftClick(tree: WorkbenchTree, stat: FileStat | Model, event: IMouseEvent, origin: string = 'mouse'): boolean {
const payload = { origin: origin }; const payload = { origin: origin };
const isDoubleClick = (origin === 'mouse' && event.detail === 2); const isDoubleClick = (origin === 'mouse' && event.detail === 2);
...@@ -394,7 +381,7 @@ export class FileController extends DefaultController implements IDisposable { ...@@ -394,7 +381,7 @@ export class FileController extends DefaultController implements IDisposable {
} }
// Allow to multiselect // Allow to multiselect
if ((this.useAltAsMultiSelectModifier && event.altKey) || !this.useAltAsMultiSelectModifier && (event.ctrlKey || event.metaKey)) { if ((tree.useAltAsMultipleSelectionModifier && event.altKey) || !tree.useAltAsMultipleSelectionModifier && (event.ctrlKey || event.metaKey)) {
const selection = tree.getSelection(); const selection = tree.getSelection();
this.previousSelectionRangeStop = undefined; this.previousSelectionRangeStop = undefined;
if (selection.indexOf(stat) >= 0) { if (selection.indexOf(stat) >= 0) {
...@@ -435,7 +422,7 @@ export class FileController extends DefaultController implements IDisposable { ...@@ -435,7 +422,7 @@ export class FileController extends DefaultController implements IDisposable {
if (!stat.isDirectory) { if (!stat.isDirectory) {
let sideBySide = false; let sideBySide = false;
if (event) { if (event) {
sideBySide = this.useAltAsMultiSelectModifier ? (event.ctrlKey || event.metaKey) : event.altKey; sideBySide = tree.useAltAsMultipleSelectionModifier ? (event.ctrlKey || event.metaKey) : event.altKey;
} }
this.openEditor(stat, { preserveFocus, sideBySide, pinned: isDoubleClick }); this.openEditor(stat, { preserveFocus, sideBySide, pinned: isDoubleClick });
......
...@@ -28,7 +28,7 @@ import { EditorGroup } from 'vs/workbench/common/editor/editorStacksModel'; ...@@ -28,7 +28,7 @@ import { EditorGroup } from 'vs/workbench/common/editor/editorStacksModel';
import { attachStylerCallback } from 'vs/platform/theme/common/styler'; import { attachStylerCallback } from 'vs/platform/theme/common/styler';
import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IThemeService } from 'vs/platform/theme/common/themeService';
import { badgeBackground, badgeForeground, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; import { badgeBackground, badgeForeground, contrastBorder } from 'vs/platform/theme/common/colorRegistry';
import { WorkbenchList, useAltAsMultipleSelectionModifier } from 'vs/platform/list/browser/listService'; import { WorkbenchList } from 'vs/platform/list/browser/listService';
import { IDelegate, IRenderer, IListContextMenuEvent, IListMouseEvent } from 'vs/base/browser/ui/list/list'; import { IDelegate, IRenderer, IListContextMenuEvent, IListMouseEvent } from 'vs/base/browser/ui/list/list';
import { EditorLabel } from 'vs/workbench/browser/labels'; import { EditorLabel } from 'vs/workbench/browser/labels';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
...@@ -153,7 +153,6 @@ export class OpenEditorsView extends ViewsViewletPanel { ...@@ -153,7 +153,6 @@ export class OpenEditorsView extends ViewsViewletPanel {
new EditorGroupRenderer(this.keybindingService, this.instantiationService, this.editorGroupService), new EditorGroupRenderer(this.keybindingService, this.instantiationService, this.editorGroupService),
new OpenEditorRenderer(getSelectedElements, this.instantiationService, this.keybindingService, this.configurationService, this.editorGroupService) new OpenEditorRenderer(getSelectedElements, this.instantiationService, this.keybindingService, this.configurationService, this.editorGroupService)
], { ], {
keyboardSupport: false,
identityProvider: element => element instanceof OpenEditor ? element.getId() : element.id.toString() identityProvider: element => element instanceof OpenEditor ? element.getId() : element.id.toString()
}); });
...@@ -278,7 +277,7 @@ export class OpenEditorsView extends ViewsViewletPanel { ...@@ -278,7 +277,7 @@ export class OpenEditorsView extends ViewsViewletPanel {
const position = this.model.positionOfGroup(element.group); const position = this.model.positionOfGroup(element.group);
this.editorService.closeEditor(position, element.editor).done(null, errors.onUnexpectedError); this.editorService.closeEditor(position, element.editor).done(null, errors.onUnexpectedError);
} else { } else {
const sideBySide = useAltAsMultipleSelectionModifier(this.configurationService) ? event.browserEvent.altKey : (event.browserEvent.ctrlKey || event.browserEvent.metaKey); const sideBySide = this.list.useAltAsMultipleSelectionModifier ? (event.browserEvent.ctrlKey || event.browserEvent.metaKey) : event.browserEvent.altKey;
this.openEditor(element, { preserveFocus: !isDoubleClick, pinned: isDoubleClick, sideBySide }); this.openEditor(element, { preserveFocus: !isDoubleClick, pinned: isDoubleClick, sideBySide });
} }
} }
......
...@@ -206,8 +206,7 @@ export class MarkersPanel extends Panel { ...@@ -206,8 +206,7 @@ export class MarkersPanel extends Panel {
}, { }, {
indentPixels: 0, indentPixels: 0,
twistiePixels: 20, twistiePixels: 20,
ariaLabel: Messages.MARKERS_PANEL_ARIA_LABEL_PROBLEMS_TREE, ariaLabel: Messages.MARKERS_PANEL_ARIA_LABEL_PROBLEMS_TREE
keyboardSupport: false
}); });
Constants.MarkerFocusContextKey.bindTo(this.tree.contextKeyService); Constants.MarkerFocusContextKey.bindTo(this.tree.contextKeyService);
......
...@@ -333,7 +333,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor ...@@ -333,7 +333,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
this.keybindingsListContainer = DOM.append(parent, $('.keybindings-list-container')); this.keybindingsListContainer = DOM.append(parent, $('.keybindings-list-container'));
this.keybindingsList = this._register(this.instantiationService.createInstance(WorkbenchList, this.keybindingsListContainer, new Delegate(), [new KeybindingHeaderRenderer(), new KeybindingItemRenderer(this, this.keybindingsService)], this.keybindingsList = this._register(this.instantiationService.createInstance(WorkbenchList, this.keybindingsListContainer, new Delegate(), [new KeybindingHeaderRenderer(), new KeybindingItemRenderer(this, this.keybindingsService)],
{ identityProvider: e => e.id, keyboardSupport: false, mouseSupport: true, ariaLabel: localize('keybindingsLabel', "Keybindings") })); { identityProvider: e => e.id, mouseSupport: true, ariaLabel: localize('keybindingsLabel', "Keybindings") }));
this._register(this.keybindingsList.onContextMenu(e => this.onContextMenu(e))); this._register(this.keybindingsList.onContextMenu(e => this.onContextMenu(e)));
this._register(this.keybindingsList.onFocusChange(e => this.onFocusChange(e))); this._register(this.keybindingsList.onFocusChange(e => this.onFocusChange(e)));
this._register(this.keybindingsList.onDidFocus(() => { this._register(this.keybindingsList.onDidFocus(() => {
......
...@@ -854,8 +854,7 @@ export class RepositoryPanel extends ViewletPanel { ...@@ -854,8 +854,7 @@ export class RepositoryPanel extends ViewletPanel {
]; ];
this.list = this.instantiationService.createInstance(WorkbenchList, this.listContainer, delegate, renderers, { this.list = this.instantiationService.createInstance(WorkbenchList, this.listContainer, delegate, renderers, {
identityProvider: scmResourceIdentityProvider, identityProvider: scmResourceIdentityProvider
keyboardSupport: false
}); });
chain(this.list.onOpen) chain(this.list.onOpen)
...@@ -941,6 +940,7 @@ export class RepositoryPanel extends ViewletPanel { ...@@ -941,6 +940,7 @@ export class RepositoryPanel extends ViewletPanel {
} }
this.editorGroupService.pinEditor(activeEditor.position, activeEditorInput); this.editorGroupService.pinEditor(activeEditor.position, activeEditorInput);
activeEditor.focus();
} }
private onListContextMenu(e: IListContextMenuEvent<ISCMResourceGroup | ISCMResource>): void { private onListContextMenu(e: IListContextMenuEvent<ISCMResourceGroup | ISCMResource>): void {
......
...@@ -505,8 +505,7 @@ export class SearchViewlet extends Viewlet { ...@@ -505,8 +505,7 @@ export class SearchViewlet extends Viewlet {
accessibilityProvider: this.instantiationService.createInstance(SearchAccessibilityProvider), accessibilityProvider: this.instantiationService.createInstance(SearchAccessibilityProvider),
dnd dnd
}, { }, {
ariaLabel: nls.localize('treeAriaLabel', "Search Results"), ariaLabel: nls.localize('treeAriaLabel', "Search Results")
keyboardSupport: false
}); });
this.tree.setInput(this.viewModel.searchResult); this.tree.setInput(this.viewModel.searchResult);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册