Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
2d451110
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,发现更多精彩内容 >>
提交
2d451110
编写于
1月 09, 2019
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
list: finish dnd
上级
0fd082df
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
71 addition
and
72 deletion
+71
-72
src/vs/base/browser/dnd.ts
src/vs/base/browser/dnd.ts
+14
-1
src/vs/base/browser/ui/list/list.ts
src/vs/base/browser/ui/list/list.ts
+2
-6
src/vs/base/browser/ui/list/listView.ts
src/vs/base/browser/ui/list/listView.ts
+22
-17
src/vs/base/browser/ui/tree/abstractTree.ts
src/vs/base/browser/ui/tree/abstractTree.ts
+2
-2
src/vs/base/browser/ui/tree/asyncDataTree.ts
src/vs/base/browser/ui/tree/asyncDataTree.ts
+2
-2
src/vs/base/parts/tree/browser/tree.ts
src/vs/base/parts/tree/browser/tree.ts
+1
-5
src/vs/base/parts/tree/browser/treeDefaults.ts
src/vs/base/parts/tree/browser/treeDefaults.ts
+4
-3
src/vs/base/parts/tree/browser/treeDnd.ts
src/vs/base/parts/tree/browser/treeDnd.ts
+11
-11
src/vs/base/parts/tree/browser/treeView.ts
src/vs/base/parts/tree/browser/treeView.ts
+8
-10
src/vs/workbench/browser/dnd.ts
src/vs/workbench/browser/dnd.ts
+2
-2
src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts
...ench/parts/files/electron-browser/views/explorerViewer.ts
+2
-2
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
+1
-11
未找到文件。
src/vs/base/browser/dnd.ts
浏览文件 @
2d451110
...
...
@@ -83,4 +83,17 @@ export function applyDragImage(event: DragEvent, label: string, clazz: string):
// Removes the element when the DND operation is done
setTimeout
(()
=>
document
.
body
.
removeChild
(
dragImage
),
0
);
}
}
\ No newline at end of file
}
export
interface
IDragAndDropData
{
update
(
dataTransfer
:
DataTransfer
):
void
;
getData
():
any
;
}
export
interface
IStaticDND
{
CurrentDragAndDropData
:
IDragAndDropData
|
undefined
;
}
export
const
StaticDND
:
IStaticDND
=
{
CurrentDragAndDropData
:
undefined
};
\ No newline at end of file
src/vs/base/browser/ui/list/list.ts
浏览文件 @
2d451110
...
...
@@ -7,6 +7,7 @@ import { GestureEvent } from 'vs/base/browser/touch';
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDragAndDropData
}
from
'
vs/base/browser/dnd
'
;
export
interface
IListVirtualDelegate
<
T
>
{
getHeight
(
element
:
T
):
number
;
...
...
@@ -95,17 +96,12 @@ export const DragOverReactions = {
// acceptCopyBubbleDown(autoExpand = false): IDragOverReaction { return { accept: true, bubble: DragOverBubble.Down, effect: DragOverEffect.Copy, autoExpand }; }
};
export
interface
IDragAndDropData
{
update
(
dataTransfer
:
DataTransfer
):
void
;
getData
():
any
;
}
export
interface
IDragAndDrop
<
T
>
{
getDragURI
(
element
:
T
):
string
|
null
;
getDragLabel
?(
elements
:
T
[]):
string
;
onDragStart
(
data
:
IDragAndDropData
,
originalEvent
:
DragEvent
):
void
;
onDragOver
(
data
:
IDragAndDropData
,
targetElement
:
T
|
undefined
,
targetIndex
:
number
|
undefined
,
originalEvent
:
DragEvent
):
boolean
|
IDragOverReaction
;
drop
(
data
:
IDragAndDropData
,
targetElement
:
T
|
undefined
,
originalEvent
:
DragEvent
):
void
;
drop
(
data
:
IDragAndDropData
,
targetElement
:
T
|
undefined
,
targetIndex
:
number
|
undefined
,
originalEvent
:
DragEvent
):
void
;
}
/**
...
...
src/vs/base/browser/ui/list/listView.ts
浏览文件 @
2d451110
...
...
@@ -12,7 +12,7 @@ import { domEvent } from 'vs/base/browser/event';
import
{
ScrollableElement
}
from
'
vs/base/browser/ui/scrollbar/scrollableElement
'
;
import
{
ScrollEvent
,
ScrollbarVisibility
,
INewScrollDimensions
}
from
'
vs/base/common/scrollable
'
;
import
{
RangeMap
,
shift
}
from
'
./rangeMap
'
;
import
{
IListVirtualDelegate
,
IListRenderer
,
IListMouseEvent
,
IListTouchEvent
,
IListGestureEvent
,
IListDragEvent
,
IDragAndDrop
,
IDragAndDropData
}
from
'
./list
'
;
import
{
IListVirtualDelegate
,
IListRenderer
,
IListMouseEvent
,
IListTouchEvent
,
IListGestureEvent
,
IListDragEvent
,
IDragAndDrop
,
DragOverEffect
}
from
'
./list
'
;
import
{
RowCache
,
IRow
}
from
'
./rowCache
'
;
import
{
isWindows
}
from
'
vs/base/common/platform
'
;
import
*
as
browser
from
'
vs/base/browser/browser
'
;
...
...
@@ -20,7 +20,7 @@ import { ISpliceable } from 'vs/base/common/sequence';
import
{
memoize
}
from
'
vs/base/common/decorators
'
;
import
{
Range
,
IRange
}
from
'
vs/base/common/range
'
;
import
{
equals
,
distinct
}
from
'
vs/base/common/arrays
'
;
import
{
DataTransfers
}
from
'
vs/base/browser/dnd
'
;
import
{
DataTransfers
,
StaticDND
,
IDragAndDropData
}
from
'
vs/base/browser/dnd
'
;
function
canUseTranslate3d
():
boolean
{
if
(
browser
.
isFirefox
)
{
...
...
@@ -154,8 +154,6 @@ function equalsDragFeedback(f1: number[] | undefined, f2: number[] | undefined):
export
class
ListView
<
T
>
implements
ISpliceable
<
T
>
,
IDisposable
{
private
static
currentExternalDragAndDropData
:
IDragAndDropData
|
undefined
;
readonly
domNode
:
HTMLElement
;
private
items
:
IItem
<
T
>
[];
...
...
@@ -629,14 +627,12 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
}
this
.
currentDragData
=
new
ElementsDragAndDropData
(
elements
);
ListView
.
currentExternal
DragAndDropData
=
new
ExternalElementsDragAndDropData
(
elements
);
StaticDND
.
Current
DragAndDropData
=
new
ExternalElementsDragAndDropData
(
elements
);
this
.
dnd
.
onDragStart
(
this
.
currentDragData
,
event
);
}
private
onDragOver
(
event
:
IListDragEvent
<
T
>
):
boolean
{
console
.
log
(
'
DRAG OVER
'
);
this
.
onDragLeaveTimeout
.
dispose
();
this
.
setupDragAndDropScrollTopAnimation
(
event
.
browserEvent
);
...
...
@@ -646,9 +642,9 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
// Drag over from outside
if
(
!
this
.
currentDragData
)
{
if
(
ListView
.
currentExternal
DragAndDropData
)
{
if
(
StaticDND
.
Current
DragAndDropData
)
{
// Drag over from another list
this
.
currentDragData
=
ListView
.
currentExternal
DragAndDropData
;
this
.
currentDragData
=
StaticDND
.
Current
DragAndDropData
;
}
else
{
// Drag over from the desktop
...
...
@@ -662,12 +658,13 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
const
result
=
this
.
dnd
.
onDragOver
(
this
.
currentDragData
,
event
.
element
,
event
.
index
,
event
.
browserEvent
);
const
canDrop
=
typeof
result
===
'
boolean
'
?
result
:
result
.
accept
;
// const reaction = (typeof result !== 'boolean' && result.effect === DragOverEffect.Copy) ? 'copy' : 'move';
if
(
!
canDrop
)
{
return
false
;
}
event
.
browserEvent
.
dataTransfer
.
dropEffect
=
(
typeof
result
!==
'
boolean
'
&&
result
.
effect
===
DragOverEffect
.
Copy
)
?
'
copy
'
:
'
move
'
;
let
feedback
:
number
[];
if
(
typeof
result
!==
'
boolean
'
&&
result
.
feedback
)
{
...
...
@@ -692,8 +689,6 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
return
true
;
}
console
.
log
(
this
.
currentDragFeedback
,
feedback
);
this
.
currentDragFeedback
=
feedback
;
this
.
currentDragFeedbackDisposable
.
dispose
();
...
...
@@ -725,21 +720,31 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
return
true
;
}
private
onDragLeave
(
event
:
DragEvent
):
void
{
console
.
log
(
'
LEAVE
'
);
private
onDragLeave
():
void
{
this
.
onDragLeaveTimeout
=
DOM
.
timeout
(()
=>
this
.
clearDragOverFeedback
(),
100
);
}
private
onDrop
(
e
:
IListDragEvent
<
T
>
):
void
{
cons
ole
.
log
(
'
DROP
'
)
;
private
onDrop
(
e
vent
:
IListDragEvent
<
T
>
):
void
{
cons
t
dragData
=
this
.
currentDragData
;
this
.
teardownDragAndDropScrollTopAnimation
();
this
.
clearDragOverFeedback
();
this
.
currentDragData
=
undefined
;
StaticDND
.
CurrentDragAndDropData
=
undefined
;
if
(
!
dragData
||
!
event
.
browserEvent
.
dataTransfer
)
{
return
;
}
event
.
browserEvent
.
preventDefault
();
dragData
.
update
(
event
.
browserEvent
.
dataTransfer
);
this
.
dnd
.
drop
(
dragData
,
event
.
element
,
event
.
index
,
event
.
browserEvent
);
}
private
onDragEnd
():
void
{
console
.
log
(
'
DRAG END
'
);
this
.
teardownDragAndDropScrollTopAnimation
();
this
.
clearDragOverFeedback
();
this
.
currentDragData
=
undefined
;
StaticDND
.
CurrentDragAndDropData
=
undefined
;
}
private
clearDragOverFeedback
():
void
{
...
...
src/vs/base/browser/ui/tree/abstractTree.ts
浏览文件 @
2d451110
...
...
@@ -35,8 +35,8 @@ function asListOptions<T, TFilterData>(options?: IAbstractTreeOptions<T, TFilter
onDragOver
(
data
,
targetNode
,
targetIndex
,
originalEvent
)
{
return
options
.
dnd
!
.
onDragOver
(
data
,
targetNode
&&
targetNode
.
element
,
targetIndex
,
originalEvent
);
},
drop
(
data
,
targetNode
,
originalEvent
)
{
return
options
.
dnd
!
.
drop
(
data
,
targetNode
&&
targetNode
.
element
,
originalEvent
);
drop
(
data
,
targetNode
,
targetIndex
,
originalEvent
)
{
return
options
.
dnd
!
.
drop
(
data
,
targetNode
&&
targetNode
.
element
,
targetIndex
,
originalEvent
);
}
},
multipleSelectionController
:
options
.
multipleSelectionController
&&
{
...
...
src/vs/base/browser/ui/tree/asyncDataTree.ts
浏览文件 @
2d451110
...
...
@@ -143,8 +143,8 @@ function asObjectTreeOptions<TInput, T, TFilterData>(options?: IAsyncDataTreeOpt
onDragOver
(
data
,
targetNode
,
targetIndex
,
originalEvent
)
{
return
options
.
dnd
!
.
onDragOver
(
data
,
targetNode
&&
targetNode
.
element
as
T
,
targetIndex
,
originalEvent
);
},
drop
(
data
,
targetNode
,
originalEvent
)
{
return
options
.
dnd
!
.
drop
(
data
,
targetNode
&&
targetNode
.
element
as
T
,
originalEvent
);
drop
(
data
,
targetNode
,
targetIndex
,
originalEvent
)
{
return
options
.
dnd
!
.
drop
(
data
,
targetNode
&&
targetNode
.
element
as
T
,
targetIndex
,
originalEvent
);
}
},
multipleSelectionController
:
options
.
multipleSelectionController
&&
{
...
...
src/vs/base/parts/tree/browser/tree.ts
浏览文件 @
2d451110
...
...
@@ -12,6 +12,7 @@ import { Event } from 'vs/base/common/event';
import
{
IAction
,
IActionItem
}
from
'
vs/base/common/actions
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
IItemCollapseEvent
,
IItemExpandEvent
}
from
'
vs/base/parts/tree/browser/treeModel
'
;
import
{
IDragAndDropData
}
from
'
vs/base/browser/dnd
'
;
export
interface
ITree
{
...
...
@@ -593,11 +594,6 @@ export const DRAG_OVER_ACCEPT_BUBBLE_DOWN = (autoExpand = false) => ({ accept: t
export
const
DRAG_OVER_ACCEPT_BUBBLE_UP_COPY
:
IDragOverReaction
=
{
accept
:
true
,
bubble
:
DragOverBubble
.
BUBBLE_UP
,
effect
:
DragOverEffect
.
COPY
};
export
const
DRAG_OVER_ACCEPT_BUBBLE_DOWN_COPY
=
(
autoExpand
=
false
)
=>
({
accept
:
true
,
bubble
:
DragOverBubble
.
BUBBLE_DOWN
,
effect
:
DragOverEffect
.
COPY
,
autoExpand
});
export
interface
IDragAndDropData
{
update
(
event
:
Mouse
.
DragMouseEvent
):
void
;
getData
():
any
;
}
export
interface
IDragAndDrop
{
/**
...
...
src/vs/base/parts/tree/browser/treeDefaults.ts
浏览文件 @
2d451110
...
...
@@ -13,6 +13,7 @@ import * as mouse from 'vs/base/browser/mouseEvent';
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
*
as
_
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
KeyCode
,
KeyMod
,
Keybinding
,
createKeybinding
,
SimpleKeybinding
,
createSimpleKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
IDragAndDropData
}
from
'
vs/base/browser/dnd
'
;
export
interface
IKeyBindingCallback
{
(
tree
:
_
.
ITree
,
event
:
IKeyboardEvent
):
void
;
...
...
@@ -434,15 +435,15 @@ export class DefaultDragAndDrop implements _.IDragAndDrop {
return
null
;
}
public
onDragStart
(
tree
:
_
.
ITree
,
data
:
_
.
IDragAndDropData
,
originalEvent
:
mouse
.
DragMouseEvent
):
void
{
public
onDragStart
(
tree
:
_
.
ITree
,
data
:
IDragAndDropData
,
originalEvent
:
mouse
.
DragMouseEvent
):
void
{
return
;
}
public
onDragOver
(
tree
:
_
.
ITree
,
data
:
_
.
IDragAndDropData
,
targetElement
:
any
,
originalEvent
:
mouse
.
DragMouseEvent
):
_
.
IDragOverReaction
|
null
{
public
onDragOver
(
tree
:
_
.
ITree
,
data
:
IDragAndDropData
,
targetElement
:
any
,
originalEvent
:
mouse
.
DragMouseEvent
):
_
.
IDragOverReaction
|
null
{
return
null
;
}
public
drop
(
tree
:
_
.
ITree
,
data
:
_
.
IDragAndDropData
,
targetElement
:
any
,
originalEvent
:
mouse
.
DragMouseEvent
):
void
{
public
drop
(
tree
:
_
.
ITree
,
data
:
IDragAndDropData
,
targetElement
:
any
,
originalEvent
:
mouse
.
DragMouseEvent
):
void
{
return
;
}
}
...
...
src/vs/base/parts/tree/browser/treeDnd.ts
浏览文件 @
2d451110
...
...
@@ -4,9 +4,9 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
_
from
'
vs/base/parts/tree/browser/tree
'
;
import
*
as
Mouse
from
'
vs/base/browser/mouseEvent
'
;
import
{
IDragAndDropData
}
from
'
vs/base/browser/dnd
'
;
export
class
ElementsDragAndDropData
implements
_
.
IDragAndDropData
{
export
class
ElementsDragAndDropData
implements
IDragAndDropData
{
private
elements
:
any
[];
...
...
@@ -14,7 +14,7 @@ export class ElementsDragAndDropData implements _.IDragAndDropData {
this
.
elements
=
elements
;
}
public
update
(
event
:
Mouse
.
DragMouseEvent
):
void
{
public
update
(
dataTransfer
:
DataTransfer
):
void
{
// no-op
}
...
...
@@ -23,7 +23,7 @@ export class ElementsDragAndDropData implements _.IDragAndDropData {
}
}
export
class
ExternalElementsDragAndDropData
implements
_
.
IDragAndDropData
{
export
class
ExternalElementsDragAndDropData
implements
IDragAndDropData
{
private
elements
:
any
[];
...
...
@@ -31,7 +31,7 @@ export class ExternalElementsDragAndDropData implements _.IDragAndDropData {
this
.
elements
=
elements
;
}
public
update
(
event
:
Mouse
.
DragMouseEvent
):
void
{
public
update
(
dataTransfer
:
DataTransfer
):
void
{
// no-op
}
...
...
@@ -40,7 +40,7 @@ export class ExternalElementsDragAndDropData implements _.IDragAndDropData {
}
}
export
class
DesktopDragAndDropData
implements
_
.
IDragAndDropData
{
export
class
DesktopDragAndDropData
implements
IDragAndDropData
{
private
types
:
any
[];
private
files
:
any
[];
...
...
@@ -50,15 +50,15 @@ export class DesktopDragAndDropData implements _.IDragAndDropData {
this
.
files
=
[];
}
public
update
(
event
:
Mouse
.
DragMouseEvent
):
void
{
if
(
event
.
dataTransfer
.
types
)
{
public
update
(
dataTransfer
:
DataTransfer
):
void
{
if
(
dataTransfer
.
types
)
{
this
.
types
=
[];
Array
.
prototype
.
push
.
apply
(
this
.
types
,
event
.
dataTransfer
.
types
);
Array
.
prototype
.
push
.
apply
(
this
.
types
,
dataTransfer
.
types
as
any
);
}
if
(
event
.
dataTransfer
.
files
)
{
if
(
dataTransfer
.
files
)
{
this
.
files
=
[];
Array
.
prototype
.
push
.
apply
(
this
.
files
,
event
.
dataTransfer
.
files
);
Array
.
prototype
.
push
.
apply
(
this
.
files
,
dataTransfer
.
files
as
any
);
this
.
files
=
this
.
files
.
filter
(
f
=>
f
.
size
||
f
.
type
);
}
...
...
src/vs/base/parts/tree/browser/treeView.ts
浏览文件 @
2d451110
...
...
@@ -21,7 +21,7 @@ import { HeightMap, IViewItem } from 'vs/base/parts/tree/browser/treeViewModel';
import
*
as
_
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
DataTransfers
}
from
'
vs/base/browser/dnd
'
;
import
{
DataTransfers
,
StaticDND
,
IDragAndDropData
}
from
'
vs/base/browser/dnd
'
;
import
{
DefaultTreestyler
}
from
'
./treeDefaults
'
;
import
{
Delayer
,
timeout
}
from
'
vs/base/common/async
'
;
...
...
@@ -410,8 +410,6 @@ export class TreeView extends HeightMap {
private
static
counter
:
number
=
0
;
private
instance
:
number
;
private
static
currentExternalDragAndDropData
:
_
.
IDragAndDropData
=
null
;
private
context
:
IViewContext
;
private
modelListeners
:
Lifecycle
.
IDisposable
[];
private
model
:
Model
.
TreeModel
;
...
...
@@ -438,7 +436,7 @@ export class TreeView extends HeightMap {
private
isRefreshing
=
false
;
private
refreshingPreviousChildrenIds
:
{
[
id
:
string
]:
string
[]
}
=
{};
private
currentDragAndDropData
:
_
.
IDragAndDropData
;
private
currentDragAndDropData
:
IDragAndDropData
;
private
currentDropElement
:
any
;
private
currentDropElementReaction
:
_
.
IDragOverReaction
;
private
currentDropTarget
:
ViewItem
;
...
...
@@ -1399,7 +1397,7 @@ export class TreeView extends HeightMap {
}
this
.
currentDragAndDropData
=
new
dnd
.
ElementsDragAndDropData
(
elements
);
TreeView
.
currentExternal
DragAndDropData
=
new
dnd
.
ExternalElementsDragAndDropData
(
elements
);
StaticDND
.
Current
DragAndDropData
=
new
dnd
.
ExternalElementsDragAndDropData
(
elements
);
this
.
context
.
dnd
.
onDragStart
(
this
.
context
.
tree
,
this
.
currentDragAndDropData
,
new
Mouse
.
DragMouseEvent
(
e
));
}
...
...
@@ -1482,8 +1480,8 @@ export class TreeView extends HeightMap {
if
(
!
this
.
currentDragAndDropData
)
{
// just started dragging
if
(
TreeView
.
currentExternal
DragAndDropData
)
{
this
.
currentDragAndDropData
=
TreeView
.
currentExternal
DragAndDropData
;
if
(
StaticDND
.
Current
DragAndDropData
)
{
this
.
currentDragAndDropData
=
StaticDND
.
Current
DragAndDropData
;
}
else
{
if
(
!
event
.
dataTransfer
.
types
)
{
return
false
;
...
...
@@ -1493,7 +1491,7 @@ export class TreeView extends HeightMap {
}
}
this
.
currentDragAndDropData
.
update
(
event
);
this
.
currentDragAndDropData
.
update
(
(
event
.
browserEvent
as
DragEvent
).
dataTransfer
);
let
element
:
any
;
let
item
:
Model
.
Item
=
viewItem
.
model
;
...
...
@@ -1581,7 +1579,7 @@ export class TreeView extends HeightMap {
if
(
this
.
currentDropElement
)
{
let
event
=
new
Mouse
.
DragMouseEvent
(
e
);
event
.
preventDefault
();
this
.
currentDragAndDropData
.
update
(
event
);
this
.
currentDragAndDropData
.
update
(
(
event
.
browserEvent
as
DragEvent
).
dataTransfer
);
this
.
context
.
dnd
.
drop
(
this
.
context
.
tree
,
this
.
currentDragAndDropData
,
this
.
currentDropElement
,
event
);
this
.
onDragEnd
(
e
);
}
...
...
@@ -1598,7 +1596,7 @@ export class TreeView extends HeightMap {
this
.
cancelDragAndDropScrollInterval
();
this
.
currentDragAndDropData
=
null
;
TreeView
.
currentExternalDragAndDropData
=
null
;
StaticDND
.
CurrentDragAndDropData
=
undefined
;
this
.
currentDropElement
=
null
;
this
.
currentDropTarget
=
null
;
this
.
dragAndDropMouseY
=
null
;
...
...
src/vs/workbench/browser/dnd.ts
浏览文件 @
2d451110
...
...
@@ -15,12 +15,12 @@ import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/un
import
{
DefaultEndOfLine
}
from
'
vs/editor/common/model
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IEditorViewState
}
from
'
vs/editor/common/editorCommon
'
;
import
{
DataTransfers
}
from
'
vs/base/browser/dnd
'
;
import
{
DataTransfers
,
IDragAndDropData
}
from
'
vs/base/browser/dnd
'
;
import
{
DefaultDragAndDrop
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
import
{
DragMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
normalizeDriveLetter
}
from
'
vs/base/common/labels
'
;
import
{
MIME_BINARY
}
from
'
vs/base/common/mime
'
;
import
{
ITree
,
IDragAndDropData
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
ITree
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
isWindows
}
from
'
vs/base/common/platform
'
;
import
{
coalesce
}
from
'
vs/base/common/arrays
'
;
import
{
ServicesAccessor
,
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts
浏览文件 @
2d451110
...
...
@@ -23,7 +23,7 @@ import { IFilesConfiguration, SortOrder } from 'vs/workbench/parts/files/common/
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
FileOperationError
,
FileOperationResult
,
IFileService
,
FileKind
}
from
'
vs/platform/files/common/files
'
;
import
{
DuplicateFileAction
,
AddFilesAction
,
IEditableData
,
IFileViewletState
,
FileCopiedContext
}
from
'
vs/workbench/parts/files/electron-browser/fileActions
'
;
import
{
IDataSource
,
ITree
,
IAccessibilityProvider
,
IRenderer
,
ContextMenuEvent
,
ISorter
,
IFilter
,
IDrag
AndDropData
,
IDrag
OverReaction
,
DRAG_OVER_ACCEPT_BUBBLE_DOWN
,
DRAG_OVER_ACCEPT_BUBBLE_DOWN_COPY
,
DRAG_OVER_ACCEPT_BUBBLE_UP
,
DRAG_OVER_ACCEPT_BUBBLE_UP_COPY
,
DRAG_OVER_REJECT
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
IDataSource
,
ITree
,
IAccessibilityProvider
,
IRenderer
,
ContextMenuEvent
,
ISorter
,
IFilter
,
IDragOverReaction
,
DRAG_OVER_ACCEPT_BUBBLE_DOWN
,
DRAG_OVER_ACCEPT_BUBBLE_DOWN_COPY
,
DRAG_OVER_ACCEPT_BUBBLE_UP
,
DRAG_OVER_ACCEPT_BUBBLE_UP_COPY
,
DRAG_OVER_REJECT
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
DesktopDragAndDropData
,
ExternalElementsDragAndDropData
}
from
'
vs/base/parts/tree/browser/treeDnd
'
;
import
{
ClickBehavior
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
import
{
ExplorerItem
,
NewStatPlaceholder
,
Model
}
from
'
vs/workbench/parts/files/common/explorerModel
'
;
...
...
@@ -46,7 +46,7 @@ import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common
import
{
extractResources
,
SimpleFileResourceDragAndDrop
,
CodeDataTransfers
,
fillResourceDataTransfers
}
from
'
vs/workbench/browser/dnd
'
;
import
{
WorkbenchTree
,
WorkbenchTreeController
}
from
'
vs/platform/list/browser/listService
'
;
import
{
IClipboardService
}
from
'
vs/platform/clipboard/common/clipboardService
'
;
import
{
DataTransfers
}
from
'
vs/base/browser/dnd
'
;
import
{
DataTransfers
,
IDragAndDropData
}
from
'
vs/base/browser/dnd
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
IWorkspaceFolderCreationData
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
rtrim
}
from
'
vs/base/common/strings
'
;
...
...
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
浏览文件 @
2d451110
...
...
@@ -878,19 +878,9 @@ export class RepositoryPanel extends ViewletPanel {
new
ResourceRenderer
(
this
.
listLabels
,
actionItemProvider
,
()
=>
this
.
getSelectedResources
(),
this
.
themeService
,
this
.
menus
)
];
const
that
=
this
;
this
.
list
=
this
.
instantiationService
.
createInstance
(
WorkbenchList
,
this
.
listContainer
,
delegate
,
renderers
,
{
identityProvider
:
scmResourceIdentityProvider
,
keyboardNavigationLabelProvider
:
scmKeyboardNavigationLabelProvider
,
dnd
:
{
getDragURI
(
element
)
{
return
'
file:///foo
'
;
},
// getDragLabel(elements) { return 'dragging'; },
onDragStart
(
data
,
originalEvent
)
{
},
onDragOver
(
data
,
targetElement
,
targetIndex
,
originalEvent
)
{
return
{
accept
:
true
,
feedback
:
typeof
targetIndex
===
'
undefined
'
?
undefined
:
[
targetIndex
-
1
,
targetIndex
,
targetIndex
+
1
].
filter
(
i
=>
i
>=
0
&&
i
<
that
.
list
.
length
)
};
},
drop
(
data
,
targetElement
,
originalEvent
)
{
}
}
keyboardNavigationLabelProvider
:
scmKeyboardNavigationLabelProvider
})
as
WorkbenchList
<
ISCMResourceGroup
|
ISCMResource
>
;
Event
.
chain
(
this
.
list
.
onDidOpen
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录