/*
* @see org.eclipse.jface.text.TextViewer#handleVisibleDocumentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
*/
protected void handleVisibleDocumentChanged(DocumentEvent event) {
if (fHandleProjectionChanges && event instanceof ProjectionDocumentEvent && isProjectionMode()) {
ProjectionDocumentEvent e= (ProjectionDocumentEvent) event;
DocumentEvent master= e.getMasterEvent();
if (master != null)
fReplaceVisibleDocumentExecutionTrigger= master.getDocument();
try {
int replaceLength= e.getText() == null ? 0 : e.getText().length();
if (ProjectionDocumentEvent.PROJECTION_CHANGE == e.getChangeType()) {
if (e.getLength() == 0 && replaceLength != 0)
fProjectionAnnotationModel.expandAll(e.getMasterOffset(), e.getMasterLength());
} else if (master != null && (replaceLength > 0 || fDeletedLines > 1)) {
try {
int numberOfLines= e.getDocument().getNumberOfLines(e.getOffset(), replaceLength);
if (numberOfLines > 1 || fDeletedLines > 1)
fProjectionAnnotationModel.expandAll(master.getOffset(), master.getLength());
} catch (BadLocationException x) {
}
}