Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ff1aeddb
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ff1aeddb
编写于
9月 18, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #33406
上级
31419e26
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
50 addition
and
19 deletion
+50
-19
src/vs/workbench/browser/parts/views/customView.ts
src/vs/workbench/browser/parts/views/customView.ts
+19
-6
src/vs/workbench/browser/parts/views/media/views.css
src/vs/workbench/browser/parts/views/media/views.css
+31
-13
未找到文件。
src/vs/workbench/browser/parts/views/customView.ts
浏览文件 @
ff1aeddb
...
...
@@ -34,6 +34,7 @@ import { FileKind } from 'vs/platform/files/common/files';
import
{
WorkbenchTreeController
}
from
'
vs/platform/list/browser/listService
'
;
import
{
ViewletPanel
,
IViewletPanelOptions
}
from
'
vs/workbench/browser/parts/views/panelViewlet
'
;
import
{
IMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
localize
}
from
'
vs/nls
'
;
export
class
CustomTreeViewPanel
extends
ViewletPanel
{
...
...
@@ -176,7 +177,9 @@ export class CustomTreeViewer extends Disposable implements ITreeViewer {
private
_hasIconForParentNode
=
false
;
private
_hasIconForLeafNode
=
false
;
private
domNode
:
HTMLElement
;
private
treeContainer
:
HTMLElement
;
private
message
:
HTMLDivElement
;
private
tree
:
FileIconThemableWorkbenchTree
;
private
root
:
ITreeItem
;
private
elementsToRefresh
:
ITreeItem
[]
=
[];
...
...
@@ -213,6 +216,8 @@ export class CustomTreeViewer extends Disposable implements ITreeViewer {
this
.
doRefresh
([
this
.
root
]);
/** soft refresh **/
}
}));
this
.
create
();
}
get
dataProvider
():
ITreeViewDataProvider
{
...
...
@@ -233,10 +238,13 @@ export class CustomTreeViewer extends Disposable implements ITreeViewer {
});
}
};
DOM
.
removeClass
(
this
.
domNode
,
'
message
'
);
this
.
refresh
();
}
else
{
this
.
_dataProvider
=
null
;
DOM
.
addClass
(
this
.
domNode
,
'
message
'
);
this
.
message
.
innerText
=
localize
(
'
no-dataprovider
'
,
"
There is no data provider registered that can provide view data.
"
);
}
this
.
refresh
();
}
get
hasIconForParentNode
():
boolean
{
...
...
@@ -301,11 +309,16 @@ export class CustomTreeViewer extends Disposable implements ITreeViewer {
if
(
!
this
.
tree
)
{
this
.
createTree
();
}
DOM
.
append
(
container
,
this
.
treeContainer
);
DOM
.
append
(
container
,
this
.
domNode
);
}
private
create
()
{
this
.
domNode
=
DOM
.
$
(
'
.tree-explorer-viewlet-tree-view
'
);
this
.
message
=
DOM
.
append
(
this
.
domNode
,
DOM
.
$
(
'
.customview-message
'
));
this
.
treeContainer
=
DOM
.
append
(
this
.
domNode
,
DOM
.
$
(
'
.customview-tree
'
));
}
private
createTree
()
{
this
.
treeContainer
=
DOM
.
$
(
'
.tree-explorer-viewlet-tree-view
'
);
const
actionItemProvider
=
(
action
:
IAction
)
=>
action
instanceof
MenuItemAction
?
this
.
instantiationService
.
createInstance
(
ContextAwareMenuItemActionItem
,
action
)
:
undefined
;
const
menus
=
this
.
instantiationService
.
createInstance
(
TreeMenus
,
this
.
id
);
const
dataSource
=
this
.
instantiationService
.
createInstance
(
TreeDataSource
,
this
,
this
.
container
);
...
...
@@ -322,8 +335,8 @@ export class CustomTreeViewer extends Disposable implements ITreeViewer {
}
layout
(
size
:
number
)
{
this
.
domNode
.
style
.
height
=
size
+
'
px
'
;
if
(
this
.
tree
)
{
this
.
treeContainer
.
style
.
height
=
size
+
'
px
'
;
this
.
tree
.
layout
(
size
);
}
}
...
...
@@ -338,7 +351,7 @@ export class CustomTreeViewer extends Disposable implements ITreeViewer {
}
refresh
(
elements
?:
ITreeItem
[]):
TPromise
<
void
>
{
if
(
this
.
tree
)
{
if
(
this
.
dataProvider
&&
this
.
tree
)
{
elements
=
elements
||
[
this
.
root
];
for
(
const
element
of
elements
)
{
element
.
children
=
null
;
// reset children
...
...
@@ -353,7 +366,7 @@ export class CustomTreeViewer extends Disposable implements ITreeViewer {
}
reveal
(
item
:
ITreeItem
,
parentChain
:
ITreeItem
[],
options
?:
{
select
?:
boolean
,
focus
?:
boolean
}):
TPromise
<
void
>
{
if
(
this
.
tree
&&
this
.
isVisible
)
{
if
(
this
.
dataProvider
&&
this
.
tree
&&
this
.
isVisible
)
{
options
=
options
?
options
:
{
select
:
false
,
focus
:
false
};
const
select
=
isUndefinedOrNull
(
options
.
select
)
?
false
:
options
.
select
;
const
focus
=
isUndefinedOrNull
(
options
.
focus
)
?
false
:
options
.
focus
;
...
...
src/vs/workbench/browser/parts/views/media/views.css
浏览文件 @
ff1aeddb
...
...
@@ -50,19 +50,37 @@
display
:
none
;
}
.
tree-explorer-viewlet-tree-view.file-icon-themable-tree
.monaco-tree-row
.content.align-icon-with-twisty
::befor
e
{
.
monaco-workbench
.tree-explorer-viewlet-tree-view
.customview-messag
e
{
display
:
none
;
padding
:
10px
22px
0
22px
;
opacity
:
0.5
;
}
.tree-explorer-viewlet-tree-view.file-icon-themable-tree
.monaco-tree-row
.content
:not
(
.align-icon-with-twisty
)
::before
{
.monaco-workbench
.tree-explorer-viewlet-tree-view.message
.customview-message
{
display
:
inherit
;
}
.monaco-workbench
.tree-explorer-viewlet-tree-view.message
.customview-tree
{
display
:
none
;
}
.monaco-workbench
.tree-explorer-viewlet-tree-view
.customview-tree
{
height
:
100%
;
}
.customview-tree.file-icon-themable-tree
.monaco-tree-row
.content.align-icon-with-twisty
::before
{
display
:
none
;
}
.customview-tree.file-icon-themable-tree
.monaco-tree-row
.content
:not
(
.align-icon-with-twisty
)
::before
{
display
:
inline-block
;
}
.
tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row
{
.
customview-tree
.monaco-tree
.monaco-tree-row
{
padding-right
:
12px
;
}
.
tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
{
.
customview-tree
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
{
display
:
flex
;
height
:
22px
;
line-height
:
22px
;
...
...
@@ -72,13 +90,13 @@
flex-wrap
:
nowrap
}
.
tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
.custom-view-tree-node-item-resourceLabel
{
.
customview-tree
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
.custom-view-tree-node-item-resourceLabel
{
flex
:
1
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
}
.
tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
>
.custom-view-tree-node-item-icon
{
.
customview-tree
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
>
.custom-view-tree-node-item-icon
{
background-size
:
16px
;
background-position
:
left
center
;
background-repeat
:
no-repeat
;
...
...
@@ -88,25 +106,25 @@
-webkit-font-smoothing
:
antialiased
;
}
.
tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
>
.custom-view-tree-node-item-resourceLabel
.monaco-icon-label-description-container
{
.
customview-tree
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
>
.custom-view-tree-node-item-resourceLabel
.monaco-icon-label-description-container
{
flex
:
1
;
}
.
tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
>
.custom-view-tree-node-item-resourceLabel
::after
{
.
customview-tree
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
>
.custom-view-tree-node-item-resourceLabel
::after
{
padding-right
:
0px
;
}
.
tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
>
.custom-view-tree-node-item-resourceLabel
>
.actions
{
.
customview-tree
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
>
.custom-view-tree-node-item-resourceLabel
>
.actions
{
display
:
none
;
}
.
tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row
:hover
.custom-view-tree-node-item
>
.custom-view-tree-node-item-resourceLabel
>
.actions
,
.
tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row.selected
.custom-view-tree-node-item
>
.custom-view-tree-node-item-resourceLabel
>
.actions
,
.
tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row.focused
.custom-view-tree-node-item
>
.custom-view-tree-node-item-resourceLabel
>
.actions
{
.
customview-tree
.monaco-tree
.monaco-tree-row
:hover
.custom-view-tree-node-item
>
.custom-view-tree-node-item-resourceLabel
>
.actions
,
.
customview-tree
.monaco-tree
.monaco-tree-row.selected
.custom-view-tree-node-item
>
.custom-view-tree-node-item-resourceLabel
>
.actions
,
.
customview-tree
.monaco-tree
.monaco-tree-row.focused
.custom-view-tree-node-item
>
.custom-view-tree-node-item-resourceLabel
>
.actions
{
display
:
block
;
}
.
tree-explorer-viewlet-tree-view
.monaco-tree
.custom-view-tree-node-item
>
.custom-view-tree-node-item-resourceLabel
>
.actions
.action-label
{
.
customview-tree
.monaco-tree
.custom-view-tree-node-item
>
.custom-view-tree-node-item-resourceLabel
>
.actions
.action-label
{
width
:
16px
;
height
:
100%
;
background-position
:
50%
50%
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录