Lines 100-105
Link Here
|
100 |
|
100 |
|
101 |
private IHandlerActivation handlerActivation; |
101 |
private IHandlerActivation handlerActivation; |
102 |
|
102 |
|
|
|
103 |
private IHandlerActivation handlerCompletion; |
104 |
|
103 |
private void addTextViewer(TextViewer viewer) { |
105 |
private void addTextViewer(TextViewer viewer) { |
104 |
textViewers.add(viewer); |
106 |
textViewers.add(viewer); |
105 |
} |
107 |
} |
Lines 382-387
Link Here
|
382 |
createQuickFixActionHandler(commentViewer), new ActiveShellExpression( |
384 |
createQuickFixActionHandler(commentViewer), new ActiveShellExpression( |
383 |
commentViewer.getTextWidget().getShell())); |
385 |
commentViewer.getTextWidget().getShell())); |
384 |
} |
386 |
} |
|
|
387 |
if (handlerCompletion == null) { |
388 |
handlerCompletion = handlerService.activateHandler( |
389 |
ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, // |
390 |
createContentAssistActionHandler(commentViewer), // |
391 |
new ActiveShellExpression(commentViewer.getTextWidget().getShell())); |
392 |
} |
385 |
} |
393 |
} |
386 |
|
394 |
|
387 |
private void deactivate() { |
395 |
private void deactivate() { |
Lines 389-394
Link Here
|
389 |
handlerService.deactivateHandler(handlerActivation); |
397 |
handlerService.deactivateHandler(handlerActivation); |
390 |
handlerActivation = null; |
398 |
handlerActivation = null; |
391 |
} |
399 |
} |
|
|
400 |
if (handlerCompletion != null) { |
401 |
handlerService.deactivateHandler(handlerCompletion); |
402 |
handlerCompletion = null; |
403 |
} |
392 |
} |
404 |
} |
393 |
}); |
405 |
}); |
394 |
|
406 |
|
Lines 446-451
Link Here
|
446 |
return new ActionHandler(quickFixAction); |
458 |
return new ActionHandler(quickFixAction); |
447 |
} |
459 |
} |
448 |
|
460 |
|
|
|
461 |
|
462 |
private IHandler createContentAssistActionHandler(final SourceViewer viewer) { |
463 |
Action quickFixAction = new Action() { |
464 |
public void run() { |
465 |
if (viewer.canDoOperation(ISourceViewer.CONTENTASSIST_PROPOSALS)) { |
466 |
viewer.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS); |
467 |
} |
468 |
} |
469 |
}; |
470 |
quickFixAction.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); |
471 |
return new ActionHandler(quickFixAction); |
472 |
} |
473 |
|
449 |
@Override |
474 |
@Override |
450 |
public boolean isDirty() { |
475 |
public boolean isDirty() { |
451 |
return isDirty; |
476 |
return isDirty; |