Skip to content

Commit e160a45

Browse files
committed
Show deprecated commands in command Autocomplete as well
1 parent 837efa6 commit e160a45

File tree

2 files changed

+86
-76
lines changed

2 files changed

+86
-76
lines changed

Diff for: ide/main/src/components/SeleniumIDEGenericAutoCompleteSearch.js

+80-76
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,42 @@ function SeleniumIDEGenericAutoCompleteSearch() {
33
}
44

55
SeleniumIDEGenericAutoCompleteSearch.prototype = {
6-
startSearch: function(searchString, searchParam, prevResult, listener) {
7-
var result = new AutoCompleteResult(searchString, this.candidates[searchParam] || []);
8-
listener.onSearchResult(this, result);
9-
},
10-
11-
stopSearch: function() {
12-
},
13-
14-
setCandidates: function(key, values) {
15-
this.setCandidatesWithComments(key, values, null);
16-
},
17-
18-
setCandidatesWithComments: function(key, values, comments) {
19-
var count = values.Count();
20-
var candidates = this.candidates[key] = new Array(count);
21-
for (var i = 0; i < count; i++) {
22-
candidates[i] = [values.GetElementAt(i).QueryInterface(Components.interfaces.nsISupportsString).data,
23-
comments ? comments.GetElementAt(i).QueryInterface(Components.interfaces.nsISupportsString).data : null];
24-
}
25-
},
26-
27-
clearCandidates: function(key) {
28-
if (this.candidates[key]) {
29-
delete this.candidates[key];
30-
}
31-
},
6+
startSearch: function(searchString, searchParam, prevResult, listener) {
7+
var result = new AutoCompleteResult(searchString, this.candidates[searchParam] || []);
8+
listener.onSearchResult(this, result);
9+
},
10+
11+
stopSearch: function() {
12+
},
13+
14+
setCandidates: function(key, values) {
15+
this.setCandidatesWithComments(key, values, null);
16+
},
17+
18+
setCandidatesWithComments: function(key, values, comments) {
19+
var count = values.Count();
20+
var candidates = this.candidates[key] = new Array(count);
21+
for (var i = 0; i < count; i++) {
22+
candidates[i] = [values.GetElementAt(i).QueryInterface(Components.interfaces.nsISupportsString).data,
23+
comments ? comments.GetElementAt(i).QueryInterface(Components.interfaces.nsISupportsString).data : null];
24+
}
25+
},
26+
27+
clearCandidates: function(key) {
28+
if (this.candidates[key]) {
29+
delete this.candidates[key];
30+
}
31+
},
3232

33-
QueryInterface: function(uuid) {
34-
if (uuid.equals(Components.interfaces.nsISeleniumIDEGenericAutoCompleteSearch) ||
35-
uuid.equals(Components.interfaces.nsIAutoCompleteSearch) ||
36-
uuid.equals(Components.interfaces.nsISupports)) {
37-
return this;
38-
}
39-
Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE;
40-
return null;
33+
QueryInterface: function(uuid) {
34+
if (uuid.equals(Components.interfaces.nsISeleniumIDEGenericAutoCompleteSearch) ||
35+
uuid.equals(Components.interfaces.nsIAutoCompleteSearch) ||
36+
uuid.equals(Components.interfaces.nsISupports)) {
37+
return this;
4138
}
39+
Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE;
40+
return null;
41+
}
4242
};
4343

4444
function AutoCompleteResult(search, candidates) {
@@ -70,49 +70,53 @@ function AutoCompleteResult(search, candidates) {
7070
}
7171

7272
AutoCompleteResult.prototype = {
73-
get defaultIndex() {
74-
return 0;
75-
},
76-
get errorDescription() {
77-
return '';
78-
},
79-
get matchCount() {
80-
return this.result.length;
81-
},
82-
get searchResult() {
83-
return Components.interfaces.nsIAutoCompleteResult.RESULT_SUCCESS;
84-
},
85-
get searchString() {
86-
return this.search;
87-
},
88-
getCommentAt: function(index) {
89-
return this.result[index][1] || '';
90-
},
91-
getStyleAt: function(index) {
92-
return '';
93-
},
94-
getValueAt: function(index) {
95-
return this.result[index][0];
96-
},
97-
getImageAt: function (index) {
98-
return '';
99-
},
100-
getLabelAt: function getLabelAt(index) {
101-
return this.getValueAt(index);
102-
},
103-
getFinalCompleteValueAt: function(index) {
104-
return this.getValueAt(index);
105-
},
106-
removeValueAt: function(rowIndex, removeFromDb) {
107-
},
108-
QueryInterface: function (uuid) {
109-
if (uuid.equals(Components.interfaces.nsIAutoCompleteResult) ||
110-
uuid.equals(Components.interfaces.nsISupports)) {
111-
return this;
112-
}
113-
Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE;
114-
return null;
73+
get searchString() {
74+
return this.search;
75+
},
76+
get searchResult() {
77+
return Components.interfaces.nsIAutoCompleteResult.RESULT_SUCCESS;
78+
},
79+
get defaultIndex() {
80+
return 0;
81+
},
82+
get errorDescription() {
83+
return '';
84+
},
85+
get matchCount() {
86+
return this.result.length;
87+
},
88+
get typeAheadResult() {
89+
return false;
90+
},
91+
getValueAt: function(index) {
92+
return this.result[index][0];
93+
},
94+
getLabelAt: function(index) {
95+
return this.getValueAt(index);
96+
},
97+
getCommentAt: function(index) {
98+
return this.result[index][1] || '';
99+
},
100+
getStyleAt: function(index) {
101+
// TODO improve this proof of concept with an optimised version for multiple deprecated commands
102+
return this.result[index][0] === "verifyTextPresent" ? 'deprecated' : '';
103+
},
104+
getImageAt: function (index) {
105+
return '';
106+
},
107+
getFinalCompleteValueAt: function(index) {
108+
return this.getValueAt(index);
109+
},
110+
removeValueAt: function(rowIndex, removeFromDb) {
111+
},
112+
QueryInterface: function (uuid) {
113+
if (uuid.equals(Components.interfaces.nsIAutoCompleteResult) ||
114+
uuid.equals(Components.interfaces.nsISupports)) {
115+
return this;
115116
}
117+
Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE;
118+
return null;
119+
}
116120
};
117121

118122
//const COMPONENT_ID = Components.ID("{4791AF5F-AFBA-45A1-8204-47A135DF9591}");

Diff for: ide/main/src/skin/classic/selenium-ide.css

+6
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ treechildren::-moz-tree-cell-text(currentTestCase)
7878
font-weight: bold;
7979
}
8080

81+
/*
82+
* Autocomplete show deprecated
83+
*/
84+
treechildren.autocomplete-treebody::-moz-tree-cell-text(deprecated) {
85+
color: red;
86+
}
8187

8288
/*
8389
* Log Console

0 commit comments

Comments
 (0)