@@ -17,7 +17,7 @@ import { SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND } from 'vs/workbench/common/th
17
17
import { IQuickOpenService , IPickOpenEntry , IPickOptions , IInputOptions } from 'vs/platform/quickOpen/common/quickOpen' ;
18
18
import { TPromise } from 'vs/base/common/winjs.base' ;
19
19
import { CancellationToken } from 'vs/base/common/cancellation' ;
20
- import { QuickInputCheckboxList } from './quickInputCheckboxList ' ;
20
+ import { QuickInputList } from './quickInputList ' ;
21
21
import { QuickInputBox } from './quickInputBox' ;
22
22
import { KeyCode } from 'vs/base/common/keyCodes' ;
23
23
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent' ;
@@ -77,7 +77,7 @@ interface QuickInputUI {
77
77
inputBox : QuickInputBox ;
78
78
count : CountBadge ;
79
79
message : HTMLElement ;
80
- checkboxList : QuickInputCheckboxList ;
80
+ list : QuickInputList ;
81
81
close : ( ok ?: true | Thenable < never > ) => void ;
82
82
}
83
83
@@ -89,7 +89,7 @@ interface InputController<R> {
89
89
}
90
90
91
91
class PickOneController < T extends IPickOpenEntry > implements InputController < T > {
92
- public showUI = { inputBox : true , checkboxList : true } ;
92
+ public showUI = { inputBox : true , list : true } ;
93
93
public result : TPromise < T > ;
94
94
public ready : TPromise < void > ;
95
95
public resolve : ( ok ?: true | Thenable < never > ) => void ;
@@ -99,43 +99,43 @@ class PickOneController<T extends IPickOpenEntry> implements InputController<T>
99
99
100
100
constructor ( ui : QuickInputUI , parameters : PickOneParameters < T > ) {
101
101
this . result = new TPromise < T > ( ( resolve , reject , progress ) => {
102
- this . resolve = ok => resolve ( ok === true ? < T > ui . checkboxList . getFocusedElements ( ) [ 0 ] : ok ) ;
102
+ this . resolve = ok => resolve ( ok === true ? < T > ui . list . getFocusedElements ( ) [ 0 ] : ok ) ;
103
103
this . progress = progress ;
104
104
} ) ;
105
105
this . result . then ( ( ) => this . dispose ( ) ) ;
106
106
107
107
ui . inputBox . value = '' ;
108
108
ui . inputBox . setPlaceholder ( parameters . placeHolder || '' ) ;
109
- ui . checkboxList . matchOnDescription = parameters . matchOnDescription ;
110
- ui . checkboxList . matchOnDetail = parameters . matchOnDetail ;
111
- ui . checkboxList . setElements ( [ ] ) ;
109
+ ui . list . matchOnDescription = parameters . matchOnDescription ;
110
+ ui . list . matchOnDetail = parameters . matchOnDetail ;
111
+ ui . list . setElements ( [ ] ) ;
112
112
113
113
this . ready = parameters . picks . then ( elements => {
114
114
if ( this . closed ) {
115
115
return ;
116
116
}
117
117
118
- ui . checkboxList . setElements ( elements ) ;
119
- ui . checkboxList . filter ( ui . inputBox . value ) ;
120
- ui . checkboxList . focus ( 'First' ) ;
118
+ ui . list . setElements ( elements ) ;
119
+ ui . list . filter ( ui . inputBox . value ) ;
120
+ ui . list . focus ( 'First' ) ;
121
121
122
122
this . disposables . push (
123
- ui . checkboxList . onSelectionChange ( elements => {
123
+ ui . list . onSelectionChange ( elements => {
124
124
if ( elements [ 0 ] ) {
125
125
ui . close ( true ) ;
126
126
}
127
127
} ) ,
128
128
ui . inputBox . onDidChange ( value => {
129
- ui . checkboxList . filter ( value ) ;
130
- ui . checkboxList . focus ( 'First' ) ;
129
+ ui . list . filter ( value ) ;
130
+ ui . list . focus ( 'First' ) ;
131
131
} ) ,
132
132
ui . inputBox . onKeyDown ( event => {
133
133
switch ( event . keyCode ) {
134
134
case KeyCode . DownArrow :
135
- ui . checkboxList . focus ( 'Next' ) ;
135
+ ui . list . focus ( 'Next' ) ;
136
136
break ;
137
137
case KeyCode . UpArrow :
138
- ui . checkboxList . focus ( 'Previous' ) ;
138
+ ui . list . focus ( 'Previous' ) ;
139
139
break ;
140
140
}
141
141
} )
@@ -150,7 +150,7 @@ class PickOneController<T extends IPickOpenEntry> implements InputController<T>
150
150
}
151
151
152
152
class PickManyController < T extends IPickOpenEntry > implements InputController < T [ ] > {
153
- public showUI = { checkAll : true , inputBox : true , count : true , ok : true , checkboxList : true } ;
153
+ public showUI = { checkAll : true , inputBox : true , count : true , ok : true , list : true } ;
154
154
public result : TPromise < T [ ] > ;
155
155
public ready : TPromise < void > ;
156
156
public resolve : ( ok ?: true | Thenable < never > ) => void ;
@@ -160,42 +160,42 @@ class PickManyController<T extends IPickOpenEntry> implements InputController<T[
160
160
161
161
constructor ( ui : QuickInputUI , parameters : PickManyParameters < T > ) {
162
162
this . result = new TPromise < T [ ] > ( ( resolve , reject , progress ) => {
163
- this . resolve = ok => resolve ( ok === true ? < T [ ] > ui . checkboxList . getCheckedElements ( ) : ok ) ;
163
+ this . resolve = ok => resolve ( ok === true ? < T [ ] > ui . list . getCheckedElements ( ) : ok ) ;
164
164
this . progress = progress ;
165
165
} ) ;
166
166
this . result . then ( ( ) => this . dispose ( ) ) ;
167
167
168
168
ui . inputBox . value = '' ;
169
169
ui . inputBox . setPlaceholder ( parameters . placeHolder || '' ) ;
170
- ui . checkboxList . matchOnDescription = parameters . matchOnDescription ;
171
- ui . checkboxList . matchOnDetail = parameters . matchOnDetail ;
172
- ui . checkboxList . setElements ( [ ] ) ;
173
- ui . checkAll . checked = ui . checkboxList . getAllVisibleChecked ( ) ;
174
- ui . count . setCount ( ui . checkboxList . getCheckedCount ( ) ) ;
170
+ ui . list . matchOnDescription = parameters . matchOnDescription ;
171
+ ui . list . matchOnDetail = parameters . matchOnDetail ;
172
+ ui . list . setElements ( [ ] ) ;
173
+ ui . checkAll . checked = ui . list . getAllVisibleChecked ( ) ;
174
+ ui . count . setCount ( ui . list . getCheckedCount ( ) ) ;
175
175
176
176
this . ready = parameters . picks . then ( elements => {
177
177
if ( this . closed ) {
178
178
return ;
179
179
}
180
180
181
- ui . checkboxList . setElements ( elements , true ) ;
182
- ui . checkboxList . filter ( ui . inputBox . value ) ;
183
- ui . checkAll . checked = ui . checkboxList . getAllVisibleChecked ( ) ;
184
- ui . count . setCount ( ui . checkboxList . getCheckedCount ( ) ) ;
181
+ ui . list . setElements ( elements , true ) ;
182
+ ui . list . filter ( ui . inputBox . value ) ;
183
+ ui . checkAll . checked = ui . list . getAllVisibleChecked ( ) ;
184
+ ui . count . setCount ( ui . list . getCheckedCount ( ) ) ;
185
185
186
186
this . disposables . push (
187
187
ui . inputBox . onDidChange ( value => {
188
- ui . checkboxList . filter ( value ) ;
188
+ ui . list . filter ( value ) ;
189
189
} ) ,
190
190
ui . inputBox . onKeyDown ( event => {
191
191
switch ( event . keyCode ) {
192
192
case KeyCode . DownArrow :
193
- ui . checkboxList . focus ( 'First' ) ;
194
- ui . checkboxList . domFocus ( ) ;
193
+ ui . list . focus ( 'First' ) ;
194
+ ui . list . domFocus ( ) ;
195
195
break ;
196
196
case KeyCode . UpArrow :
197
- ui . checkboxList . focus ( 'Last' ) ;
198
- ui . checkboxList . domFocus ( ) ;
197
+ ui . list . focus ( 'Last' ) ;
198
+ ui . list . domFocus ( ) ;
199
199
break ;
200
200
}
201
201
} )
@@ -363,7 +363,7 @@ export class QuickInputService extends Component implements IQuickInputService {
363
363
checkAll . type = 'checkbox' ;
364
364
this . toUnbind . push ( dom . addStandardDisposableListener ( checkAll , dom . EventType . CHANGE , e => {
365
365
const checked = checkAll . checked ;
366
- checkboxList . setAllVisibleChecked ( checked ) ;
366
+ list . setAllVisibleChecked ( checked ) ;
367
367
} ) ) ;
368
368
this . toUnbind . push ( dom . addDisposableListener ( checkAll , dom . EventType . CLICK , e => {
369
369
if ( e . x || e . y ) { // Avoid 'click' triggered by 'space'...
@@ -396,23 +396,23 @@ export class QuickInputService extends Component implements IQuickInputService {
396
396
dom . addClass ( this . progressBar . getContainer ( ) , 'quick-input-progress' ) ;
397
397
this . toUnbind . push ( attachProgressBarStyler ( this . progressBar , this . themeService ) ) ;
398
398
399
- const checkboxList = this . instantiationService . createInstance ( QuickInputCheckboxList , this . container ) ;
400
- this . toUnbind . push ( checkboxList ) ;
401
- this . toUnbind . push ( checkboxList . onAllVisibleCheckedChanged ( checked => {
399
+ const list = this . instantiationService . createInstance ( QuickInputList , this . container ) ;
400
+ this . toUnbind . push ( list ) ;
401
+ this . toUnbind . push ( list . onAllVisibleCheckedChanged ( checked => {
402
402
checkAll . checked = checked ;
403
403
} ) ) ;
404
- this . toUnbind . push ( checkboxList . onCheckedCountChanged ( c => {
404
+ this . toUnbind . push ( list . onCheckedCountChanged ( c => {
405
405
count . setCount ( c ) ;
406
406
} ) ) ;
407
- this . toUnbind . push ( checkboxList . onLeave ( ( ) => {
407
+ this . toUnbind . push ( list . onLeave ( ( ) => {
408
408
// Defer to avoid the input field reacting to the triggering key.
409
409
setTimeout ( ( ) => {
410
410
inputBox . setFocus ( ) ;
411
- checkboxList . clearFocus ( ) ;
411
+ list . clearFocus ( ) ;
412
412
} , 0 ) ;
413
413
} ) ) ;
414
414
this . toUnbind . push (
415
- chain ( checkboxList . onFocusChange )
415
+ chain ( list . onFocusChange )
416
416
. map ( e => e [ 0 ] )
417
417
. filter ( e => ! ! e )
418
418
. latch ( )
@@ -469,7 +469,7 @@ export class QuickInputService extends Component implements IQuickInputService {
469
469
470
470
this . toUnbind . push ( this . quickOpenService . onShow ( ( ) => this . close ( ) ) ) ;
471
471
472
- this . ui = { checkAll, inputBox, count, message, checkboxList , close : ok => this . close ( ok ) } ;
472
+ this . ui = { checkAll, inputBox, count, message, list , close : ok => this . close ( ok ) } ;
473
473
this . updateStyles ( ) ;
474
474
}
475
475
@@ -554,7 +554,7 @@ export class QuickInputService extends Component implements IQuickInputService {
554
554
this . countContainer . style . display = this . controller . showUI . count ? '' : 'none' ;
555
555
this . okContainer . style . display = this . controller . showUI . ok ? '' : 'none' ;
556
556
this . ui . message . style . display = this . controller . showUI . message ? '' : 'none' ;
557
- this . ui . checkboxList . display ( this . controller . showUI . checkboxList ) ;
557
+ this . ui . list . display ( this . controller . showUI . list ) ;
558
558
559
559
if ( this . container . style . display === 'none' ) {
560
560
this . inQuickOpen ( 'quickInput' , true ) ;
@@ -604,13 +604,13 @@ export class QuickInputService extends Component implements IQuickInputService {
604
604
605
605
toggle ( ) {
606
606
if ( this . isDisplayed ( ) && this . controller instanceof PickManyController ) {
607
- this . ui . checkboxList . toggleCheckbox ( ) ;
607
+ this . ui . list . toggleCheckbox ( ) ;
608
608
}
609
609
}
610
610
611
611
navigate ( next : boolean ) {
612
- if ( this . isDisplayed ( ) && this . ui . checkboxList . isDisplayed ( ) ) {
613
- this . ui . checkboxList . focus ( next ? 'Next' : 'Previous' ) ;
612
+ if ( this . isDisplayed ( ) && this . ui . list . isDisplayed ( ) ) {
613
+ this . ui . list . focus ( next ? 'Next' : 'Previous' ) ;
614
614
}
615
615
}
616
616
@@ -638,7 +638,7 @@ export class QuickInputService extends Component implements IQuickInputService {
638
638
style . marginLeft = '-' + ( width / 2 ) + 'px' ;
639
639
640
640
this . ui . inputBox . layout ( ) ;
641
- this . ui . checkboxList . layout ( ) ;
641
+ this . ui . list . layout ( ) ;
642
642
}
643
643
}
644
644
0 commit comments