5
5
6
6
import * as DOM from 'vs/base/browser/dom' ;
7
7
import * as lifecycle from 'vs/base/common/lifecycle' ;
8
- import * as strings from 'vs/base/common/strings' ;
9
8
import { IAction , Action } from 'vs/base/common/actions' ;
10
9
import { BaseActionItem } from 'vs/base/browser/ui/actionbar/actionbar' ;
11
10
import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox' ;
@@ -36,17 +35,17 @@ export class FilterInputBoxActionItem extends BaseActionItem {
36
35
37
36
public render ( container : HTMLElement ) : void {
38
37
DOM . addClass ( container , 'markers-panel-action-filter' ) ;
39
- var filterInputBoxContainer = DOM . append ( container , DOM . emmet ( '.input-box-container' ) ) ;
40
- var filterInputBox = new InputBox ( filterInputBoxContainer , this . contextViewService , {
41
- placeholder : Messages . MARKERS_PANEL_FILTER_PLACEHOLDER
38
+ var filterInputBox = new InputBox ( container , this . contextViewService , {
39
+ placeholder : Messages . MARKERS_PANEL_FILTER_PLACEHOLDER ,
40
+ iconClass : 'filterIcon'
42
41
} ) ;
43
- filterInputBox . value = this . markersPanel . markersModel . filterOptions . completeValue ;
42
+ filterInputBox . value = this . markersPanel . markersModel . filterOptions . filter ;
44
43
this . toDispose . push ( filterInputBox . onDidChange ( ( filter : string ) => {
45
- this . markersPanel . markersModel . update ( this . prepareFilterOptions ( filter ) ) ;
44
+ this . markersPanel . markersModel . update ( new FilterOptions ( filter ) ) ;
46
45
this . markersPanel . refreshPanel ( ) ;
47
46
} ) ) ;
48
- this . toDispose . push ( DOM . addStandardDisposableListener ( filterInputBoxContainer , 'keydown' , this . handleKeyboardEvent ) ) ;
49
- this . toDispose . push ( DOM . addStandardDisposableListener ( filterInputBoxContainer , 'keyup' , this . handleKeyboardEvent ) ) ;
47
+ this . toDispose . push ( DOM . addStandardDisposableListener ( container , 'keydown' , this . handleKeyboardEvent ) ) ;
48
+ this . toDispose . push ( DOM . addStandardDisposableListener ( container , 'keyup' , this . handleKeyboardEvent ) ) ;
50
49
}
51
50
52
51
public dispose ( ) : void {
@@ -64,30 +63,4 @@ export class FilterInputBoxActionItem extends BaseActionItem {
64
63
break ;
65
64
}
66
65
}
67
-
68
- private prepareFilterOptions ( filter :string ) : FilterOptions {
69
- let filterOptions :FilterOptions = new FilterOptions ( ) ;
70
- filterOptions . completeValue = filter ;
71
-
72
- filter = strings . trim ( filter ) ;
73
- if ( ! filter ) {
74
- return filterOptions ;
75
- }
76
-
77
- let startIndex = 0 ;
78
- if ( strings . startsWith ( filter . toLocaleLowerCase ( ) , Messages . MARKERS_PANEL_FILTER_ERRORS ) ) {
79
- filterOptions . filterErrors = true ;
80
- startIndex = ( Messages . MARKERS_PANEL_FILTER_ERRORS ) . length ;
81
- }
82
- if ( strings . startsWith ( filter . toLocaleLowerCase ( ) , Messages . MARKERS_PANEL_FILTER_WARNINGS ) ) {
83
- filterOptions . filterWarnings = true ;
84
- startIndex = ( Messages . MARKERS_PANEL_FILTER_WARNINGS ) . length ;
85
- }
86
- if ( strings . startsWith ( filter . toLocaleLowerCase ( ) , Messages . MARKERS_PANEL_FILTER_INFOS ) ) {
87
- filterOptions . filterInfos = true ;
88
- startIndex = ( Messages . MARKERS_PANEL_FILTER_INFOS ) . length ;
89
- }
90
- filterOptions . filterValue = filter . substr ( startIndex ) . trim ( ) ;
91
- return filterOptions ;
92
- }
93
66
}
0 commit comments