|
Lines 102-109
Link Here
|
| 102 |
dfault : "proposal-default" //$NON-NLS-0$ |
102 |
dfault : "proposal-default" //$NON-NLS-0$ |
| 103 |
}; |
103 |
}; |
| 104 |
|
104 |
|
| 105 |
function ContentAssist(textView) { |
105 |
/** |
|
|
106 |
* @name ContentAssist |
| 107 |
* @description Creates a new content assist manager for the given text ciew |
| 108 |
* @param textView The text view to provide content assist for |
| 109 |
* @param serviceRegistry Optional, used to look up page message service for status |
| 110 |
*/ |
| 111 |
function ContentAssist(textView, serviceRegistry) { |
| 106 |
this.textView = textView; |
112 |
this.textView = textView; |
|
|
113 |
if (serviceRegistry){ |
| 114 |
this.pageMessage = serviceRegistry.getService("orion.page.message"); //$NON-NLS-1$ |
| 115 |
} |
| 107 |
this.state = State.INACTIVE; |
116 |
this.state = State.INACTIVE; |
| 108 |
this.clearProviders(); |
117 |
this.clearProviders(); |
| 109 |
var self = this; |
118 |
var self = this; |
|
Lines 368-375
Link Here
|
| 368 |
} |
377 |
} |
| 369 |
return Deferred.when(proposals); |
378 |
return Deferred.when(proposals); |
| 370 |
}); |
379 |
}); |
|
|
380 |
|
| 371 |
// TODO should we allow error to propagate instead of handling here? |
381 |
// TODO should we allow error to propagate instead of handling here? |
| 372 |
return Deferred.all(promises, this.handleError); |
382 |
var allPromises = Deferred.all(promises, this.handleError); |
|
|
383 |
|
| 384 |
if (this.pageMessage){ |
| 385 |
allPromises = Deferred.when(allPromises, function(proposals){ |
| 386 |
var foundProposal = false; |
| 387 |
if (proposals && proposals.length > 0){ |
| 388 |
for (var i=0; i<proposals.length; i++) { |
| 389 |
if (proposals[i].length > 0){ |
| 390 |
foundProposal = true; |
| 391 |
break; |
| 392 |
} |
| 393 |
} |
| 394 |
} |
| 395 |
if (!foundProposal){ |
| 396 |
self.pageMessage.setErrorMessage(messages["noProposals"]); |
| 397 |
} |
| 398 |
return proposals; |
| 399 |
}); |
| 400 |
self.pageMessage.showWhile(allPromises, messages["computingProposals"]); |
| 401 |
} |
| 402 |
|
| 403 |
return allPromises; |
| 373 |
}, |
404 |
}, |
| 374 |
|
405 |
|
| 375 |
filterProposals: function(force) { |
406 |
filterProposals: function(force) { |