Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
e7279b1c
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e7279b1c
编写于
7月 22, 2020
作者:
J
João Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
isolate action view items, delete duplicate IActionViewItem interface
上级
f49561e4
变更
37
隐藏空白更改
内联
并排
Showing
37 changed file
with
466 addition
and
454 deletion
+466
-454
src/vs/base/browser/contextmenu.ts
src/vs/base/browser/contextmenu.ts
+1
-2
src/vs/base/browser/ui/actionbar/actionViewItems.ts
src/vs/base/browser/ui/actionbar/actionViewItems.ts
+406
-0
src/vs/base/browser/ui/actionbar/actionbar.ts
src/vs/base/browser/ui/actionbar/actionbar.ts
+3
-407
src/vs/base/browser/ui/checkbox/checkbox.ts
src/vs/base/browser/ui/checkbox/checkbox.ts
+1
-1
src/vs/base/browser/ui/dropdown/dropdown.ts
src/vs/base/browser/ui/dropdown/dropdown.ts
+2
-1
src/vs/base/browser/ui/menu/menu.ts
src/vs/base/browser/ui/menu/menu.ts
+2
-1
src/vs/base/common/actions.ts
src/vs/base/common/actions.ts
+2
-2
src/vs/base/parts/quickinput/browser/quickInput.ts
src/vs/base/parts/quickinput/browser/quickInput.ts
+2
-1
src/vs/editor/contrib/contextmenu/contextmenu.ts
src/vs/editor/contrib/contextmenu/contextmenu.ts
+1
-1
src/vs/editor/contrib/suggest/suggestWidget.ts
src/vs/editor/contrib/suggest/suggestWidget.ts
+2
-1
src/vs/platform/actions/browser/menuEntryActionViewItem.ts
src/vs/platform/actions/browser/menuEntryActionViewItem.ts
+1
-1
src/vs/platform/browser/checkbox.ts
src/vs/platform/browser/checkbox.ts
+1
-1
src/vs/workbench/browser/composite.ts
src/vs/workbench/browser/composite.ts
+1
-2
src/vs/workbench/browser/parts/activitybar/activitybarActions.ts
...workbench/browser/parts/activitybar/activitybarActions.ts
+1
-1
src/vs/workbench/browser/parts/compositeBarActions.ts
src/vs/workbench/browser/parts/compositeBarActions.ts
+1
-1
src/vs/workbench/browser/parts/compositePart.ts
src/vs/workbench/browser/parts/compositePart.ts
+2
-2
src/vs/workbench/browser/parts/editor/titleControl.ts
src/vs/workbench/browser/parts/editor/titleControl.ts
+2
-2
src/vs/workbench/browser/parts/views/viewPaneContainer.ts
src/vs/workbench/browser/parts/views/viewPaneContainer.ts
+2
-2
src/vs/workbench/contrib/comments/browser/commentNode.ts
src/vs/workbench/contrib/comments/browser/commentNode.ts
+2
-1
src/vs/workbench/contrib/comments/browser/commentThreadWidget.ts
...workbench/contrib/comments/browser/commentThreadWidget.ts
+2
-1
src/vs/workbench/contrib/comments/browser/reactionsAction.ts
src/vs/workbench/contrib/comments/browser/reactionsAction.ts
+1
-1
src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts
...s/workbench/contrib/debug/browser/debugActionViewItems.ts
+2
-2
src/vs/workbench/contrib/debug/browser/debugViewlet.ts
src/vs/workbench/contrib/debug/browser/debugViewlet.ts
+1
-2
src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
...workbench/contrib/extensions/browser/extensionsActions.ts
+1
-1
src/vs/workbench/contrib/markers/browser/markersTreeViewer.ts
...vs/workbench/contrib/markers/browser/markersTreeViewer.ts
+2
-1
src/vs/workbench/contrib/markers/browser/markersView.ts
src/vs/workbench/contrib/markers/browser/markersView.ts
+2
-1
src/vs/workbench/contrib/markers/browser/markersViewActions.ts
...s/workbench/contrib/markers/browser/markersViewActions.ts
+2
-1
src/vs/workbench/contrib/output/browser/outputView.ts
src/vs/workbench/contrib/output/browser/outputView.ts
+2
-2
src/vs/workbench/contrib/preferences/browser/preferencesWidgets.ts
...rkbench/contrib/preferences/browser/preferencesWidgets.ts
+2
-1
src/vs/workbench/contrib/remote/browser/explorerViewItems.ts
src/vs/workbench/contrib/remote/browser/explorerViewItems.ts
+1
-1
src/vs/workbench/contrib/remote/browser/tunnelView.ts
src/vs/workbench/contrib/remote/browser/tunnelView.ts
+3
-2
src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts
src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts
+2
-2
src/vs/workbench/contrib/scm/browser/scmViewPane.ts
src/vs/workbench/contrib/scm/browser/scmViewPane.ts
+2
-1
src/vs/workbench/contrib/terminal/browser/terminalActions.ts
src/vs/workbench/contrib/terminal/browser/terminalActions.ts
+1
-1
src/vs/workbench/contrib/terminal/browser/terminalView.ts
src/vs/workbench/contrib/terminal/browser/terminalView.ts
+1
-2
src/vs/workbench/contrib/timeline/browser/timelinePane.ts
src/vs/workbench/contrib/timeline/browser/timelinePane.ts
+2
-1
src/vs/workbench/contrib/views/browser/treeView.ts
src/vs/workbench/contrib/views/browser/treeView.ts
+2
-1
未找到文件。
src/vs/base/browser/contextmenu.ts
浏览文件 @
e7279b1c
...
...
@@ -3,8 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
IAction
,
IActionRunner
}
from
'
vs/base/common/actions
'
;
import
{
IActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IAction
,
IActionRunner
,
IActionViewItem
}
from
'
vs/base/common/actions
'
;
import
{
ResolvedKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
AnchorAlignment
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
...
...
src/vs/base/browser/ui/actionbar/actionViewItems.ts
0 → 100644
浏览文件 @
e7279b1c
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
'
vs/css!./actionbar
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
SelectBox
,
ISelectOptionItem
,
ISelectBoxOptions
}
from
'
vs/base/browser/ui/selectBox/selectBox
'
;
import
{
IAction
,
IActionRunner
,
Action
,
IActionChangeEvent
,
ActionRunner
,
Separator
,
IActionViewItem
}
from
'
vs/base/common/actions
'
;
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
*
as
types
from
'
vs/base/common/types
'
;
import
{
EventType
,
Gesture
}
from
'
vs/base/browser/touch
'
;
import
{
IContextViewProvider
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
import
{
DataTransfers
}
from
'
vs/base/browser/dnd
'
;
import
{
isFirefox
}
from
'
vs/base/browser/browser
'
;
export
interface
IBaseActionViewItemOptions
{
draggable
?:
boolean
;
isMenu
?:
boolean
;
useEventAsContext
?:
boolean
;
}
export
class
BaseActionViewItem
extends
Disposable
implements
IActionViewItem
{
element
:
HTMLElement
|
undefined
;
_context
:
any
;
_action
:
IAction
;
private
_actionRunner
:
IActionRunner
|
undefined
;
constructor
(
context
:
any
,
action
:
IAction
,
protected
options
?:
IBaseActionViewItemOptions
)
{
super
();
this
.
_context
=
context
||
this
;
this
.
_action
=
action
;
if
(
action
instanceof
Action
)
{
this
.
_register
(
action
.
onDidChange
(
event
=>
{
if
(
!
this
.
element
)
{
// we have not been rendered yet, so there
// is no point in updating the UI
return
;
}
this
.
handleActionChangeEvent
(
event
);
}));
}
}
private
handleActionChangeEvent
(
event
:
IActionChangeEvent
):
void
{
if
(
event
.
enabled
!==
undefined
)
{
this
.
updateEnabled
();
}
if
(
event
.
checked
!==
undefined
)
{
this
.
updateChecked
();
}
if
(
event
.
class
!==
undefined
)
{
this
.
updateClass
();
}
if
(
event
.
label
!==
undefined
)
{
this
.
updateLabel
();
this
.
updateTooltip
();
}
if
(
event
.
tooltip
!==
undefined
)
{
this
.
updateTooltip
();
}
}
get
actionRunner
():
IActionRunner
{
if
(
!
this
.
_actionRunner
)
{
this
.
_actionRunner
=
this
.
_register
(
new
ActionRunner
());
}
return
this
.
_actionRunner
;
}
set
actionRunner
(
actionRunner
:
IActionRunner
)
{
this
.
_actionRunner
=
actionRunner
;
}
getAction
():
IAction
{
return
this
.
_action
;
}
isEnabled
():
boolean
{
return
this
.
_action
.
enabled
;
}
setActionContext
(
newContext
:
unknown
):
void
{
this
.
_context
=
newContext
;
}
render
(
container
:
HTMLElement
):
void
{
const
element
=
this
.
element
=
container
;
this
.
_register
(
Gesture
.
addTarget
(
container
));
const
enableDragging
=
this
.
options
&&
this
.
options
.
draggable
;
if
(
enableDragging
)
{
container
.
draggable
=
true
;
if
(
isFirefox
)
{
// Firefox: requires to set a text data transfer to get going
this
.
_register
(
DOM
.
addDisposableListener
(
container
,
DOM
.
EventType
.
DRAG_START
,
e
=>
e
.
dataTransfer
?.
setData
(
DataTransfers
.
TEXT
,
this
.
_action
.
label
)));
}
}
this
.
_register
(
DOM
.
addDisposableListener
(
element
,
EventType
.
Tap
,
e
=>
this
.
onClick
(
e
)));
this
.
_register
(
DOM
.
addDisposableListener
(
element
,
DOM
.
EventType
.
MOUSE_DOWN
,
e
=>
{
if
(
!
enableDragging
)
{
DOM
.
EventHelper
.
stop
(
e
,
true
);
// do not run when dragging is on because that would disable it
}
if
(
this
.
_action
.
enabled
&&
e
.
button
===
0
)
{
DOM
.
addClass
(
element
,
'
active
'
);
}
}));
if
(
platform
.
isMacintosh
)
{
// macOS: allow to trigger the button when holding Ctrl+key and pressing the
// main mouse button. This is for scenarios where e.g. some interaction forces
// the Ctrl+key to be pressed and hold but the user still wants to interact
// with the actions (for example quick access in quick navigation mode).
this
.
_register
(
DOM
.
addDisposableListener
(
element
,
DOM
.
EventType
.
CONTEXT_MENU
,
e
=>
{
if
(
e
.
button
===
0
&&
e
.
ctrlKey
===
true
)
{
this
.
onClick
(
e
);
}
}));
}
this
.
_register
(
DOM
.
addDisposableListener
(
element
,
DOM
.
EventType
.
CLICK
,
e
=>
{
DOM
.
EventHelper
.
stop
(
e
,
true
);
// See https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Interact_with_the_clipboard
// > Writing to the clipboard
// > You can use the "cut" and "copy" commands without any special
// permission if you are using them in a short-lived event handler
// for a user action (for example, a click handler).
// => to get the Copy and Paste context menu actions working on Firefox,
// there should be no timeout here
if
(
this
.
options
&&
this
.
options
.
isMenu
)
{
this
.
onClick
(
e
);
}
else
{
platform
.
setImmediate
(()
=>
this
.
onClick
(
e
));
}
}));
this
.
_register
(
DOM
.
addDisposableListener
(
element
,
DOM
.
EventType
.
DBLCLICK
,
e
=>
{
DOM
.
EventHelper
.
stop
(
e
,
true
);
}));
[
DOM
.
EventType
.
MOUSE_UP
,
DOM
.
EventType
.
MOUSE_OUT
].
forEach
(
event
=>
{
this
.
_register
(
DOM
.
addDisposableListener
(
element
,
event
,
e
=>
{
DOM
.
EventHelper
.
stop
(
e
);
DOM
.
removeClass
(
element
,
'
active
'
);
}));
});
}
onClick
(
event
:
DOM
.
EventLike
):
void
{
DOM
.
EventHelper
.
stop
(
event
,
true
);
const
context
=
types
.
isUndefinedOrNull
(
this
.
_context
)
?
this
.
options
?.
useEventAsContext
?
event
:
undefined
:
this
.
_context
;
this
.
actionRunner
.
run
(
this
.
_action
,
context
);
}
focus
():
void
{
if
(
this
.
element
)
{
this
.
element
.
focus
();
DOM
.
addClass
(
this
.
element
,
'
focused
'
);
}
}
blur
():
void
{
if
(
this
.
element
)
{
this
.
element
.
blur
();
DOM
.
removeClass
(
this
.
element
,
'
focused
'
);
}
}
protected
updateEnabled
():
void
{
// implement in subclass
}
protected
updateLabel
():
void
{
// implement in subclass
}
protected
updateTooltip
():
void
{
// implement in subclass
}
protected
updateClass
():
void
{
// implement in subclass
}
protected
updateChecked
():
void
{
// implement in subclass
}
dispose
():
void
{
if
(
this
.
element
)
{
DOM
.
removeNode
(
this
.
element
);
this
.
element
=
undefined
;
}
super
.
dispose
();
}
}
export
interface
IActionViewItemOptions
extends
IBaseActionViewItemOptions
{
icon
?:
boolean
;
label
?:
boolean
;
keybinding
?:
string
|
null
;
}
export
class
ActionViewItem
extends
BaseActionViewItem
{
protected
label
:
HTMLElement
|
undefined
;
protected
options
:
IActionViewItemOptions
;
private
cssClass
?:
string
;
constructor
(
context
:
unknown
,
action
:
IAction
,
options
:
IActionViewItemOptions
=
{})
{
super
(
context
,
action
,
options
);
this
.
options
=
options
;
this
.
options
.
icon
=
options
.
icon
!==
undefined
?
options
.
icon
:
false
;
this
.
options
.
label
=
options
.
label
!==
undefined
?
options
.
label
:
true
;
this
.
cssClass
=
''
;
}
render
(
container
:
HTMLElement
):
void
{
super
.
render
(
container
);
if
(
this
.
element
)
{
this
.
label
=
DOM
.
append
(
this
.
element
,
DOM
.
$
(
'
a.action-label
'
));
}
if
(
this
.
label
)
{
if
(
this
.
_action
.
id
===
Separator
.
ID
)
{
this
.
label
.
setAttribute
(
'
role
'
,
'
presentation
'
);
// A separator is a presentation item
}
else
{
if
(
this
.
options
.
isMenu
)
{
this
.
label
.
setAttribute
(
'
role
'
,
'
menuitem
'
);
}
else
{
this
.
label
.
setAttribute
(
'
role
'
,
'
button
'
);
}
}
}
if
(
this
.
options
.
label
&&
this
.
options
.
keybinding
&&
this
.
element
)
{
DOM
.
append
(
this
.
element
,
DOM
.
$
(
'
span.keybinding
'
)).
textContent
=
this
.
options
.
keybinding
;
}
this
.
updateClass
();
this
.
updateLabel
();
this
.
updateTooltip
();
this
.
updateEnabled
();
this
.
updateChecked
();
}
focus
():
void
{
super
.
focus
();
if
(
this
.
label
)
{
this
.
label
.
focus
();
}
}
updateLabel
():
void
{
if
(
this
.
options
.
label
&&
this
.
label
)
{
this
.
label
.
textContent
=
this
.
getAction
().
label
;
}
}
updateTooltip
():
void
{
let
title
:
string
|
null
=
null
;
if
(
this
.
getAction
().
tooltip
)
{
title
=
this
.
getAction
().
tooltip
;
}
else
if
(
!
this
.
options
.
label
&&
this
.
getAction
().
label
&&
this
.
options
.
icon
)
{
title
=
this
.
getAction
().
label
;
if
(
this
.
options
.
keybinding
)
{
title
=
nls
.
localize
({
key
:
'
titleLabel
'
,
comment
:
[
'
action title
'
,
'
action keybinding
'
]
},
"
{0} ({1})
"
,
title
,
this
.
options
.
keybinding
);
}
}
if
(
title
&&
this
.
label
)
{
this
.
label
.
title
=
title
;
}
}
updateClass
():
void
{
if
(
this
.
cssClass
&&
this
.
label
)
{
DOM
.
removeClasses
(
this
.
label
,
this
.
cssClass
);
}
if
(
this
.
options
.
icon
)
{
this
.
cssClass
=
this
.
getAction
().
class
;
if
(
this
.
label
)
{
DOM
.
addClass
(
this
.
label
,
'
codicon
'
);
if
(
this
.
cssClass
)
{
DOM
.
addClasses
(
this
.
label
,
this
.
cssClass
);
}
}
this
.
updateEnabled
();
}
else
{
if
(
this
.
label
)
{
DOM
.
removeClass
(
this
.
label
,
'
codicon
'
);
}
}
}
updateEnabled
():
void
{
if
(
this
.
getAction
().
enabled
)
{
if
(
this
.
label
)
{
this
.
label
.
removeAttribute
(
'
aria-disabled
'
);
DOM
.
removeClass
(
this
.
label
,
'
disabled
'
);
this
.
label
.
tabIndex
=
0
;
}
if
(
this
.
element
)
{
DOM
.
removeClass
(
this
.
element
,
'
disabled
'
);
}
}
else
{
if
(
this
.
label
)
{
this
.
label
.
setAttribute
(
'
aria-disabled
'
,
'
true
'
);
DOM
.
addClass
(
this
.
label
,
'
disabled
'
);
DOM
.
removeTabIndexAndUpdateFocus
(
this
.
label
);
}
if
(
this
.
element
)
{
DOM
.
addClass
(
this
.
element
,
'
disabled
'
);
}
}
}
updateChecked
():
void
{
if
(
this
.
label
)
{
if
(
this
.
getAction
().
checked
)
{
DOM
.
addClass
(
this
.
label
,
'
checked
'
);
}
else
{
DOM
.
removeClass
(
this
.
label
,
'
checked
'
);
}
}
}
}
export
class
SelectActionViewItem
extends
BaseActionViewItem
{
protected
selectBox
:
SelectBox
;
constructor
(
ctx
:
unknown
,
action
:
IAction
,
options
:
ISelectOptionItem
[],
selected
:
number
,
contextViewProvider
:
IContextViewProvider
,
selectBoxOptions
?:
ISelectBoxOptions
)
{
super
(
ctx
,
action
);
this
.
selectBox
=
new
SelectBox
(
options
,
selected
,
contextViewProvider
,
undefined
,
selectBoxOptions
);
this
.
_register
(
this
.
selectBox
);
this
.
registerListeners
();
}
setOptions
(
options
:
ISelectOptionItem
[],
selected
?:
number
):
void
{
this
.
selectBox
.
setOptions
(
options
,
selected
);
}
select
(
index
:
number
):
void
{
this
.
selectBox
.
select
(
index
);
}
private
registerListeners
():
void
{
this
.
_register
(
this
.
selectBox
.
onDidSelect
(
e
=>
{
this
.
actionRunner
.
run
(
this
.
_action
,
this
.
getActionContext
(
e
.
selected
,
e
.
index
));
}));
}
protected
getActionContext
(
option
:
string
,
index
:
number
)
{
return
option
;
}
focus
():
void
{
if
(
this
.
selectBox
)
{
this
.
selectBox
.
focus
();
}
}
blur
():
void
{
if
(
this
.
selectBox
)
{
this
.
selectBox
.
blur
();
}
}
render
(
container
:
HTMLElement
):
void
{
this
.
selectBox
.
render
(
container
);
}
}
src/vs/base/browser/ui/actionbar/actionbar.ts
浏览文件 @
e7279b1c
...
...
@@ -4,371 +4,14 @@
*--------------------------------------------------------------------------------------------*/
import
'
vs/css!./actionbar
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
Disposable
,
dispose
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
SelectBox
,
ISelectOptionItem
,
ISelectBoxOptions
}
from
'
vs/base/browser/ui/selectBox/selectBox
'
;
import
{
IAction
,
IActionRunner
,
Action
,
IActionChangeEvent
,
ActionRunner
,
IRunEvent
,
Separator
}
from
'
vs/base/common/actions
'
;
import
{
Disposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IAction
,
IActionRunner
,
ActionRunner
,
IRunEvent
,
Separator
,
IActionViewItem
}
from
'
vs/base/common/actions
'
;
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
*
as
types
from
'
vs/base/common/types
'
;
import
{
EventType
,
Gesture
}
from
'
vs/base/browser/touch
'
;
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
{
IContextViewProvider
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
DataTransfers
}
from
'
vs/base/browser/dnd
'
;
import
{
isFirefox
}
from
'
vs/base/browser/browser
'
;
export
interface
IActionViewItem
extends
IDisposable
{
actionRunner
:
IActionRunner
;
setActionContext
(
context
:
any
):
void
;
render
(
element
:
HTMLElement
):
void
;
isEnabled
():
boolean
;
focus
(
fromRight
?:
boolean
):
void
;
blur
():
void
;
}
export
interface
IBaseActionViewItemOptions
{
draggable
?:
boolean
;
isMenu
?:
boolean
;
useEventAsContext
?:
boolean
;
}
export
class
BaseActionViewItem
extends
Disposable
implements
IActionViewItem
{
element
:
HTMLElement
|
undefined
;
_context
:
any
;
_action
:
IAction
;
private
_actionRunner
:
IActionRunner
|
undefined
;
constructor
(
context
:
any
,
action
:
IAction
,
protected
options
?:
IBaseActionViewItemOptions
)
{
super
();
this
.
_context
=
context
||
this
;
this
.
_action
=
action
;
if
(
action
instanceof
Action
)
{
this
.
_register
(
action
.
onDidChange
(
event
=>
{
if
(
!
this
.
element
)
{
// we have not been rendered yet, so there
// is no point in updating the UI
return
;
}
this
.
handleActionChangeEvent
(
event
);
}));
}
}
private
handleActionChangeEvent
(
event
:
IActionChangeEvent
):
void
{
if
(
event
.
enabled
!==
undefined
)
{
this
.
updateEnabled
();
}
if
(
event
.
checked
!==
undefined
)
{
this
.
updateChecked
();
}
if
(
event
.
class
!==
undefined
)
{
this
.
updateClass
();
}
if
(
event
.
label
!==
undefined
)
{
this
.
updateLabel
();
this
.
updateTooltip
();
}
if
(
event
.
tooltip
!==
undefined
)
{
this
.
updateTooltip
();
}
}
get
actionRunner
():
IActionRunner
{
if
(
!
this
.
_actionRunner
)
{
this
.
_actionRunner
=
this
.
_register
(
new
ActionRunner
());
}
return
this
.
_actionRunner
;
}
set
actionRunner
(
actionRunner
:
IActionRunner
)
{
this
.
_actionRunner
=
actionRunner
;
}
getAction
():
IAction
{
return
this
.
_action
;
}
isEnabled
():
boolean
{
return
this
.
_action
.
enabled
;
}
setActionContext
(
newContext
:
unknown
):
void
{
this
.
_context
=
newContext
;
}
render
(
container
:
HTMLElement
):
void
{
const
element
=
this
.
element
=
container
;
this
.
_register
(
Gesture
.
addTarget
(
container
));
const
enableDragging
=
this
.
options
&&
this
.
options
.
draggable
;
if
(
enableDragging
)
{
container
.
draggable
=
true
;
if
(
isFirefox
)
{
// Firefox: requires to set a text data transfer to get going
this
.
_register
(
DOM
.
addDisposableListener
(
container
,
DOM
.
EventType
.
DRAG_START
,
e
=>
e
.
dataTransfer
?.
setData
(
DataTransfers
.
TEXT
,
this
.
_action
.
label
)));
}
}
this
.
_register
(
DOM
.
addDisposableListener
(
element
,
EventType
.
Tap
,
e
=>
this
.
onClick
(
e
)));
this
.
_register
(
DOM
.
addDisposableListener
(
element
,
DOM
.
EventType
.
MOUSE_DOWN
,
e
=>
{
if
(
!
enableDragging
)
{
DOM
.
EventHelper
.
stop
(
e
,
true
);
// do not run when dragging is on because that would disable it
}
if
(
this
.
_action
.
enabled
&&
e
.
button
===
0
)
{
DOM
.
addClass
(
element
,
'
active
'
);
}
}));
if
(
platform
.
isMacintosh
)
{
// macOS: allow to trigger the button when holding Ctrl+key and pressing the
// main mouse button. This is for scenarios where e.g. some interaction forces
// the Ctrl+key to be pressed and hold but the user still wants to interact
// with the actions (for example quick access in quick navigation mode).
this
.
_register
(
DOM
.
addDisposableListener
(
element
,
DOM
.
EventType
.
CONTEXT_MENU
,
e
=>
{
if
(
e
.
button
===
0
&&
e
.
ctrlKey
===
true
)
{
this
.
onClick
(
e
);
}
}));
}
this
.
_register
(
DOM
.
addDisposableListener
(
element
,
DOM
.
EventType
.
CLICK
,
e
=>
{
DOM
.
EventHelper
.
stop
(
e
,
true
);
// See https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Interact_with_the_clipboard
// > Writing to the clipboard
// > You can use the "cut" and "copy" commands without any special
// permission if you are using them in a short-lived event handler
// for a user action (for example, a click handler).
// => to get the Copy and Paste context menu actions working on Firefox,
// there should be no timeout here
if
(
this
.
options
&&
this
.
options
.
isMenu
)
{
this
.
onClick
(
e
);
}
else
{
platform
.
setImmediate
(()
=>
this
.
onClick
(
e
));
}
}));
this
.
_register
(
DOM
.
addDisposableListener
(
element
,
DOM
.
EventType
.
DBLCLICK
,
e
=>
{
DOM
.
EventHelper
.
stop
(
e
,
true
);
}));
[
DOM
.
EventType
.
MOUSE_UP
,
DOM
.
EventType
.
MOUSE_OUT
].
forEach
(
event
=>
{
this
.
_register
(
DOM
.
addDisposableListener
(
element
,
event
,
e
=>
{
DOM
.
EventHelper
.
stop
(
e
);
DOM
.
removeClass
(
element
,
'
active
'
);
}));
});
}
onClick
(
event
:
DOM
.
EventLike
):
void
{
DOM
.
EventHelper
.
stop
(
event
,
true
);
const
context
=
types
.
isUndefinedOrNull
(
this
.
_context
)
?
this
.
options
?.
useEventAsContext
?
event
:
undefined
:
this
.
_context
;
this
.
actionRunner
.
run
(
this
.
_action
,
context
);
}
focus
():
void
{
if
(
this
.
element
)
{
this
.
element
.
focus
();
DOM
.
addClass
(
this
.
element
,
'
focused
'
);
}
}
blur
():
void
{
if
(
this
.
element
)
{
this
.
element
.
blur
();
DOM
.
removeClass
(
this
.
element
,
'
focused
'
);
}
}
protected
updateEnabled
():
void
{
// implement in subclass
}
protected
updateLabel
():
void
{
// implement in subclass
}
protected
updateTooltip
():
void
{
// implement in subclass
}
protected
updateClass
():
void
{
// implement in subclass
}
protected
updateChecked
():
void
{
// implement in subclass
}
dispose
():
void
{
if
(
this
.
element
)
{
DOM
.
removeNode
(
this
.
element
);
this
.
element
=
undefined
;
}
super
.
dispose
();
}
}
export
interface
IActionViewItemOptions
extends
IBaseActionViewItemOptions
{
icon
?:
boolean
;
label
?:
boolean
;
keybinding
?:
string
|
null
;
}
export
class
ActionViewItem
extends
BaseActionViewItem
{
protected
label
:
HTMLElement
|
undefined
;
protected
options
:
IActionViewItemOptions
;
private
cssClass
?:
string
;
constructor
(
context
:
unknown
,
action
:
IAction
,
options
:
IActionViewItemOptions
=
{})
{
super
(
context
,
action
,
options
);
this
.
options
=
options
;
this
.
options
.
icon
=
options
.
icon
!==
undefined
?
options
.
icon
:
false
;
this
.
options
.
label
=
options
.
label
!==
undefined
?
options
.
label
:
true
;
this
.
cssClass
=
''
;
}
render
(
container
:
HTMLElement
):
void
{
super
.
render
(
container
);
if
(
this
.
element
)
{
this
.
label
=
DOM
.
append
(
this
.
element
,
DOM
.
$
(
'
a.action-label
'
));
}
if
(
this
.
label
)
{
if
(
this
.
_action
.
id
===
Separator
.
ID
)
{
this
.
label
.
setAttribute
(
'
role
'
,
'
presentation
'
);
// A separator is a presentation item
}
else
{
if
(
this
.
options
.
isMenu
)
{
this
.
label
.
setAttribute
(
'
role
'
,
'
menuitem
'
);
}
else
{
this
.
label
.
setAttribute
(
'
role
'
,
'
button
'
);
}
}
}
if
(
this
.
options
.
label
&&
this
.
options
.
keybinding
&&
this
.
element
)
{
DOM
.
append
(
this
.
element
,
DOM
.
$
(
'
span.keybinding
'
)).
textContent
=
this
.
options
.
keybinding
;
}
this
.
updateClass
();
this
.
updateLabel
();
this
.
updateTooltip
();
this
.
updateEnabled
();
this
.
updateChecked
();
}
focus
():
void
{
super
.
focus
();
if
(
this
.
label
)
{
this
.
label
.
focus
();
}
}
updateLabel
():
void
{
if
(
this
.
options
.
label
&&
this
.
label
)
{
this
.
label
.
textContent
=
this
.
getAction
().
label
;
}
}
updateTooltip
():
void
{
let
title
:
string
|
null
=
null
;
if
(
this
.
getAction
().
tooltip
)
{
title
=
this
.
getAction
().
tooltip
;
}
else
if
(
!
this
.
options
.
label
&&
this
.
getAction
().
label
&&
this
.
options
.
icon
)
{
title
=
this
.
getAction
().
label
;
if
(
this
.
options
.
keybinding
)
{
title
=
nls
.
localize
({
key
:
'
titleLabel
'
,
comment
:
[
'
action title
'
,
'
action keybinding
'
]
},
"
{0} ({1})
"
,
title
,
this
.
options
.
keybinding
);
}
}
if
(
title
&&
this
.
label
)
{
this
.
label
.
title
=
title
;
}
}
updateClass
():
void
{
if
(
this
.
cssClass
&&
this
.
label
)
{
DOM
.
removeClasses
(
this
.
label
,
this
.
cssClass
);
}
if
(
this
.
options
.
icon
)
{
this
.
cssClass
=
this
.
getAction
().
class
;
if
(
this
.
label
)
{
DOM
.
addClass
(
this
.
label
,
'
codicon
'
);
if
(
this
.
cssClass
)
{
DOM
.
addClasses
(
this
.
label
,
this
.
cssClass
);
}
}
this
.
updateEnabled
();
}
else
{
if
(
this
.
label
)
{
DOM
.
removeClass
(
this
.
label
,
'
codicon
'
);
}
}
}
updateEnabled
():
void
{
if
(
this
.
getAction
().
enabled
)
{
if
(
this
.
label
)
{
this
.
label
.
removeAttribute
(
'
aria-disabled
'
);
DOM
.
removeClass
(
this
.
label
,
'
disabled
'
);
this
.
label
.
tabIndex
=
0
;
}
if
(
this
.
element
)
{
DOM
.
removeClass
(
this
.
element
,
'
disabled
'
);
}
}
else
{
if
(
this
.
label
)
{
this
.
label
.
setAttribute
(
'
aria-disabled
'
,
'
true
'
);
DOM
.
addClass
(
this
.
label
,
'
disabled
'
);
DOM
.
removeTabIndexAndUpdateFocus
(
this
.
label
);
}
if
(
this
.
element
)
{
DOM
.
addClass
(
this
.
element
,
'
disabled
'
);
}
}
}
updateChecked
():
void
{
if
(
this
.
label
)
{
if
(
this
.
getAction
().
checked
)
{
DOM
.
addClass
(
this
.
label
,
'
checked
'
);
}
else
{
DOM
.
removeClass
(
this
.
label
,
'
checked
'
);
}
}
}
}
import
{
IActionViewItemOptions
,
ActionViewItem
,
BaseActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
const
enum
ActionsOrientation
{
HORIZONTAL
,
...
...
@@ -834,53 +477,6 @@ export class ActionBar extends Disposable implements IActionRunner {
}
}
export
class
SelectActionViewItem
extends
BaseActionViewItem
{
protected
selectBox
:
SelectBox
;
constructor
(
ctx
:
unknown
,
action
:
IAction
,
options
:
ISelectOptionItem
[],
selected
:
number
,
contextViewProvider
:
IContextViewProvider
,
selectBoxOptions
?:
ISelectBoxOptions
)
{
super
(
ctx
,
action
);
this
.
selectBox
=
new
SelectBox
(
options
,
selected
,
contextViewProvider
,
undefined
,
selectBoxOptions
);
this
.
_register
(
this
.
selectBox
);
this
.
registerListeners
();
}
setOptions
(
options
:
ISelectOptionItem
[],
selected
?:
number
):
void
{
this
.
selectBox
.
setOptions
(
options
,
selected
);
}
select
(
index
:
number
):
void
{
this
.
selectBox
.
select
(
index
);
}
private
registerListeners
():
void
{
this
.
_register
(
this
.
selectBox
.
onDidSelect
(
e
=>
{
this
.
actionRunner
.
run
(
this
.
_action
,
this
.
getActionContext
(
e
.
selected
,
e
.
index
));
}));
}
protected
getActionContext
(
option
:
string
,
index
:
number
)
{
return
option
;
}
focus
():
void
{
if
(
this
.
selectBox
)
{
this
.
selectBox
.
focus
();
}
}
blur
():
void
{
if
(
this
.
selectBox
)
{
this
.
selectBox
.
blur
();
}
}
render
(
container
:
HTMLElement
):
void
{
this
.
selectBox
.
render
(
container
);
}
}
export
function
prepareActions
(
actions
:
IAction
[]):
IAction
[]
{
if
(
!
actions
.
length
)
{
return
actions
;
...
...
src/vs/base/browser/ui/checkbox/checkbox.ts
浏览文件 @
e7279b1c
...
...
@@ -10,9 +10,9 @@ import { Widget } from 'vs/base/browser/ui/widget';
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
BaseActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
Codicon
}
from
'
vs/base/common/codicons
'
;
import
{
BaseActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
interface
ICheckboxOpts
extends
ICheckboxStyles
{
readonly
actionClassName
?:
string
;
...
...
src/vs/base/browser/ui/dropdown/dropdown.ts
浏览文件 @
e7279b1c
...
...
@@ -6,7 +6,7 @@
import
'
vs/css!./dropdown
'
;
import
{
Gesture
,
EventType
as
GestureEventType
}
from
'
vs/base/browser/touch
'
;
import
{
ActionRunner
,
IAction
,
IActionRunner
}
from
'
vs/base/common/actions
'
;
import
{
BaseActionViewItem
,
IActionViewItemProvider
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IActionViewItemProvider
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IContextViewProvider
,
IAnchor
,
AnchorAlignment
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
import
{
IMenuOptions
}
from
'
vs/base/browser/ui/menu/menu
'
;
...
...
@@ -15,6 +15,7 @@ import { EventHelper, EventType, removeClass, addClass, append, $, addDisposable
import
{
IContextMenuDelegate
}
from
'
vs/base/browser/contextmenu
'
;
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
BaseActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
interface
ILabelRenderer
{
(
container
:
HTMLElement
):
IDisposable
|
null
;
...
...
src/vs/base/browser/ui/menu/menu.ts
浏览文件 @
e7279b1c
...
...
@@ -7,7 +7,7 @@ import 'vs/css!./menu';
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
{
IActionRunner
,
IAction
,
SubmenuAction
,
Separator
}
from
'
vs/base/common/actions
'
;
import
{
ActionBar
,
IActionViewItemProvider
,
ActionsOrientation
,
ActionViewItem
,
IActionViewItemOptions
,
BaseActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ActionBar
,
IActionViewItemProvider
,
ActionsOrientation
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ResolvedKeybinding
,
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
addClass
,
EventType
,
EventHelper
,
EventLike
,
removeTabIndexAndUpdateFocus
,
isAncestor
,
hasClass
,
addDisposableListener
,
removeClass
,
append
,
$
,
addClasses
,
removeClasses
,
clearNode
}
from
'
vs/base/browser/dom
'
;
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
...
...
@@ -20,6 +20,7 @@ import { Event } from 'vs/base/common/event';
import
{
AnchorAlignment
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
import
{
isLinux
,
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
{
Codicon
,
registerIcon
,
stripCodicons
}
from
'
vs/base/common/codicons
'
;
import
{
BaseActionViewItem
,
ActionViewItem
,
IActionViewItemOptions
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
const
MENU_MNEMONIC_REGEX
=
/
\(
&
([^\s
&
])\)
|
(
^|
[^
&
])
&
([^\s
&
])
/
;
export
const
MENU_ESCAPED_MNEMONIC_REGEX
=
/
(
&
)?(
&
)([^\s
&
])
/g
;
...
...
src/vs/base/common/actions.ts
浏览文件 @
e7279b1c
...
...
@@ -39,11 +39,11 @@ export interface IActionRunner extends IDisposable {
}
export
interface
IActionViewItem
extends
IDisposable
{
readonly
actionRunner
:
IActionRunner
;
actionRunner
:
IActionRunner
;
setActionContext
(
context
:
any
):
void
;
render
(
element
:
any
/* HTMLElement */
):
void
;
isEnabled
():
boolean
;
focus
(
):
void
;
focus
(
fromRight
?:
boolean
):
void
;
// TODO@isidorn what is this?
blur
():
void
;
}
...
...
src/vs/base/parts/quickinput/browser/quickInput.ts
浏览文件 @
e7279b1c
...
...
@@ -18,7 +18,7 @@ import { Emitter, Event } from 'vs/base/common/event';
import
{
Button
,
IButtonStyles
}
from
'
vs/base/browser/ui/button/button
'
;
import
{
dispose
,
Disposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
ActionBar
,
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
equals
}
from
'
vs/base/common/arrays
'
;
import
{
TimeoutTimer
}
from
'
vs/base/common/async
'
;
...
...
@@ -28,6 +28,7 @@ import { List, IListOptions, IListStyles } from 'vs/base/browser/ui/list/listWid
import
{
IInputBoxStyles
}
from
'
vs/base/browser/ui/inputbox/inputBox
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
registerIcon
,
Codicon
}
from
'
vs/base/common/codicons
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
interface
IQuickInputOptions
{
idPrefix
:
string
;
...
...
src/vs/editor/contrib/contextmenu/contextmenu.ts
浏览文件 @
e7279b1c
...
...
@@ -6,7 +6,6 @@
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IAnchor
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
import
{
IAction
,
Separator
,
SubmenuAction
}
from
'
vs/base/common/actions
'
;
import
{
KeyCode
,
KeyMod
,
ResolvedKeybinding
}
from
'
vs/base/common/keyCodes
'
;
...
...
@@ -23,6 +22,7 @@ import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegis
import
{
ITextModel
}
from
'
vs/editor/common/model
'
;
import
{
IMouseWheelEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
EditorOption
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
class
ContextMenuController
implements
IEditorContribution
{
...
...
src/vs/editor/contrib/suggest/suggestWidget.ts
浏览文件 @
e7279b1c
...
...
@@ -43,9 +43,10 @@ import { MarkdownString } from 'vs/base/common/htmlContent';
import
{
flatten
,
isFalsyOrEmpty
}
from
'
vs/base/common/arrays
'
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
IMenuService
}
from
'
vs/platform/actions/common/actions
'
;
import
{
ActionBar
,
IActionViewItemProvider
,
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ActionBar
,
IActionViewItemProvider
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
{
Codicon
,
registerIcon
}
from
'
vs/base/common/codicons
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
const
expandSuggestionDocsByDefault
=
false
;
...
...
src/vs/platform/actions/browser/menuEntryActionViewItem.ts
浏览文件 @
e7279b1c
...
...
@@ -5,7 +5,6 @@
import
{
addClasses
,
createCSSRule
,
removeClasses
,
asCSSUrl
}
from
'
vs/base/browser/dom
'
;
import
{
domEvent
}
from
'
vs/base/browser/event
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IAction
,
Separator
}
from
'
vs/base/common/actions
'
;
import
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
IdGenerator
}
from
'
vs/base/common/idGenerator
'
;
...
...
@@ -17,6 +16,7 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
ThemeIcon
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
// The alternative key on all platforms is alt. On windows we also support shift as an alternative key #44136
class
AlternativeKeyEmitter
extends
Emitter
<
boolean
>
{
...
...
src/vs/platform/browser/checkbox.ts
浏览文件 @
e7279b1c
...
...
@@ -3,11 +3,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
IBaseActionViewItemOptions
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
CheckboxActionViewItem
}
from
'
vs/base/browser/ui/checkbox/checkbox
'
;
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
attachCheckboxStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
IBaseActionViewItemOptions
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
class
ThemableCheckboxActionViewItem
extends
CheckboxActionViewItem
{
...
...
src/vs/workbench/browser/composite.ts
浏览文件 @
e7279b1c
...
...
@@ -3,8 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
IAction
,
IActionRunner
,
ActionRunner
}
from
'
vs/base/common/actions
'
;
import
{
IActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IAction
,
IActionRunner
,
ActionRunner
,
IActionViewItem
}
from
'
vs/base/common/actions
'
;
import
{
Component
}
from
'
vs/workbench/common/component
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IComposite
,
ICompositeControl
}
from
'
vs/workbench/common/composite
'
;
...
...
src/vs/workbench/browser/parts/activitybar/activitybarActions.ts
浏览文件 @
e7279b1c
...
...
@@ -27,11 +27,11 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
createAndFillInActionBarActions
}
from
'
vs/platform/actions/browser/menuEntryActionViewItem
'
;
import
{
Codicon
}
from
'
vs/base/common/codicons
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
{
IAuthenticationService
}
from
'
vs/workbench/services/authentication/browser/authenticationService
'
;
import
{
AuthenticationSession
}
from
'
vs/editor/common/modes
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
class
ViewContainerActivityAction
extends
ActivityAction
{
...
...
src/vs/workbench/browser/parts/compositeBarActions.ts
浏览文件 @
e7279b1c
...
...
@@ -6,7 +6,6 @@
import
*
as
nls
from
'
vs/nls
'
;
import
{
Action
,
Separator
}
from
'
vs/base/common/actions
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
BaseActionViewItem
,
IBaseActionViewItemOptions
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
dispose
,
toDisposable
,
MutableDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
...
...
@@ -21,6 +20,7 @@ import { Emitter, Event } from 'vs/base/common/event';
import
{
CompositeDragAndDropObserver
,
ICompositeDragAndDrop
,
Before2D
,
toggleDropEffect
}
from
'
vs/workbench/browser/dnd
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
Codicon
}
from
'
vs/base/common/codicons
'
;
import
{
IBaseActionViewItemOptions
,
BaseActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
interface
ICompositeActivity
{
badge
:
IBadge
;
...
...
src/vs/workbench/browser/parts/compositePart.ts
浏览文件 @
e7279b1c
...
...
@@ -11,9 +11,9 @@ import * as strings from 'vs/base/common/strings';
import
{
Emitter
}
from
'
vs/base/common/event
'
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
{
ToolBar
}
from
'
vs/base/browser/ui/toolbar/toolbar
'
;
import
{
IActionViewItem
,
ActionsOrientation
,
prepareActions
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ActionsOrientation
,
prepareActions
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ProgressBar
}
from
'
vs/base/browser/ui/progressbar/progressbar
'
;
import
{
IAction
,
WorkbenchActionExecutedEvent
,
WorkbenchActionExecutedClassification
}
from
'
vs/base/common/actions
'
;
import
{
IAction
,
WorkbenchActionExecutedEvent
,
WorkbenchActionExecutedClassification
,
IActionViewItem
}
from
'
vs/base/common/actions
'
;
import
{
Part
,
IPartOptions
}
from
'
vs/workbench/browser/part
'
;
import
{
Composite
,
CompositeRegistry
}
from
'
vs/workbench/browser/composite
'
;
import
{
IComposite
}
from
'
vs/workbench/common/composite
'
;
...
...
src/vs/workbench/browser/parts/editor/titleControl.ts
浏览文件 @
e7279b1c
...
...
@@ -7,9 +7,9 @@ import 'vs/css!./media/titlecontrol';
import
{
applyDragImage
,
DataTransfers
}
from
'
vs/base/browser/dnd
'
;
import
{
addDisposableListener
,
Dimension
,
EventType
}
from
'
vs/base/browser/dom
'
;
import
{
StandardMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
ActionsOrientation
,
IActionViewItem
,
prepareActions
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ActionsOrientation
,
prepareActions
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ToolBar
}
from
'
vs/base/browser/ui/toolbar/toolbar
'
;
import
{
IAction
,
IRunEvent
,
WorkbenchActionExecutedEvent
,
WorkbenchActionExecutedClassification
}
from
'
vs/base/common/actions
'
;
import
{
IAction
,
IRunEvent
,
WorkbenchActionExecutedEvent
,
WorkbenchActionExecutedClassification
,
IActionViewItem
}
from
'
vs/base/common/actions
'
;
import
*
as
arrays
from
'
vs/base/common/arrays
'
;
import
{
ResolvedKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
dispose
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
...
...
src/vs/workbench/browser/parts/views/viewPaneContainer.ts
浏览文件 @
e7279b1c
...
...
@@ -12,8 +12,8 @@ import { SIDE_BAR_DRAG_AND_DROP_BACKGROUND, SIDE_BAR_SECTION_HEADER_FOREGROUND,
import
{
append
,
$
,
trackFocus
,
toggleClass
,
EventType
,
isAncestor
,
Dimension
,
addDisposableListener
,
removeClass
,
addClass
,
createCSSRule
,
asCSSUrl
,
addClasses
}
from
'
vs/base/browser/dom
'
;
import
{
IDisposable
,
combinedDisposable
,
dispose
,
toDisposable
,
Disposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
firstIndex
}
from
'
vs/base/common/arrays
'
;
import
{
IAction
,
Separator
}
from
'
vs/base/common/actions
'
;
import
{
IActionViewItem
,
ActionsOrientation
,
prepareActions
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IAction
,
Separator
,
IActionViewItem
}
from
'
vs/base/common/actions
'
;
import
{
ActionsOrientation
,
prepareActions
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
ToolBar
}
from
'
vs/base/browser/ui/toolbar/toolbar
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
...
...
src/vs/workbench/contrib/comments/browser/commentNode.ts
浏览文件 @
e7279b1c
...
...
@@ -6,7 +6,7 @@
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
*
as
modes
from
'
vs/editor/common/modes
'
;
import
{
ActionsOrientation
,
Action
ViewItem
,
Action
Bar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ActionsOrientation
,
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
Action
,
IActionRunner
,
IAction
,
Separator
}
from
'
vs/base/common/actions
'
;
import
{
Disposable
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
...
...
@@ -34,6 +34,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import
{
IContextKeyService
,
IContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
CommentFormActions
}
from
'
vs/workbench/contrib/comments/browser/commentFormActions
'
;
import
{
MOUSE_CURSOR_TEXT_CSS_CLASS_NAME
}
from
'
vs/base/browser/ui/mouseCursor/mouseCursor
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
class
CommentNode
extends
Disposable
{
private
_domNode
:
HTMLElement
;
...
...
src/vs/workbench/contrib/comments/browser/commentThreadWidget.ts
浏览文件 @
e7279b1c
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
ActionBar
,
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
Action
,
IAction
}
from
'
vs/base/common/actions
'
;
import
*
as
arrays
from
'
vs/base/common/arrays
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
...
...
@@ -49,6 +49,7 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
MOUSE_CURSOR_TEXT_CSS_CLASS_NAME
}
from
'
vs/base/browser/ui/mouseCursor/mouseCursor
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
const
COMMENTEDITOR_DECORATION_KEY
=
'
commenteditordecoration
'
;
const
COLLAPSE_ACTION_CLASS
=
'
expand-review-action codicon-chevron-up
'
;
...
...
src/vs/workbench/contrib/comments/browser/reactionsAction.ts
浏览文件 @
e7279b1c
...
...
@@ -5,9 +5,9 @@
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
Action
,
IAction
}
from
'
vs/base/common/actions
'
;
import
{
URI
,
UriComponents
}
from
'
vs/base/common/uri
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
class
ToggleReactionsAction
extends
Action
{
static
readonly
ID
=
'
toolbar.toggle.pickReactions
'
;
...
...
src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts
浏览文件 @
e7279b1c
...
...
@@ -4,12 +4,11 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
nls
from
'
vs/nls
'
;
import
{
IAction
,
IActionRunner
}
from
'
vs/base/common/actions
'
;
import
{
IAction
,
IActionRunner
,
IActionViewItem
}
from
'
vs/base/common/actions
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
SelectBox
,
ISelectOptionItem
}
from
'
vs/base/browser/ui/selectBox/selectBox
'
;
import
{
SelectActionViewItem
,
IActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IDebugService
,
IDebugSession
,
IDebugConfiguration
,
IConfig
,
ILaunch
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
...
...
@@ -20,6 +19,7 @@ import { IContextViewService } from 'vs/platform/contextview/browser/contextView
import
{
IWorkspaceContextService
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
ADD_CONFIGURATION_ID
}
from
'
vs/workbench/contrib/debug/browser/debugCommands
'
;
import
{
SelectActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
const
$
=
dom
.
$
;
...
...
src/vs/workbench/contrib/debug/browser/debugViewlet.ts
浏览文件 @
e7279b1c
...
...
@@ -5,9 +5,8 @@
import
'
vs/css!./media/debugViewlet
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
{
IAction
,
IActionViewItem
}
from
'
vs/base/common/actions
'
;
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
{
IActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IDebugService
,
VIEWLET_ID
,
State
,
BREAKPOINTS_VIEW_ID
,
IDebugConfiguration
,
CONTEXT_DEBUG_UX
,
CONTEXT_DEBUG_UX_KEY
,
REPL_VIEW_ID
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
StartAction
,
ConfigureAction
,
SelectAndStartAction
,
FocusSessionAction
}
from
'
vs/workbench/contrib/debug/browser/debugActions
'
;
import
{
StartDebugActionViewItem
,
FocusSessionActionViewItem
}
from
'
vs/workbench/contrib/debug/browser/debugActionViewItems
'
;
...
...
src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
浏览文件 @
e7279b1c
...
...
@@ -10,7 +10,6 @@ import { Delayer } from 'vs/base/common/async';
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
import
*
as
json
from
'
vs/base/common/json
'
;
import
{
ActionViewItem
,
IActionViewItemOptions
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
dispose
,
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IExtension
,
ExtensionState
,
IExtensionsWorkbenchService
,
VIEWLET_ID
,
IExtensionsViewPaneContainer
,
AutoUpdateConfigurationKey
,
IExtensionContainer
,
EXTENSIONS_CONFIG
,
TOGGLE_IGNORE_EXTENSION_ACTION_ID
}
from
'
vs/workbench/contrib/extensions/common/extensions
'
;
...
...
@@ -61,6 +60,7 @@ import { IFileDialogService, IDialogService } from 'vs/platform/dialogs/common/d
import
{
IProgressService
,
ProgressLocation
}
from
'
vs/platform/progress/common/progress
'
;
import
{
Codicon
}
from
'
vs/base/common/codicons
'
;
import
{
IViewsService
}
from
'
vs/workbench/common/views
'
;
import
{
IActionViewItemOptions
,
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
function
toExtensionDescription
(
local
:
ILocalExtension
):
IExtensionDescription
{
return
{
...
...
src/vs/workbench/contrib/markers/browser/markersTreeViewer.ts
浏览文件 @
e7279b1c
...
...
@@ -16,7 +16,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import
{
attachBadgeStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
IThemeService
,
registerThemingParticipant
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IDisposable
,
dispose
,
Disposable
,
toDisposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
ActionBar
,
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
QuickFixAction
,
QuickFixActionViewItem
}
from
'
vs/workbench/contrib/markers/browser/markersViewActions
'
;
import
{
ILabelService
}
from
'
vs/platform/label/common/label
'
;
import
{
dirname
,
basename
,
isEqual
}
from
'
vs/base/common/resources
'
;
...
...
@@ -52,6 +52,7 @@ import { domEvent } from 'vs/base/browser/event';
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
Progress
}
from
'
vs/platform/progress/common/progress
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
type
TreeElement
=
ResourceMarkers
|
Marker
|
RelatedInformation
;
...
...
src/vs/workbench/contrib/markers/browser/markersView.ts
浏览文件 @
e7279b1c
...
...
@@ -33,7 +33,7 @@ import { deepClone } from 'vs/base/common/objects';
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
FilterData
,
Filter
,
VirtualDelegate
,
ResourceMarkersRenderer
,
MarkerRenderer
,
RelatedInformationRenderer
,
TreeElement
,
MarkersTreeAccessibilityProvider
,
MarkersViewModel
,
ResourceDragAndDrop
}
from
'
vs/workbench/contrib/markers/browser/markersTreeViewer
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
Action
ViewItem
,
Action
Bar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IMenuService
,
MenuId
,
registerAction2
,
Action2
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
StandardKeyboardEvent
,
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
...
...
@@ -50,6 +50,7 @@ import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/vie
import
{
IViewDescriptorService
}
from
'
vs/workbench/common/views
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
Codicon
}
from
'
vs/base/common/codicons
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
function
createResourceMarkersIterator
(
resourceMarkers
:
ResourceMarkers
):
Iterable
<
ITreeElement
<
TreeElement
>>
{
return
Iterable
.
map
(
resourceMarkers
.
markers
,
m
=>
{
...
...
src/vs/workbench/contrib/markers/browser/markersViewActions.ts
浏览文件 @
e7279b1c
...
...
@@ -15,7 +15,7 @@ import Constants from 'vs/workbench/contrib/markers/browser/constants';
import
{
IThemeService
,
registerThemingParticipant
,
ICssStyleCollector
,
IColorTheme
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
attachInputBoxStyler
,
attachStylerCallback
}
from
'
vs/platform/theme/common/styler
'
;
import
{
toDisposable
,
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
BaseActionViewItem
,
ActionViewItem
,
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
badgeBackground
,
badgeForeground
,
contrastBorder
,
inputActiveOptionBorder
,
inputActiveOptionBackground
,
inputActiveOptionForeground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -27,6 +27,7 @@ import { DropdownMenuActionViewItem } from 'vs/base/browser/ui/dropdown/dropdown
import
{
AnchorAlignment
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
import
{
IViewsService
}
from
'
vs/workbench/common/views
'
;
import
{
Codicon
}
from
'
vs/base/common/codicons
'
;
import
{
BaseActionViewItem
,
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
class
ShowProblemsPanelAction
extends
Action
{
...
...
src/vs/workbench/contrib/output/browser/outputView.ts
浏览文件 @
e7279b1c
...
...
@@ -4,8 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
nls
from
'
vs/nls
'
;
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
{
IActionViewItem
,
SelectActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IAction
,
IActionViewItem
}
from
'
vs/base/common/actions
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
IEditorOptions
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
...
...
@@ -37,6 +36,7 @@ import { groupBy } from 'vs/base/common/arrays';
import
{
SIDE_BAR_BACKGROUND
}
from
'
vs/workbench/common/theme
'
;
import
{
editorBackground
,
selectBorder
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
addClass
}
from
'
vs/base/browser/dom
'
;
import
{
SelectActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
class
OutputViewPane
extends
ViewPane
{
...
...
src/vs/workbench/contrib/preferences/browser/preferencesWidgets.ts
浏览文件 @
e7279b1c
...
...
@@ -5,7 +5,7 @@
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
{
IKeyboardEvent
,
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
ActionBar
,
ActionsOrientation
,
BaseActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ActionBar
,
ActionsOrientation
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IInputOptions
,
InputBox
}
from
'
vs/base/browser/ui/inputbox/inputBox
'
;
import
{
Widget
}
from
'
vs/base/browser/ui/widget
'
;
import
{
Action
,
IAction
}
from
'
vs/base/common/actions
'
;
...
...
@@ -36,6 +36,7 @@ import { ISettingsGroup, IPreferencesService } from 'vs/workbench/services/prefe
import
{
EditorOption
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
isEqual
}
from
'
vs/base/common/resources
'
;
import
{
registerIcon
,
Codicon
}
from
'
vs/base/common/codicons
'
;
import
{
BaseActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
class
SettingsHeaderWidget
extends
Widget
implements
IViewZone
{
...
...
src/vs/workbench/contrib/remote/browser/explorerViewItems.ts
浏览文件 @
e7279b1c
...
...
@@ -7,7 +7,6 @@ import * as nls from 'vs/nls';
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
IAction
,
Action
}
from
'
vs/base/common/actions
'
;
import
{
SelectActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
attachSelectBoxStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
...
...
@@ -19,6 +18,7 @@ import { isStringArray } from 'vs/base/common/types';
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
SelectActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
interface
IRemoteSelectItem
extends
ISelectOptionItem
{
authority
:
string
[];
...
...
src/vs/workbench/contrib/remote/browser/tunnelView.ts
浏览文件 @
e7279b1c
...
...
@@ -21,9 +21,9 @@ import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list';
import
{
ITreeRenderer
,
ITreeNode
,
IAsyncDataSource
,
ITreeContextMenuEvent
,
ITreeMouseEvent
}
from
'
vs/base/browser/ui/tree/tree
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
Disposable
,
IDisposable
,
toDisposable
,
MutableDisposable
,
dispose
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
ActionBar
,
ActionViewItem
,
IActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IconLabel
}
from
'
vs/base/browser/ui/iconLabel/iconLabel
'
;
import
{
ActionRunner
,
IAction
}
from
'
vs/base/common/actions
'
;
import
{
ActionRunner
,
IAction
,
IActionViewItem
}
from
'
vs/base/common/actions
'
;
import
{
IMenuService
,
MenuId
,
IMenu
,
MenuRegistry
,
MenuItemAction
,
ILocalizedString
}
from
'
vs/platform/actions/common/actions
'
;
import
{
createAndFillInContextMenuActions
,
createAndFillInActionBarActions
,
ContextAwareMenuEntryActionViewItem
}
from
'
vs/platform/actions/browser/menuEntryActionViewItem
'
;
import
{
IRemoteExplorerService
,
TunnelModel
,
MakeAddress
,
TunnelType
,
ITunnelItem
,
Tunnel
}
from
'
vs/workbench/services/remote/common/remoteExplorerService
'
;
...
...
@@ -41,6 +41,7 @@ import { RemoteTunnel } from 'vs/platform/remote/common/tunnel';
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
KeybindingsRegistry
,
KeybindingWeight
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
export
const
forwardedPortsViewEnabled
=
new
RawContextKey
<
boolean
>
(
'
forwardedPortsViewEnabled
'
,
false
);
...
...
src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts
浏览文件 @
e7279b1c
...
...
@@ -33,8 +33,8 @@ import { rot } from 'vs/base/common/numbers';
import
{
KeybindingsRegistry
,
KeybindingWeight
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
EmbeddedDiffEditorWidget
}
from
'
vs/editor/browser/widget/embeddedCodeEditorWidget
'
;
import
{
IDiffEditorOptions
,
EditorOption
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
Action
,
IAction
,
ActionRunner
}
from
'
vs/base/common/actions
'
;
import
{
IActionBarOptions
,
ActionsOrientation
,
IActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
Action
,
IAction
,
ActionRunner
,
IActionViewItem
}
from
'
vs/base/common/actions
'
;
import
{
IActionBarOptions
,
ActionsOrientation
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
basename
,
isEqualOrParent
}
from
'
vs/base/common/resources
'
;
import
{
MenuId
,
IMenuService
,
IMenu
,
MenuItemAction
,
MenuRegistry
}
from
'
vs/platform/actions/common/actions
'
;
...
...
src/vs/workbench/contrib/scm/browser/scmViewPane.ts
浏览文件 @
e7279b1c
...
...
@@ -23,7 +23,7 @@ import { MenuItemAction, IMenuService } from 'vs/platform/actions/common/actions
import
{
IAction
,
IActionViewItem
,
ActionRunner
,
Action
,
RadioGroup
,
Separator
,
SubmenuAction
}
from
'
vs/base/common/actions
'
;
import
{
ContextAwareMenuEntryActionViewItem
}
from
'
vs/platform/actions/browser/menuEntryActionViewItem
'
;
import
{
SCMMenus
}
from
'
./menus
'
;
import
{
ActionBar
,
IActionViewItemProvider
,
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ActionBar
,
IActionViewItemProvider
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IThemeService
,
LIGHT
,
registerThemingParticipant
,
IFileIconTheme
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
isSCMResource
,
isSCMResourceGroup
,
connectPrimaryMenuToInlineActionBar
,
isSCMRepository
,
isSCMInput
,
connectPrimaryMenu
}
from
'
./util
'
;
import
{
attachBadgeStyler
}
from
'
vs/platform/theme/common/styler
'
;
...
...
@@ -80,6 +80,7 @@ import { ToolBar } from 'vs/base/browser/ui/toolbar/toolbar';
import
{
AnchorAlignment
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
import
{
domEvent
}
from
'
vs/base/browser/event
'
;
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
type
TreeElement
=
ISCMRepository
|
ISCMInput
|
ISCMResourceGroup
|
IResourceNode
<
ISCMResource
,
ISCMResourceGroup
>
|
ISCMResource
;
...
...
src/vs/workbench/contrib/terminal/browser/terminalActions.ts
浏览文件 @
e7279b1c
...
...
@@ -7,7 +7,6 @@ import { Action, IAction } from 'vs/base/common/actions';
import
{
EndOfLinePreference
}
from
'
vs/editor/common/model
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/browser/services/codeEditorService
'
;
import
{
TERMINAL_VIEW_ID
,
ITerminalConfigHelper
,
TitleEventSource
,
TERMINAL_COMMAND_ID
,
KEYBINDING_CONTEXT_TERMINAL_FIND_FOCUSED
,
TERMINAL_ACTION_CATEGORY
,
KEYBINDING_CONTEXT_TERMINAL_FOCUS
,
KEYBINDING_CONTEXT_TERMINAL_FIND_VISIBLE
,
KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED
,
KEYBINDING_CONTEXT_TERMINAL_FIND_NOT_VISIBLE
,
KEYBINDING_CONTEXT_TERMINAL_A11Y_TREE_FOCUS
}
from
'
vs/workbench/contrib/terminal/common/terminal
'
;
import
{
SelectActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IWorkbenchLayoutService
}
from
'
vs/workbench/services/layout/browser/layoutService
'
;
import
{
attachSelectBoxStyler
,
attachStylerCallback
}
from
'
vs/platform/theme/common/styler
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
...
...
@@ -39,6 +38,7 @@ import { localize } from 'vs/nls';
import
{
CONTEXT_ACCESSIBILITY_MODE_ENABLED
}
from
'
vs/platform/accessibility/common/accessibility
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
ITerminalContributionService
}
from
'
vs/workbench/contrib/terminal/common/terminalExtensionPoints
'
;
import
{
SelectActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
async
function
getCwdForSplit
(
configHelper
:
ITerminalConfigHelper
,
instance
:
ITerminalInstance
,
folders
?:
IWorkspaceFolder
[],
commandService
?:
ICommandService
):
Promise
<
string
|
URI
|
undefined
>
{
switch
(
configHelper
.
config
.
splitCwd
)
{
...
...
src/vs/workbench/contrib/terminal/browser/terminalView.ts
浏览文件 @
e7279b1c
...
...
@@ -6,8 +6,7 @@
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
{
Action
,
IAction
,
Separator
}
from
'
vs/base/common/actions
'
;
import
{
IActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
Action
,
IAction
,
Separator
,
IActionViewItem
}
from
'
vs/base/common/actions
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
src/vs/workbench/contrib/timeline/browser/timelinePane.ts
浏览文件 @
e7279b1c
...
...
@@ -36,10 +36,11 @@ import { IThemeService, LIGHT, ThemeIcon } from 'vs/platform/theme/common/themeS
import
{
IViewDescriptorService
}
from
'
vs/workbench/common/views
'
;
import
{
IProgressService
}
from
'
vs/platform/progress/common/progress
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
IActionViewItemProvider
,
ActionBar
,
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IActionViewItemProvider
,
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ContextAwareMenuEntryActionViewItem
,
createAndFillInContextMenuActions
}
from
'
vs/platform/actions/browser/menuEntryActionViewItem
'
;
import
{
MenuItemAction
,
IMenuService
,
MenuId
,
registerAction2
,
Action2
,
MenuRegistry
}
from
'
vs/platform/actions/common/actions
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
const
ItemHeight
=
22
;
...
...
src/vs/workbench/contrib/views/browser/treeView.ts
浏览文件 @
e7279b1c
...
...
@@ -21,7 +21,7 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
{
ResourceLabels
,
IResourceLabel
}
from
'
vs/workbench/browser/labels
'
;
import
{
ActionBar
,
IActionViewItemProvider
,
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ActionBar
,
IActionViewItemProvider
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
dirname
,
basename
}
from
'
vs/base/common/resources
'
;
import
{
LIGHT
,
FileThemeIcon
,
FolderThemeIcon
,
registerThemingParticipant
,
ThemeIcon
,
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
...
...
@@ -39,6 +39,7 @@ import { CollapseAllAction } from 'vs/base/browser/ui/tree/treeDefaults';
import
{
isFalsyOrWhitespace
}
from
'
vs/base/common/strings
'
;
import
{
SIDE_BAR_BACKGROUND
,
PANEL_BACKGROUND
}
from
'
vs/workbench/common/theme
'
;
import
{
IHoverService
,
IHoverOptions
}
from
'
vs/workbench/services/hover/browser/hover
'
;
import
{
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
class
Root
implements
ITreeItem
{
label
=
{
label
:
'
root
'
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录