Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ce565938
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,发现更多精彩内容 >>
提交
ce565938
编写于
6月 14, 2016
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up Search viewlet - Pattern input widget
上级
13248eab
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
26 addition
and
23 deletion
+26
-23
src/vs/workbench/parts/search/browser/patternInputWidget.ts
src/vs/workbench/parts/search/browser/patternInputWidget.ts
+18
-18
src/vs/workbench/parts/search/browser/searchViewlet.ts
src/vs/workbench/parts/search/browser/searchViewlet.ts
+8
-5
未找到文件。
src/vs/workbench/parts/search/browser/patternInputWidget.ts
浏览文件 @
ce565938
...
...
@@ -6,6 +6,7 @@
import
nls
=
require
(
'
vs/nls
'
);
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
{
$
}
from
'
vs/base/browser/builder
'
;
import
{
Widget
}
from
'
vs/base/browser/ui/widget
'
;
import
{
IExpression
,
splitGlobAware
}
from
'
vs/base/common/glob
'
;
import
{
Checkbox
}
from
'
vs/base/browser/ui/checkbox/checkbox
'
;
import
{
IContextViewProvider
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
...
...
@@ -18,57 +19,56 @@ export interface IOptions {
ariaLabel
?:
string
;
}
export
class
PatternInput
{
export
class
PatternInput
Widget
extends
Widget
{
static
OPTION_CHANGE
:
string
=
'
optionChange
'
;
private
contextViewProvider
:
IContextViewProvider
;
private
onOptionChange
:
(
event
:
Event
)
=>
void
;
private
width
:
number
;
private
placeholder
:
string
;
private
ariaLabel
:
string
;
private
listenersToRemov
e
:
any
[];
private
toDispos
e
:
any
[];
private
pattern
:
Checkbox
;
public
domNode
:
HTMLElement
;
private
domNode
:
HTMLElement
;
private
inputNode
:
HTMLInputElement
;
private
inputBox
:
InputBox
;
constructor
(
parent
:
HTMLElement
,
contextViewProvider
:
IContextViewProvider
,
options
:
IOptions
=
Object
.
create
(
null
))
{
this
.
contextViewProvider
=
contextViewProvider
;
constructor
(
parent
:
HTMLElement
,
private
contextViewProvider
:
IContextViewProvider
,
options
:
IOptions
=
Object
.
create
(
null
))
{
super
()
;
this
.
onOptionChange
=
null
;
this
.
width
=
options
.
width
||
100
;
this
.
placeholder
=
options
.
placeholder
||
''
;
this
.
ariaLabel
=
options
.
ariaLabel
||
nls
.
localize
(
'
defaultLabel
'
,
"
input
"
);
this
.
listenersToRemov
e
=
[];
this
.
toDispos
e
=
[];
this
.
pattern
=
null
;
this
.
domNode
=
null
;
this
.
inputNode
=
null
;
this
.
inputBox
=
null
;
this
.
buildDomNode
();
this
.
render
();
if
(
Boolean
(
parent
))
{
parent
.
appendChild
(
this
.
domNode
);
}
}
public
destroy
():
void
{
public
dispose
():
void
{
super
.
dispose
();
this
.
pattern
.
dispose
();
this
.
listenersToRemov
e
.
forEach
((
element
)
=>
{
this
.
toDispos
e
.
forEach
((
element
)
=>
{
element
();
});
this
.
listenersToRemov
e
=
[];
this
.
toDispos
e
=
[];
}
public
on
(
eventType
:
string
,
handler
:
(
event
:
Event
)
=>
void
):
PatternInput
{
public
on
(
eventType
:
string
,
handler
:
(
event
:
Event
)
=>
void
):
PatternInput
Widget
{
switch
(
eventType
)
{
case
'
keydown
'
:
case
'
keyup
'
:
$
(
this
.
inputBox
.
inputElement
).
on
(
eventType
,
handler
);
break
;
case
PatternInput
.
OPTION_CHANGE
:
case
PatternInput
Widget
.
OPTION_CHANGE
:
this
.
onOptionChange
=
handler
;
break
;
}
...
...
@@ -140,7 +140,7 @@ export class PatternInput {
this
.
inputBox
.
width
=
w
;
}
private
buildDomNode
():
void
{
private
render
():
void
{
this
.
domNode
=
document
.
createElement
(
'
div
'
);
this
.
domNode
.
style
.
width
=
this
.
width
+
'
px
'
;
$
(
this
.
domNode
).
addClass
(
'
monaco-findInput
'
);
...
...
src/vs/workbench/parts/search/browser/searchViewlet.ts
浏览文件 @
ce565938
...
...
@@ -49,7 +49,7 @@ import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
import
{
IKeybindingService
,
IKeybindingContextKey
}
from
'
vs/platform/keybinding/common/keybindingService
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
KeyCode
,
CommonKeybindings
}
from
'
vs/base/common/keyCodes
'
;
import
{
PatternInput
}
from
'
vs/workbench/parts/search/browser/patternInputWidget
'
;
import
{
PatternInput
Widget
}
from
'
vs/workbench/parts/search/browser/patternInputWidget
'
;
import
{
SearchRenderer
,
SearchDataSource
,
SearchSorter
,
SearchController
,
SearchAccessibilityProvider
,
SearchFilter
}
from
'
vs/workbench/parts/search/browser/searchResultsView
'
;
import
{
RefreshAction
,
SelectOrRemoveAction
,
CollapseAllAction
,
ClearSearchResultsAction
,
ConfigureGlobalExclusionsAction
}
from
'
vs/workbench/parts/search/browser/searchActions
'
;
...
...
@@ -74,10 +74,10 @@ export class SearchViewlet extends Viewlet {
private
findInput
:
FindInput
;
private
size
:
Dimension
;
private
queryDetails
:
HTMLElement
;
private
inputPatternExclusions
:
PatternInput
;
private
inputPatternExclusions
:
PatternInput
Widget
;
private
inputPatternGlobalExclusions
:
InputBox
;
private
inputPatternGlobalExclusionsContainer
:
Builder
;
private
inputPatternIncludes
:
PatternInput
;
private
inputPatternIncludes
:
PatternInput
Widget
;
private
results
:
Builder
;
constructor
(
...
...
@@ -211,7 +211,7 @@ export class SearchViewlet extends Viewlet {
let
title
=
nls
.
localize
(
'
searchScope.includes
'
,
"
files to include
"
);
builder
.
element
(
'
h4
'
,
{
text
:
title
});
this
.
inputPatternIncludes
=
new
PatternInput
(
builder
.
getContainer
(),
this
.
contextViewService
,
{
this
.
inputPatternIncludes
=
new
PatternInput
Widget
(
builder
.
getContainer
(),
this
.
contextViewService
,
{
ariaLabel
:
nls
.
localize
(
'
label.includes
'
,
'
Search Include Patterns
'
)
});
...
...
@@ -241,7 +241,7 @@ export class SearchViewlet extends Viewlet {
let
title
=
nls
.
localize
(
'
searchScope.excludes
'
,
"
files to exclude
"
);
builder
.
element
(
'
h4
'
,
{
text
:
title
});
this
.
inputPatternExclusions
=
new
PatternInput
(
builder
.
getContainer
(),
this
.
contextViewService
,
{
this
.
inputPatternExclusions
=
new
PatternInput
Widget
(
builder
.
getContainer
(),
this
.
contextViewService
,
{
ariaLabel
:
nls
.
localize
(
'
label.excludes
'
,
'
Search Exclude Patterns
'
)
});
...
...
@@ -910,6 +910,9 @@ export class SearchViewlet extends Viewlet {
this
.
tree
.
dispose
();
}
this
.
inputPatternIncludes
.
dispose
();
this
.
inputPatternExclusions
.
dispose
();
this
.
disposeModel
();
super
.
dispose
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录