|
Lines 280-298
Link Here
|
| 280 |
|
280 |
|
| 281 |
// TODO We check that the internal access to annotation model exists so if it breaks we don't show the checkbox at all |
281 |
// TODO We check that the internal access to annotation model exists so if it breaks we don't show the checkbox at all |
| 282 |
if (command.fixAllEnabled && commandInvocation.userData._annotationModel){ |
282 |
if (command.fixAllEnabled && commandInvocation.userData._annotationModel){ |
| 283 |
var id = command.name + 'fixAll'; //$NON-NLS-1$ |
283 |
var targetAnnotation = commandInvocation.userData; |
| 284 |
fixAllCheckbox = document.createElement('input'); //$NON-NLS-1$ |
284 |
var hasMultiple = false; |
| 285 |
fixAllCheckbox.type = 'checkbox'; //$NON-NLS-1$ |
285 |
var allAnnotations = commandInvocation.userData._annotationModel._annotations; |
| 286 |
fixAllCheckbox.className = "quickfixAllParameter"; //$NON-NLS-1$ |
286 |
for (var i=0; i<allAnnotations.length; i++) { |
| 287 |
fixAllCheckbox.id = id; |
287 |
if (allAnnotations[i].id === targetAnnotation.id && (allAnnotations[i].start !== targetAnnotation.start || allAnnotations[i].end !== targetAnnotation.end)){ |
| 288 |
|
288 |
hasMultiple = true; |
| 289 |
fixAllLabel = document.createElement('label'); //$NON-NLS-1$ |
289 |
break; |
| 290 |
fixAllLabel.htmlFor = id; |
290 |
} |
| 291 |
fixAllLabel.className = "quickfixAllParameter"; //$NON-NLS-1$ |
291 |
} |
| 292 |
fixAllLabel.appendChild(document.createTextNode(messages['fixAll'])); |
292 |
if (hasMultiple){ |
| 293 |
|
293 |
var id = command.name + 'fixAll'; //$NON-NLS-1$ |
| 294 |
element.appendChild(fixAllCheckbox); |
294 |
fixAllCheckbox = document.createElement('input'); //$NON-NLS-1$ |
| 295 |
element.appendChild(fixAllLabel); |
295 |
fixAllCheckbox.type = 'checkbox'; //$NON-NLS-1$ |
|
|
296 |
fixAllCheckbox.className = "quickfixAllParameter"; //$NON-NLS-1$ |
| 297 |
fixAllCheckbox.id = id; |
| 298 |
|
| 299 |
fixAllLabel = document.createElement('label'); //$NON-NLS-1$ |
| 300 |
fixAllLabel.htmlFor = id; |
| 301 |
fixAllLabel.className = "quickfixAllParameter"; //$NON-NLS-1$ |
| 302 |
fixAllLabel.appendChild(document.createTextNode(messages['fixAll'])); |
| 303 |
|
| 304 |
element.appendChild(fixAllCheckbox); |
| 305 |
element.appendChild(fixAllLabel); |
| 306 |
} |
| 296 |
} |
307 |
} |
| 297 |
|
308 |
|
| 298 |
parent.appendChild(element); |
309 |
parent.appendChild(element); |